How to set display unit along Y axis

How can i set display unit along Y axis i.e i want to set display unit as hundreds,millions etc.

e.g labels along Y axis are 10,20,30 etc.If i want these labels display unit as hundreds then labels should be like .1,.2,.3 etc.

Thanks
uttreja


2 Replies

MA Manohari Syncfusion Team July 12, 2008 11:42 AM UTC

Hi Uttreja,

Thanks for your interest in Syncfusion products.

It is possible to customize the Y axis labels to display values in the specified units by using the FormatLabel event of the Axis as given below.

Sample code:

this.chartControl1.PrimaryYAxis.FormatLabel += new ChartFormatAxisLabelEventHandler(PrimaryYAxis_FormatLabel);

void PrimaryYAxis_FormatLabel(object sender, ChartFormatAxisLabelEventArgs e)
{
double index = (int)e.Value;

if (this.radioHundred.Checked)
{
e.Label = (index/100).ToString();
}
...
...
e.Handled = true;
}

I have attached the sample that illustrates the same in this link below.

http://websamples.syncfusion.com/samples/Chart.Windows/I75083/main.htm

Kindly let us know if this meets your requirements. Thanks for your patience.

Regards,
Manohari.R



AD Administrator Syncfusion Team July 14, 2008 06:13 AM UTC

This is working fine.Thanks a lot.

>Hi Uttreja,

Thanks for your interest in Syncfusion products.

It is possible to customize the Y axis labels to display values in the specified units by using the FormatLabel event of the Axis as given below.

Sample code:

this.chartControl1.PrimaryYAxis.FormatLabel += new ChartFormatAxisLabelEventHandler(PrimaryYAxis_FormatLabel);

void PrimaryYAxis_FormatLabel(object sender, ChartFormatAxisLabelEventArgs e)
{
double index = (int)e.Value;

if (this.radioHundred.Checked)
{
e.Label = (index/100).ToString();
}
...
...
e.Handled = true;
}

I have attached the sample that illustrates the same in this link below.

http://websamples.syncfusion.com/samples/Chart.Windows/I75083/main.htm

Kindly let us know if this meets your requirements. Thanks for your patience.

Regards,
Manohari.R




Loader.
Up arrow icon