Page 1 of 1

How Do I Change X-Axis Labels to my own Customized Values?

Posted: Tue Mar 15, 2011 1:31 pm
by 13050364
Hi Support

Ive drawn a line chart and it looks very nice. The x-axis goes from 0 to 20 in steps of 1. However Id like to be able to change each of the x-axis labels.
Im sure this is simple but I cant work out how to do it? Can you explain?

For your information Ive tried

n = 0;
while(n < numberOfPoints)
{
myChart.Axes.Bottom.Labels.Items[n].Text = "my label";
++n;
}

but this doesn't work for n>=0. The collection has zero size.


We are using TeeChart for Net v3 and programming in C#.NET

Re: How Do I Change X-Axis Labels to my own Customized Values?

Posted: Wed Mar 16, 2011 8:23 am
by yeray
Hi Dave,

You have an example about it in the feature demo included with the instalaltion. At "All Features\Welcome !\Axes\Labels\Custom labels".
For example:

Code: Select all

            bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar1.FillSampleValues(7);

            tChart1.Axes.Bottom.Labels.Items.Clear();
            for (int i = 0; i < bar1.Count; i++)
            {
                if (i % 2 == 0)
                    tChart1.Axes.Bottom.Labels.Items.Add(bar1.XValues[i], "bar nÂș" + i.ToString());
            }

Re: How Do I Change X-Axis Labels to my own Customized Values?

Posted: Wed Mar 16, 2011 4:11 pm
by 13050364
Thanks Yeray thats helped.