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.

Charts w/ bytes

Thread ID:

Created:

Updated:

Platform:

Replies:

76349 Sep 2,2008 04:18 PM Sep 14,2008 08:43 AM Windows Forms 1
loading
Tags: Chart
Administrator [Syncfusion]
Asked On September 2, 2008 04:18 PM

Hello,

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.

Thanks


Manohari [Syncfusion]
Replied On September 14, 2008 08:43 AM

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));
}
else
{
e.Label = index + " b";
}

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

http://websamples.syncfusion.com/samples/Chart.Windows/F76349/Sample1.htm

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.

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.

;