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 08:56 PM UTC

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.
Up arrow icon