Event when series are added or points change?

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?


1 Reply

MA Manohari Syncfusion Team 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


Loader.
Up arrow icon