Charts improvements: always ensure that a minimal number of points is available

This commit is contained in:
emanuele-f 2018-10-29 11:29:45 +01:00
parent 3683d1dbf9
commit 13dfdbdcd6
3 changed files with 6 additions and 7 deletions

View file

@ -456,11 +456,10 @@ function attachStackedChartCallback(chart, schema_name, chart_id, zoom_reset_id,
return false;
}
if(is_user_zoom) {
var epoch = params.epoch_begin + (params.epoch_end - params.epoch_begin) / 2;
params.epoch_begin = Math.floor(epoch - max_interval / 2);
params.epoch_end = Math.ceil(epoch + max_interval / 2);
}
/* Ensure that a minimal number of points is available */
var epoch = params.epoch_begin + (params.epoch_end - params.epoch_begin) / 2;
params.epoch_begin = Math.floor(epoch - max_interval / 2);
params.epoch_end = Math.ceil(epoch + max_interval / 2);
is_max_zoom = true;
chart.zoomType(null); // disable zoom

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long