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

Event when series are added or points change?

Thread ID:

Created:

Updated:

Platform:

Replies:

76572 Sep 14,2008 08:03 PM UTC Sep 16,2008 09:36 AM UTC WinForms 1
loading
Tags: Chart
Mike Finch
Asked On September 14, 2008 08:03 PM UTC

I tweak the Format and RoundingPlaces properties of the ChartAxis objects whenever the chart zooms, by listening to the VisibleRangeChanging event. However, I would also like to do that tweaking at other times when the axes range changes, such as when a new series is added to ChartControl, or points in a series change to cause the chart to adjust itself to show all the points. Is there an event that is raised when this happens?


Manohari [Syncfusion]
Replied On September 16, 2008 09:36 AM UTC

Hi Mike,

Thanks for your interest in Syncfusion products.

It is possible to format the Axis label using the FormatLabel event which is fired when everthere is a change in the ChartAxis labels. This event will be fired even whenever there is a change in the axis labels values ( ie when the AxesRange changes etc that causes the labels to be redrawn). Please refer to the sample code snippet below.

Sample Code:

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

void PrimaryYAxis_FormatLabel(object sender, ChartFormatAxisLabelEventArgs e)
{
e.Label = String.Format("{0:f3} mil", e.Value);
e.Handled = true;
}

void PrimaryXAxis_FormatLabel(object sender, ChartFormatAxisLabelEventArgs e)
{
e.Label = String.Format("{0:f2} unit", e.Value);
e.Handled = true;
}

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

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

Kindly let us know if this meets 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.

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

;