Fixes custom range on mouse zoom

main
Yasen Pramatarov 2024-10-12 17:02:07 +03:00
parent 6b4f344bfd
commit 0318670bce
3 changed files with 9 additions and 1 deletions

View File

@ -73,6 +73,7 @@ var graph_<?= $data['graph_name'] ?> = new Chart(ctx, {
}, },
onZoom: function({ chart }) { onZoom: function({ chart }) {
propagateZoom(chart); // Propagate the zoom to all graphs propagateZoom(chart); // Propagate the zoom to all graphs
setActive(document.getElementById('custom_range'));
} }
} }
}, },

View File

@ -11,7 +11,7 @@
<input type="date" style="margin-right: 3px;" id="start-date"> <input type="date" style="margin-right: 3px;" id="start-date">
<input type="date" style="margin-right: 3px;" id="end-date"> <input type="date" style="margin-right: 3px;" id="end-date">
<input type="button" class="button" onclick="setCustomTimeRange(); setActive(this)" value="custom range" /> <input type="button" id="custom_range" class="button" onclick="setCustomTimeRange(); setActive(this)" value="custom range" />
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,3 +1,10 @@
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.menu-container { .menu-container {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;