This article is obsolete. The Chart item is now superseded by the more advanced Graph item. The Graph item is most often used for building powerful OLAP/Pivot charts.
X and Y axes are included in all chart types but the Pie chart. Typically the YAxis displays values and the XAxis displays categories. For example, the YAxis might show "items sold" or "revenue", while the XAxis might show "Months" or "Products". The X axis can also display values. A second "Y" axis property YAxis2 is provided for displaying a second scale of measurements.
Each axis has:
- Grid lines display perpendicular to the axis covering the plot area.
- Axis line
- Axis label
- Axis marks along the axis line
- Item labels below the axis line
The example below shows a sample X-axis with several appearance related properties customized.
The Chart PlotAreaproperty has sub properties XAxis , YAxis and YAxis2 . Each axis object has an Appearance property used to make the customizations shown above. Some significant axis appearance related properties are:
- The property includes sub properties that control the axis label , , , , , and .
- controls the appearance of grid lines displaying over the plot area including , , and .
- handles the axis item label text, most notably controls font properties and color.
Axis properties can be set from the Properties Window of Visual Studio, in the XML configuration file, or through the API. Properties for the X and Y axis are identical except where noted.
You can modify the overall appearance of an axes by changing theand properties. These properties when set to true cause the axis to expand and shrink to accommodate dynamically added and removed items. This is useful when the number of items changes on-the-fly.
Turnoff if you want complete control over labeling of an axis.
To display a range of values along an axis, specify for thea starting , an ending , and a Step . In the example above, the YAxis has a of "0", a of "250" and a of "50". The X axis is labeled explicitly by setting properties:
- = False
- = 3
- = 1
- = 1
- = True
- is populated with with 3 objects where the Appearance.Text property contains "Non-Smokers", "Social Smokers" and "Heavy Smokers".
You can control the size and position of the labels using the axis, and properties.
: This is the name of a data source column that will supply the text that displays next to each X Axis item.
: AxisMode can be Normal (the default) or Extended. Extended mode provides buffer space above the largest value for best visual formatting.
: The ScaleBreaks feature allows you to "break off" large chunks of the axis so that graphs with large amplitude are easier to read. ScaleBreaks are available for both YAxis and YAxis2 of the plot area. By default is false so scale breaks do not display. Set the maximum number of breaks using to set the minimum interval between data points before a break will occur. For the lines controls the shape of the line (i.e. Sinusoid, Straight, JaggedCurve and Curve).