datetime X Axis labels are overlaps.

TeeChart for Javascript for the HTML5 Canvas
Post Reply
samos
Newbie
Newbie
Posts: 7
Joined: Thu May 26, 2016 12:00 am
Contact:

datetime X Axis labels are overlaps.

Post by samos » Wed Jun 07, 2017 2:01 pm

Hi,
There is a problem with the drawing of a datetime X Axis when the first visible series has labels.
The calculation for the steps to draw the X Axis labels is based on the series label instead of the X Axes.

To recreate the problem,
I modify the datetime.htm from TeeChart_for_JavaScript_Commercial_v2017.04.26.1.9\demos\sources
And add a simple line
series.data.labels[t] = 'a';
In the code:

Code: Select all

for (var t=0; t<100; t++) {
    series.data.values[t]=Math.random()*1000;
    series.data.x[t]=new Date(today + t * msecsInADay);
    series.data.labels[t] = 'a';  // this is the added line
  }
the calculation of the labels size now will base on the label value, in this case 'a' and will be too small to display the date.
Please provide a fix or workaround for this.
Thanks

Amos

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

Re: datetime X Axis labels are overlaps.

Post by Yeray » Thu Jun 08, 2017 9:46 am

Hello,

I think the bug is that the labels should be drawn in the bottom axis when the series has labels and the bottom axis labelStyle is set to "auto" (as per default), or "text" or "mark"; but it always uses the datetime values to draw the bottom axis labels.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1878

On the other hand, if you want the bottom axis to use the datetime values to draw the labels, you should force it setting labelStyle to "value". And doing it doesn't appear the overlapping problem.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Image Please read our Bug Fixing Policy

samos
Newbie
Newbie
Posts: 7
Joined: Thu May 26, 2016 12:00 am
Contact:

Re: datetime X Axis labels are overlaps.

Post by samos » Thu Jun 08, 2017 11:00 am

Hi,

adding something like
myChart.axes.bottom.labels.labelStyle = "value";
seams to fix the problem.

Thanks
Amos

Post Reply