Label size problem for big numbers?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
glikoz
Newbie
Newbie
Posts: 50
Joined: Fri Oct 07, 2005 4:00 am

Label size problem for big numbers?

Post by glikoz » Wed Dec 14, 2005 4:26 pm

I want a chart has fixed label size for left-right axes..
But when i set to label size big numbers couldnt seen ..
If value of axis bigger than 99999 (for example 200000) i want to show it as 200
(by divide all values to 1000) ..
So i have to add Legend at bottom of the axis...
What is the best way to do this...

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

Post by Narcís » Thu Dec 15, 2005 9:04 am

Hi glikoz,

You could implement it in the GetAxisLabel event, doing something like:

Code: Select all

		private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
		{
			if (((sender==tChart1.Axes.Left) || (sender==tChart1.Axes.Right))&& (e.LabelText.Length>6))
			{
				e.LabelText=e.LabelText.Remove(3,e.LabelText.Length-3);
			}
		}
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

glikoz
Newbie
Newbie
Posts: 50
Joined: Fri Oct 07, 2005 4:00 am

It doesnt work..

Post by glikoz » Thu Dec 15, 2005 9:39 am

It doesnt work ..Because Left Axis has labels like that (0,20000,50000,150000,300000) ..
I have to show this values as (0,20,50,150,300)
With your advice this values seem as (0,20000,50000,150,300)..

glikoz
Newbie
Newbie
Posts: 50
Joined: Fri Oct 07, 2005 4:00 am

Could I do that over ValueFormat property

Post by glikoz » Thu Dec 15, 2005 9:40 am

is valueFormat property has "divide 1000" ability?

glikoz
Newbie
Newbie
Posts: 50
Joined: Fri Oct 07, 2005 4:00 am

From your advice?

Post by glikoz » Thu Dec 15, 2005 9:53 am

I think i have to detect is Axis(Left or Right) Maximum Value bigger than 99999 ..Then i will format Axis's values ..

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

Post by Narcís » Thu Dec 15, 2005 12:07 pm

Hi glikoz,

Then you could do something like:

Code: Select all

		private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
		{
			if (((sender==tChart1.Axes.Left) || (sender==tChart1.Axes.Right)) && (line1.MaxYValue()>99999))
			{
				e.LabelText=e.LabelText.Remove(3,e.LabelText.Length-3);				
			}
		}
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

Post Reply