From aaaa231a59440b758f402c453002e9bccd6931f2 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Thu, 3 Aug 2023 09:01:28 +0700 Subject: [PATCH] Fix date label range --- view-mode/function/overlaySCurve.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/view-mode/function/overlaySCurve.js b/view-mode/function/overlaySCurve.js index 364d90e..fb56d20 100644 --- a/view-mode/function/overlaySCurve.js +++ b/view-mode/function/overlaySCurve.js @@ -145,19 +145,22 @@ var lineOverlay = overlayControl.addOverlay(function(container) { var values = getProgressLine(); var scaleLabels = []; - if(parts[2] && parts[2] == '1'){ +// if(parts[2] && parts[2] == '1'){ +// values.dates.forEach(function(date){ +// var dateScale = new Date(date); +// scaleLabels.push(dateToStr(dateScale)); +// }) +// } else { +// var chartScale = getChartScaleRange(); + +// chartScale.forEach(function(date){ +// scaleLabels.push(dateToStr(date)); +// }); +// } values.dates.forEach(function(date){ var dateScale = new Date(date); scaleLabels.push(dateToStr(dateScale)); }) - } else { - var chartScale = getChartScaleRange(); - - chartScale.forEach(function(date){ - scaleLabels.push(dateToStr(date)); - }); - } - var canvas = document.createElement("canvas"); container.appendChild(canvas); canvas.style.height = container.offsetHeight + "px";