Overlapping labels after setMinMax() function at teechart ja

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Slix
Newbie
Newbie
Posts: 3
Joined: Wed Apr 24, 2013 12:00 am

Overlapping labels after setMinMax() function at teechart ja

Post by Slix » Mon Sep 30, 2013 8:39 am

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

Slix
Newbie
Newbie
Posts: 3
Joined: Wed Apr 24, 2013 12:00 am

Re: Overlapping labels after setMinMax() function at teechart ja

Post by Slix » Mon Sep 30, 2013 12:32 pm

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

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

Re: Overlapping labels after setMinMax() function at teechart ja

Post by Yeray » Wed Oct 02, 2013 10:53 am

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).
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

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

Re: Overlapping labels after setMinMax() function at teechart ja

Post by Yeray » Thu Oct 03, 2013 8:46 am

Hi,

As a workaround, you could manually set an Increment as follows:

Code: Select all

tChart1.getAxes().getBottom().setIncrement(0.5);
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

Slix
Newbie
Newbie
Posts: 3
Joined: Wed Apr 24, 2013 12:00 am

Re: Overlapping labels after setMinMax() function at teechart ja

Post by Slix » Mon Oct 14, 2013 11:23 am

Thx, this solved my problem so far. :D

Post Reply