Skip to content

Commit

Permalink
🐛 Force render graphs (fixed upptime/upptime#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 30, 2020
1 parent 2dd47b5 commit 69f30a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Graph.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
let commits = [];
let labels = [];
let data = [];
let width = 800;
onMount(async () => {
try {
Expand Down Expand Up @@ -47,14 +48,14 @@
<style>
</style>

<section>
<section bind:clientWidth={width}>
{#if loading}
<Loading />
{:else if data.length}
<h2>{config.i18n.sevelDayResponseTime}</h2>
<Line
data={{ labels, datasets: [{ label: config.i18n.responseTimeMs, backgroundColor: config.graphBackgroundColor || '#89e0cf', borderColor: config.graphBorderColor || '#1abc9c', data }] }}
width={800}
{width}
height={400}
options={{ responsive: true, maintainAspectRatio: true, scales: { xAxes: [{ display: false, gridLines: { display: false } }] } }} />
{/if}
Expand Down

0 comments on commit 69f30a2

Please sign in to comment.