phpservermon/static/js/history.js

13 lines
564 B
JavaScript
Raw Normal View History

function updateScale(chart, min, unit) {
chart.options.scales.xAxes[0].time.min = min;
chart.options.scales.xAxes[0].time.unit = unit;
// 0 to disable animation
2019-02-17 19:57:28 +01:00
chart.update(0);
}
2019-02-17 19:57:28 +01:00
$('input[name=timeframe_short]').change(function () {
updateScale(historyShort, parseInt($('input[name=timeframe_short]:checked').val()), $('input[name=timeframe_short]:checked')[0].id);
2014-03-24 02:29:22 +01:00
});
2019-02-17 19:57:28 +01:00
$('input[name=timeframe_long]').change(function () {
updateScale(historyLong, parseInt($('input[name=timeframe_long]:checked').val()), $('input[name=timeframe_long]:checked')[0].id);
});