Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/lib/components/chart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
chart: {
type: "area",
backgroundColor: "transparent",
height: 320,
spacing: [12, 8, 8, 8],
zooming: {
type: "x",
},
Expand Down Expand Up @@ -116,6 +118,10 @@
shared: true,
shadow: false,
formatter: function (this: any): any {
if (!this.points?.length) {
return "";
}

return `<span style="font-size: 12px; font-weight: bold">${moment(
this.points[0].x
).format("YYYY-MM-DD HH:mm:ss")}</span><br/>${this.points
Expand All @@ -134,6 +140,7 @@
plotOptions: {
series: {
threshold: null,
connectNulls: false,
},
area: {
lineColor: "#2662D9",
Expand Down Expand Up @@ -165,6 +172,8 @@
text: title,
style: {
color: "white",
fontSize: "16px",
fontWeight: "600",
},
},
series: series.map((series, index) =>
Expand Down Expand Up @@ -195,7 +204,7 @@
</script>

{#if browser}
<div class="rounded-xl border bg-input/30 p-4">
<div class="min-w-0 overflow-hidden rounded-lg border bg-input/30 p-2 sm:p-4">
<Chart {options} highcharts={Highcharts} />
</div>
{/if}
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</script>

<svelte:head><link rel="icon" href={favicon} /></svelte:head>
<main class="p-6">
<main class="min-h-dvh px-3 py-4 sm:px-6 sm:py-6">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the padding needs to change when on different screen sizes

{@render children()}
</main>
Loading