From 89da9098a0b23e5293b5254fa3773814fe5bf42a Mon Sep 17 00:00:00 2001 From: Ilkka Huotari Date: Thu, 21 Mar 2024 03:47:00 +0200 Subject: [PATCH] Update index.js --- src/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 74644c1..3107ef9 100644 --- a/src/index.js +++ b/src/index.js @@ -175,7 +175,8 @@ } function draw() { - var width = document.querySelector("#chart").offsetWidth, + var element = document.querySelector("#chart"), + width = element.offsetWidth, height = 550, hoverDetail, time, @@ -183,8 +184,10 @@ x_axis, y_axis; + element.innerHTML = ''; + graph = new global.Rickshaw.Graph({ - element: document.querySelector("#chart"), + element, width: width, height: height, renderer: 'area',