Fixed axis time tick calculation on on graph. Fixes NX-1111
authorzev <zev@radensolutions.com>
Tue, 7 Feb 2017 09:46:26 +0000 (04:46 -0500)
committerzev <zev@radensolutions.com>
Tue, 7 Feb 2017 09:46:34 +0000 (04:46 -0500)
src/java/netxms-eclipse/swtchart/src/org/swtchart/internal/axis/AxisTickLabels.java

index 8271c3f..8a3fdf4 100644 (file)
@@ -14,6 +14,7 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.TimeZone;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
@@ -574,7 +575,7 @@ public class AxisTickLabels implements PaintListener
         */
        private long getPeriodInMillis(int unit, int amount)
        {
-               Calendar cal = Calendar.getInstance();
+               Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
                cal.setTimeInMillis(0);
                cal.roll(unit, amount);
                return cal.getTimeInMillis();