Q. When my chart image is displayed, not all of
my X axis labels are drawn on the chart.
A. This problem is caused by the automatic
interval feature. When there are many data labels on an axis Dundas Chart will start skipping labels by default in order to produce a cleaner image.
You can force the Dundas Chart to show all labels on an axis by setting the [Axis].Interval property to 1, where [Axis] is AxisX, AxisY, AxisY2 or AxisX2.
- In Dundas Chart for .NET, right-click the Chart and choose Properties. Select and open the ChartAreas collection and the Axes collection, select the axis on the left, and set Interval.
- In Dundas Chart for Reporting Services, right-click the Chart and choose Properties. In the Advanced tab, select the axis from the drop-down menu or the preview image, then set Interval.
- In Dundas Chart for SharePoint, go to Customize Your Chart wizard. In Step 3, go to the Axes and Grid Lines tab, and set the Interval property here.
Here is a code example:
[C#]: chart1.ChartAreas["Default"].AxisX.Interval = 1;
[VB.NET]: chart1.ChartAreas("Default").AxisX.Interval = 1
You can also set interval individually for the labels, grid lines and/or tick marks if you choose by setting the LabelStyle, MajorGrid or MajorTickMark Interval properties.
[C#]: chart1.ChartAreas["Default"].AxisX.LabelStyle.Interval = 1;
[VB.NET]: chart1.ChartAreas("Default").AxisX.LabelStyle.Interval = 1
Chart also allows you to set the maximum and minimum of the axis through the [Axis].Maximum and [Axis].Minimum property. Setting this property will allow you to control the range of values present in the axis and the view.