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 label formatting

I am using a chart control with a PrimaryYAxis of ValueType double. When the labels are drawn, I would like to display a dollar sign in front. I can''t seem to get this to work right through the Format property of the axis. Any ideas as to how to accomplish this? Thanks a lot.

1 Reply

DJ Davis Jebaraj Syncfusion Team August 6, 2004 04:56 PM

Hi Jarrod, The ChartFormatAxisLabel event of the ChartControl can be handled to provide custom labels for any of the Axes. http://www.syncfusion.com/Support/article.aspx?id=10455 // Add the handler this.chartControl1.ChartFormatAxisLabel += new ChartFormatAxisLabelEventHandler(this.chartControl1_ChartFormatAxisLabelEventHandler); // The event handler private void chartControl1_ChartFormatAxisLabelEventHandler(object sender,ChartFormatAxisLabelEventArgs args ) { if(args.IsAxisPrimary && args.AxisOrientation == Orientation.Vertical) { if(args.Value >= 0 && args.Value < 10) args.Label = "Task " + (args.Value+1).ToString(); else args.Label = ""; args.Handled = true; } Regards, Davis

Loader.
Live Chat Icon For mobile
Up arrow icon