Update scripts/pi-hole/js/index.js

Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: DL6ER <DL6ER@users.noreply.github.com>
This commit is contained in:
DL6ER
2023-11-07 19:14:46 +01:00
committed by GitHub
parent 59809d9959
commit 752e37ffac

View File

@@ -432,8 +432,8 @@ $(function () {
},
mode: "y",
onZoom: function ({ chart }) {
// The first time the chart is zoomed, save the absolute maximum value
if (!chart.absMax) chart.absMax = chart.scales.y.max;
// The first time the chart is zoomed, save the maximum initial scale bound
if (!chart.absMax) chart.absMax = chart.getInitialScaleBounds().y.max;
// Calculate the maximum value to be shown for the current zoom level
const zoomMax = chart.absMax / chart.getZoomLevel();
// Update the y axis scale