Page 1 of 1

Zooming may ignore x-axis labels

Posted: Thu May 08, 2014 12:38 pm
by 16667944
I have a very simple JS chart, including:

Series0.data.x=[1,2,3,4,5,6,7,8,9,10,11];
Series0.data.values=[1,2,3,2,4,3,2,5,2,2,0];
Series0.data.labels=["01/01/2000","02/01/2000","03/01/200","04/01/2000","05/01/2000","06/01/2000","07/01/2000","08/01/2000","09/01/2000","10/01/2000","11/01/2000"];

When zooming with the mouse, once you zoom in far enough (not far in this simple example) the x-axis starts showing 1.2, 3.4, etc - it's ignoring the labels and showing a partial value between the x values.

This is also true if the Series0.data.x... line is removed, so only values and labels are included.

Is there any way to prevent this?

Re: Zooming may ignore x-axis labels

Posted: Fri May 09, 2014 10:42 am
by yeray
Hello,

You could play with the zoom events and the increment. Ie:

Code: Select all

  Chart1.onzoom=function() {
    Chart1.axes.bottom.increment=(Chart1.axes.bottom.increm<=1)? 1:0;
  }
  
  Chart1.zoom.onreset=function() {	
	Chart1.axes.bottom.increment=0;
  }