Page 1 of 1

Label size problem for big numbers?

Posted: Wed Dec 14, 2005 4:26 pm
by 9638762
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...

Posted: Thu Dec 15, 2005 9:04 am
by narcis
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);
			}
		}

It doesnt work..

Posted: Thu Dec 15, 2005 9:39 am
by 9638762
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)..

Could I do that over ValueFormat property

Posted: Thu Dec 15, 2005 9:40 am
by 9638762
is valueFormat property has "divide 1000" ability?

From your advice?

Posted: Thu Dec 15, 2005 9:53 am
by 9638762
I think i have to detect is Axis(Left or Right) Maximum Value bigger than 99999 ..Then i will format Axis's values ..

Posted: Thu Dec 15, 2005 12:07 pm
by narcis
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);				
			}
		}