We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to set display unit along Y axis

Thread ID:

Created:

Updated:

Platform:

Replies:

75083 Jul 11,2008 04:31 AM Jul 14,2008 02:13 AM Windows Forms 2
loading
Tags: Chart
Administrator [Syncfusion]
Asked On July 11, 2008 04:31 AM

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


Manohari [Syncfusion]
Replied On July 12, 2008 07:42 AM

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


Administrator [Syncfusion]
Replied On July 14, 2008 02:13 AM

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




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;