Bar Char X-Axis Problem.

Hi

I searched alot on this forum to get a similar post, but can't find.

Please see attached image. It tells, in what format I have data. and what Graph I need.

Basically, I need to show column names "0-30","31-60","61-90" etc at X-Axis, values of these columns will be mapped with Y-axis.

I saw samples, and checked series.Points.Add(15, 225) require Integer to be passed and no string.

Please advise in this regard.

Regards,
Azam.



graphrequired.zip

1 Reply

J. J.Nagarajan Syncfusion Team May 2, 2008 05:45 PM UTC

Hi Azam ,

You can customize the X Axis labels by setting TickLabelsDrawingMode to UserMode , clear the existing labels and add new custom labels as follows.

[C#] this.ChartWebControl1.PrimaryXAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.UserMode;
this.ChartWebControl1.PrimaryXAxis.Labels.Clear();
this.ChartWebControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("0-30", Color.Black, new Font("Caliber", 8), 1, "", ChartValueType.Custom));
this.ChartWebControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("31-60", Color.Black, new Font("Caliber", 8), 2, "", ChartValueType.Custom));
this.ChartWebControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("61-90", Color.Black, new Font("Caliber", 8), 3, "", ChartValueType.Custom));

Please use this code and let me know if this helps.

Thanks,
Nagaraj


Loader.
Up arrow icon