Merge pull request #767 from MilosKozak/AdrianLxM-patch-2

Don't overlap time ticks with current time
This commit is contained in:
AdrianLxM 2018-03-17 14:07:59 +01:00 committed by GitHub
commit 32d2a30bf7
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 // add all full hours within the timeframe
while (hourTick < end_time){ 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))); xAxisValues.add(new AxisValue(fuzz(hourTick)).setLabel(timeFormat.format(hourTick)));
} else { } else {
//don't print hour label if too close to now to avoid overlaps //don't print hour label if too close to now to avoid overlaps