X axis labels issue with multiple series

TeeChart for ActiveX, COM and ASP
Post Reply
HHYen
Newbie
Newbie
Posts: 10
Joined: Fri Mar 11, 2011 12:00 am

X axis labels issue with multiple series

Post by HHYen » Fri Jan 20, 2012 6:40 am

Hello.

We upgrade tee chart from TeeChart2010.0.0.3ActiveX to TeeChart2011.0.0.4ActiveX.
Please take a look at the following pictures.
The x axis lables are in a mess.

2010.png : TeeChart2010.0.0.3ActiveX
2011.png : TeeChart2011.0.0.4ActiveX

Can you tell me how to fix this ?
Attachments
2011.png
TeeChart2011.0.0.4ActiveX
2011.png (5.01 KiB) Viewed 14664 times
2010.png
TeeChart2010.0.0.3ActiveX
2010.png (4.29 KiB) Viewed 14649 times

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

Re: X axis labels issue with multiple series

Post by Yeray » Mon Jan 23, 2012 8:29 am

Hi HHYen,

Can you please give a try to the recently published v2011.0.0.5?
The problem you found looks the same discussed here
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

HHYen
Newbie
Newbie
Posts: 10
Joined: Fri Mar 11, 2011 12:00 am

Re: X axis labels issue with multiple series

Post by HHYen » Mon Jan 30, 2012 2:27 am

We've tried v2011.0.0.5.
It seems nothing change to me.
The X axis label are still in a mess.
Any idea ???

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

Re: X axis labels issue with multiple series

Post by Yeray » Mon Jan 30, 2012 10:56 am

Hi,

Then I'm afraid I'll have to ask you for a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
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

HHYen
Newbie
Newbie
Posts: 10
Joined: Fri Mar 11, 2011 12:00 am

Re: X axis labels issue with multiple series

Post by HHYen » Tue Jan 31, 2012 2:41 am

Here you are.
Attachments
XaxisProblem.zip
Sample code.
(251.7 KiB) Downloaded 767 times

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

Re: X axis labels issue with multiple series

Post by Yeray » Tue Jan 31, 2012 11:35 am

Hi,

What about forcing the bottom axis to show the values instead of the labels?

Code: Select all

tChart.Axis.Bottom.Labels.Style = EAxisLabelStyle.talValue;
Alternatively, the latest version where this changed in AX was with v2011.04, so with v2010.03 the problem that is affecting you wasn't reproducible (problem #1 mentioned here).
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

HHYen
Newbie
Newbie
Posts: 10
Joined: Fri Mar 11, 2011 12:00 am

Re: X axis labels issue with multiple series

Post by HHYen » Wed Feb 01, 2012 9:11 am

Hello.

Thanks for your help.

Line chart is ok with

Code: Select all

tChart.Axis.Bottom.Labels.Style = EAxisLabelStyle.talValue;
As for point chart. Value is no meaning for us. We would like to show text in X axis label.

2010 version is no problem.
2011 version is not good for me.
spc.png
spc.png (16.26 KiB) Viewed 14557 times
any idea ?
Attachments
XaxisProblem2.zip
(216.18 KiB) Downloaded 740 times

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

Re: X axis labels issue with multiple series

Post by Yeray » Wed Feb 01, 2012 10:27 am

Hi,

With v2011.0.0.4 or v2011.0.0.5, the only solutions I see:
- Only add one series with labels. In your example, if I change the second series loop for this, it seems to work fine:

Code: Select all

            for (int i = 0; i < 50; i++)
                iSeries.AddXY(i + 0.5, 2, /*"second" + i*/ "", 0x0000ff);
- Use custom labels instead of letting talText to draw all the labels of all the series. Adding this at the end of your Main method (just before exporting the chart to png) it seems to work fine:

Code: Select all

            tChart.Environment.InternalRepaint();
            int lastpos = 0;
            tChart.Axis.Bottom.Labels.Clear();
            for (int i = 0; i < tChart.Series(0).Count; i++)
            {
                if ((lastpos == 0) || (tChart.Axis.Bottom.CalcXPosValue(tChart.Series(0).XValues.Value[i]) - lastpos > 10))
                {
                    tChart.Axis.Bottom.Labels.Add(tChart.Series(0).XValues.Value[i], tChart.Series(0).PointLabel[i]);
                    lastpos = tChart.Axis.Bottom.CalcXPosValue(tChart.Series(0).XValues.Value[i]);
                }
            }
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

HHYen
Newbie
Newbie
Posts: 10
Joined: Fri Mar 11, 2011 12:00 am

Re: X axis labels issue with multiple series

Post by HHYen » Thu Feb 02, 2012 3:58 am

Hello,

Thanks for your help.
I have no further questions.

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

Re: X axis labels issue with multiple series

Post by Yeray » Thu Feb 02, 2012 9:46 am

Hi,

You are welcome! :)
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