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. Image for the cookie policy date

Axis Range Labels

I have used the following code to generate an x-axis range - chart.PrimaryXAxis.RangeType = ChartAxisRangeType.Set; chart.PrimaryXAxis.Range = new Range(Min, Max, IntervalSize); The resulting chart has x-axis labels marked by the interval count eg. 1, 2, 3 etc. I would like the labels to be the (IntervalCount x IntervalSize), eg.10, 20, 30 (given IntervalSize = 10). Is this possible ?

1 Reply

DJ Davis Jebaraj Syncfusion Team April 1, 2004 08:20 PM UTC

Hi, The ChartFormatAxisLabel event of the ChartControl can be handled to provide custom labels for any of the Axes. this.chartControl1.ChartFormatAxisLabel += new ChartFormatAxisLabelEventHandler(this.chartControl1_ChartFormatAxisLabelEventHandler); private void chartControl1_ChartFormatAxisLabelEventHandler(object sender,ChartFormatAxisLabelEventArgs args ) { if(args.IsAxisPrimary && args.AxisOrientation == Orientation.Horizontal) { args.Label = (args.Value*10).ToString(); args.Handled = true; } } Please see the sample linked to below: http://www.syncfusion.com/support/user/uploads/chartlabelscustom.zip Regards, Davis

Loader.
Up arrow icon