Don't overlap time ticks with current time

This commit is contained in:
AdrianLxM 2018-03-16 23:57:58 +01:00 committed by GitHub
parent b6ce7c03c6
commit 1738aea4de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -452,7 +452,7 @@ public class BgGraphBuilder {
// add all full hours within the timeframe
while (hourTick < end_time){
if(Math.abs(hourTick - timeNow) > (1000 * 60 * 8 * timespan)){
if(Math.abs(hourTick - timeNow) > (8 * (end_time-start_time)/60)){
xAxisValues.add(new AxisValue(fuzz(hourTick)).setLabel(timeFormat.format(hourTick)));
} else {
//don't print hour label if too close to now to avoid overlaps