Back to Devexpress

AutoScaleBreaks.MaxCount Property

corelibraries-devexpress-dot-xtracharts-dot-autoscalebreaks-b922fa3b.md

latest3.4 KB
Original Source

AutoScaleBreaks.MaxCount Property

Gets or sets the maximum number of automatic scale breaks.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public int MaxCount { get; set; }
vb
Public Property MaxCount As Integer

Property Value

TypeDescription
Int32

An integer value, which specifies the maximum number of automatic scale breaks.

|

Remarks

Use the MaxCount property to define the maximum number of automatic scale breaks allowed, when the AutoScaleBreaks.Enabled property is set to true.

Note

Both automatic and manual scale breaks can co-exist along the same axis. The scale breaks calculation is performed in such a way so that if their ranges interfere, scale breaks are merged.

To access the collection of manual scale breaks, use the Axis.ScaleBreaks property.

For more information, refer to Scale Breaks.

Example

Use the following code, to enable automatic scale breaks at runtime.

csharp
// Cast your diagram object to an appropriate diagram type,
// to access its axes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;

// Enable automatic scale breaks creation, 
// and define their maximum number.
diagram.AxisY.AutoScaleBreaks.Enabled = true;
diagram.AxisY.AutoScaleBreaks.MaxCount = 5;

// Define the scale breaks' options, which are common
// for both manual and automatic scale breaks.
diagram.AxisY.ScaleBreakOptions.Style = ScaleBreakStyle.Waved;
diagram.AxisY.ScaleBreakOptions.SizeInPixels = 30;
diagram.AxisY.ScaleBreakOptions.Color = Color.Turquoise;
vb
' Cast your diagram object to an appropriate diagram type,
' to access its axes.
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)

' Enable automatic scale breaks creation, 
' and define their maximum number.
diagram.AxisY.AutoScaleBreaks.Enabled = True
diagram.AxisY.AutoScaleBreaks.MaxCount = 5

' Define the scale breaks' options, which are common
' for both manual and automatic scale breaks.
diagram.AxisY.ScaleBreakOptions.Style = ScaleBreakStyle.Waved
diagram.AxisY.ScaleBreakOptions.SizeInPixels = 30
diagram.AxisY.ScaleBreakOptions.Color = Color.Turquoise

See Also

How to: Enable Automatic Scale Breaks for an Axis

AutoScaleBreaks Class

AutoScaleBreaks Members

DevExpress.XtraCharts Namespace