windowsforms-6261-controls-and-libraries-chart-control-examples-chart-elements-how-to-manually-insert-a-scale-break-into-an-axis.md
This tutorial demonstrates how an axis range can be manually split by scale breaks at design time. For the runtime example, refer to How to: Manually Insert a Scale Break into an Axis (Runtime Sample). For a general information, refer to Scale Breaks. To learn about an alternative approach - automatic scale breaks creation, refer to How to: Enable Automatic Scale Breaks for an Axis.
This tutorial consists of the following sections.
Start Microsoft Visual Studio, and create a new Windows Forms Application , or open an existing one.
Drop the ChartControl onto the form. Note that in this instance, the Chart Wizard may be invoked (if its “Show wizard every time a new chart is added” option is enabled). In this example, we don’t need to use the wizard, so click Cancel to close the wizard’s window and manually customize the ChartControl.
To add a new series to the chart, select the ChartControl, open its smart tag and choose the Series… item in the tasks list. Then, the Series Collection Editor will be invoked.
This dialog allows you to add new series to a chart, and maintain their properties. Click Add… and select Bar from the list of view types.
To populate the created series with data points in this example, we’ll use the following arguments and values for the series. These values have a significant spread, and simultaneously represent decimals, hundreds, and thousands.
Now, the chart has the following look.
To do this, select the Y-axis, and in the Properties window, locate the Axis.ScaleBreaks property, and click its ellipsis button, to invoke the Scale Break Collection Editor.
Our goal is achieved - the scale breaks are added to the axis. The result is shown in the following image.
Now, if required, you can customize the appearance of scale breaks, via the Axis.ScaleBreakOptions property. It provides access to the following appearance settings (note that these settings affect all scale breaks at one time, and don’t allow you to individually access a scale break entry).
These options are described below:
See Also
How to: Manually Insert a Scale Break into an Axis (Runtime Sample)