|
|
@ -151,12 +151,12 @@ function adjustDataToZoom(dates, data, chartScaleRange, zoomLevel) { |
|
|
|
for (var i = 0; i < data.length; i++) { |
|
|
|
for (var i = 0; i < data.length; i++) { |
|
|
|
aggregateValue = data[i]; |
|
|
|
aggregateValue = data[i]; |
|
|
|
|
|
|
|
|
|
|
|
if (zoomLevel === 2 && i % 30 === 29) { |
|
|
|
if (zoomLevel === 2 && i % 30 === 0) { |
|
|
|
// Aggregate data for each month (assuming 30 days in a month)
|
|
|
|
// Aggregate data for each month (assuming 30 days in a month)
|
|
|
|
newData.push(aggregateValue); |
|
|
|
newData.push(aggregateValue); |
|
|
|
newDates.push(dates[i]); |
|
|
|
newDates.push(dates[i]); |
|
|
|
aggregateValue = 0; |
|
|
|
aggregateValue = 0; |
|
|
|
} else if (zoomLevel === 1 && (i + 1) % 7 === 0) { |
|
|
|
} else if (zoomLevel === 1 && (i + 1) % 7 === 1) { |
|
|
|
// Aggregate data for each week
|
|
|
|
// Aggregate data for each week
|
|
|
|
newData.push(aggregateValue); |
|
|
|
newData.push(aggregateValue); |
|
|
|
newDates.push(dates[i]); |
|
|
|
newDates.push(dates[i]); |
|
|
|