Zooming may ignore x-axis labels

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
Jared Cooper
Newbie
Newbie
Posts: 2
Joined: Mon Dec 02, 2013 12:00 am

Zooming may ignore x-axis labels

Post by Jared Cooper » Thu May 08, 2014 12:38 pm

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?

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Zooming may ignore x-axis labels

Post by Yeray » Fri May 09, 2014 10:42 am

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;
  }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply