Page 1 of 1

X axis labels issue with multiple series

Posted: Fri Jan 20, 2012 6:40 am
by 16658740
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 ?

Re: X axis labels issue with multiple series

Posted: Mon Jan 23, 2012 8:29 am
by yeray
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

Re: X axis labels issue with multiple series

Posted: Mon Jan 30, 2012 2:27 am
by 16658740
We've tried v2011.0.0.5.
It seems nothing change to me.
The X axis label are still in a mess.
Any idea ???

Re: X axis labels issue with multiple series

Posted: Mon Jan 30, 2012 10:56 am
by yeray
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.

Re: X axis labels issue with multiple series

Posted: Tue Jan 31, 2012 2:41 am
by 16658740
Here you are.

Re: X axis labels issue with multiple series

Posted: Tue Jan 31, 2012 11:35 am
by yeray
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).

Re: X axis labels issue with multiple series

Posted: Wed Feb 01, 2012 9:11 am
by 16658740
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 14644 times
any idea ?

Re: X axis labels issue with multiple series

Posted: Wed Feb 01, 2012 10:27 am
by yeray
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]);
                }
            }

Re: X axis labels issue with multiple series

Posted: Thu Feb 02, 2012 3:58 am
by 16658740
Hello,

Thanks for your help.
I have no further questions.

Re: X axis labels issue with multiple series

Posted: Thu Feb 02, 2012 9:46 am
by yeray
Hi,

You are welcome! :)