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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Charts w/ bytes

Thread ID:





76349 Sep 2,2008 08:18 PM UTC Sep 14,2008 12:43 PM UTC WinForms 1
Tags: Chart
Administrator [Syncfusion]
Asked On September 2, 2008 08:18 PM UTC


I am making a chart that plots number of Bytes vs time. Is there any way that I can make chart handle this properly.

I.E. if the data is over 1024 Bytes use KB, if it is over 1024 KB use MB, ...

I am in a scenario where some cases, only bytes will be used, where other cases, GB will be used.


Manohari [Syncfusion]
Replied On September 14, 2008 12:43 PM UTC

Hi Michael,

We regret very much for the delayed response. If your intention is the change the Axis labels to display the correct unit depending on the Y Values, It is possible by customizing the Y axis Labels using the formatLabel event. Kindly refer to the sample code below.

Sample code:

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

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

if (index > (1024 * 1024))
e.Label = string.Format("{0:n2} Mb",(index / (1024 * 1024)));
} else if (index > 1024)
e.Label = string.Format("{0:n2} Kb", (index / 1024));
e.Label = index + " b";

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


Kindly let us know if this meets your requirement. I hope I have not misunderstood your requirement. If I have, could you please provide more information on your requirement? Thanks for your patience.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon