Page 1 of 1

problem with getting labels from ax

Posted: Wed Apr 09, 2008 7:46 am
by 9535497
Hi, My problem is that I can't get labels from bottom ax.
I am programing in ASP.NET using C# language.
Here is code that i have problem with

private TeeChart.TChartClass tChart2 = new TeeChart.TChartClass();

protected void Page_Load(object sender, EventArgs e)
{
tChart2.AddSeries(TeeChart.ESeriesClass.scBar);
tChart2.Series(0).Add(10, "first", 0);
tChart2.Series(0).Add(30, "second", 0);
tChart2.Series(0).Add(20, "third", 0);

//next column causes problem
Label1.Text = tChart2.Axis.Bottom.Labels.get_Item(1).Text
tChart2.Export.asNative.SaveToFile("D:\\Data\\graf.txt", true);
}

Could anyone help me, pls.

Posted: Wed Apr 09, 2008 8:51 am
by narcis
Hi zizou5,

This only works if you are using custom labels. You can find a custom labels example at All Features\Welcome !\Axes\Labels\Custom labels in the features demo, available at TeeChart's program group.

If you don't use custom labels you could use GetAxisLabel event, for example:

Code: Select all

		void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
		{
			if ((sender == tChart1.Axes.Bottom) && (e.ValueIndex==1))
			{
				this.Text = e.LabelText;
			}
		}

Posted: Sun Apr 20, 2008 11:12 am
by 9535497
Thanks Narcis.
I resolved my problem by another way.