Browse Source

Fix date label range

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
aaaa231a59
  1. 21
      view-mode/function/overlaySCurve.js

21
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";

Loading…
Cancel
Save