Back to Devexpress

AutoScaleBreaks.Enabled Property

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

latest6.1 KB
Original Source

AutoScaleBreaks.Enabled Property

Gets or sets a value indicating whether automatic scale breaks are enabled.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public bool Enabled { get; set; }
vb
Public Property Enabled As Boolean

Property Value

TypeDescription
Boolean

true if automatic scale breaks are enabled; otherwise, false.

|

Remarks

When the Enabled property is set to true , you can define the maximum number of automatic scale breaks via the AutoScaleBreaks.MaxCount property.

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

The following code snippets (auto-collected from DevExpress Examples) contain references to the Enabled property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-custom-properties/CS/WinForms-Dashboard-Custom-Properties/Modules/ChartScaleBreakModule.cs#L76

csharp
bool scaleBreakEnabled = Convert.ToBoolean(dashboardItem.CustomProperties.GetValue(PropertyName));
    diagram.SecondaryAxesY[0].AutoScaleBreaks.Enabled = scaleBreakEnabled;
}

wpf-dashboard-custom-properties/CS/Wpf-Dashboard-Custom-Properties/Modules/ChartItemModule/ChartOptions/ScaleBreak.cs#L32

csharp
bool scaleBreakEnabled = Convert.ToBoolean(chartItem.CustomProperties[ChartItemModule.ScaleBreakPropertyName]);
    ((DevExpress.XtraCharts.XYDiagram)xrChart.Diagram).SecondaryAxesY[0].AutoScaleBreaks.Enabled = scaleBreakEnabled;
}

winforms-dashboard-custom-properties/VB/WinForms-Dashboard-Custom-Properties/Modules/ChartScaleBreakModule.vb#L80

vb
Dim scaleBreakEnabled As Boolean = Convert.ToBoolean(dashboardItem.CustomProperties.GetValue(PropertyName))
    diagram.SecondaryAxesY(0).AutoScaleBreaks.Enabled = scaleBreakEnabled
End If

wpf-dashboard-custom-properties/VB/Wpf-Dashboard-Custom-Properties/Modules/ChartItemModule/ChartOptions/ScaleBreak.vb#L36

vb
Dim scaleBreakEnabled As Boolean = Convert.ToBoolean(chartItem.CustomProperties(ChartItemModule.ScaleBreakPropertyName))
    CType(xrChart.Diagram, DevExpress.XtraCharts.XYDiagram).SecondaryAxesY(0).AutoScaleBreaks.Enabled = scaleBreakEnabled
End If

See Also

How to: Enable Automatic Scale Breaks for an Axis

AutoScaleBreaks Class

AutoScaleBreaks Members

DevExpress.XtraCharts Namespace