problem with getting labels from ax

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
zizou5
Newbie
Newbie
Posts: 17
Joined: Mon Jun 11, 2007 12:00 am
Contact:

problem with getting labels from ax

Post by zizou5 » Wed Apr 09, 2008 7:46 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 09, 2008 8:51 am

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;
			}
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

zizou5
Newbie
Newbie
Posts: 17
Joined: Mon Jun 11, 2007 12:00 am
Contact:

Post by zizou5 » Sun Apr 20, 2008 11:12 am

Thanks Narcis.
I resolved my problem by another way.

Post Reply