Page 1 of 1
Overlapping labels after setMinMax() function at teechart ja
Posted: Mon Sep 30, 2013 8:39 am
by 17465709
I've created a chart with custom axes and a simple line that uses a vertical and a horizontal axis out of them. Next I zoomed in by calling the setAutomatic(false) and setMinMax(min, max) method provided by the Axis class. TeeChart zoomed in, but it behaves different in comparison to a normal zoom-in. It does not rescale the axis labels - why? How to rescale axis labels so that they do not overlap?
After debugging I found out, that after a normal zoom-in the method invalidate() is called next. So I also tried to call doInvalidate() on my teechart instance, but that didn't help. setMinorTickCount(arg0) and adjustMinMax() changed also nothing.
Any idea how to re-scale labels?
Thx for help
Re: Overlapping labels after setMinMax() function at teechart ja
Posted: Mon Sep 30, 2013 12:32 pm
by 17465709
Here is how you can reproduce it:
Code: Select all
TChart chart = new TChart(parent, 0);
Line series = new Line(chart.getChart());
series.fillSampleValues(100);
chart.getAxes().getBottom().setAutomatic(false);
chart.getAxes().getBottom().setMinMax(0.0, 10.0);
chart.getAxes().getBottom().setMinMax(2.0, 5.0);
I need something like I get, when I scroll after this operations. After a scroll the labels re-scale properly.
Thx
Re: Overlapping labels after setMinMax() function at teechart ja
Posted: Wed Oct 02, 2013 10:53 am
by yeray
Hi,
First of all note the
setMinMax() function already sets
automatic to false, so you don't need to call
setAutomatic(false) before calling
setMinMax().
Also, calling
setMinMax() function twice, only the last call makes sense, and I don't see any different behaviour adding or removing the first one.
I've seen your code seems to produce a chart with overlapping labels int he bottom axis. That's strange because if I scroll the chart a bit, or I set a slightly different minimum and maximum, the overlap doesn't appear:
Code: Select all
tChart1.getAxes().getBottom().setMinMax(2.01, 5.01);
I've added it to the wish list to be revised for next releases (TJ71016731).
Re: Overlapping labels after setMinMax() function at teechart ja
Posted: Thu Oct 03, 2013 8:46 am
by yeray
Hi,
As a workaround, you could manually set an
Increment as follows:
Code: Select all
tChart1.getAxes().getBottom().setIncrement(0.5);
Re: Overlapping labels after setMinMax() function at teechart ja
Posted: Mon Oct 14, 2013 11:23 am
by 17465709
Thx, this solved my problem so far.
![Very Happy :D](./images/smilies/icon_biggrin.gif)