Page 1 of 1

datetime X Axis labels are overlaps.

Posted: Wed Jun 07, 2017 2:01 pm
by 17778358
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

Re: datetime X Axis labels are overlaps.

Posted: Thu Jun 08, 2017 9:46 am
by yeray
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.

Re: datetime X Axis labels are overlaps.

Posted: Thu Jun 08, 2017 11:00 am
by 17778358
Hi,

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

Thanks
Amos