Back to Devexpress

ScaleBreakCollection Class

corelibraries-devexpress-dot-xtracharts-4ef584ef.md

latest4.7 KB
Original Source

ScaleBreakCollection Class

Represents a collection that stores the manually created scale breaks of a particular axis.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class ScaleBreakCollection :
    ChartElementNamedCollection,
    IEnumerable<IScaleBreak>,
    IEnumerable
vb
Public Class ScaleBreakCollection
    Inherits ChartElementNamedCollection
    Implements IEnumerable(Of IScaleBreak),
               IEnumerable

The following members return ScaleBreakCollection objects:

Remarks

Each axis (in particular, an axis of the AxisX or AxisY type) can hold a collection of scale breaks which can be accessed via the Axis.ScaleBreaks property, and is represented by the ScaleBreakCollection class. The properties and methods exposed by the ScaleBreakCollection class can be used to perform common collection operations such as adding new or deleting existing items. Each collection item is represented by a ScaleBreak object. Individual scale breaks can be accessed either using indexer notation or by their names, using specific methods of the collection.

At design time, you can use the Scale Break Collection Editor , to manage the collection of scale breaks.

Note that the ScaleBreakCollection class represents the collection of the manually created scale breaks only, meaning that automatic scale breaks (although they can accompany the manual scale breaks along the same axis) do not present in this collection.

For more information, refer to Scale Breaks.

Example

This example demonstrates how scale breaks can be created within an axis, and customized at runtime.

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

// Add scale breaks to the Y-axis collection, 
// with their Edge1 and Edge2 properties defined in the constructor.
diagram.AxisY.ScaleBreaks.Add(new ScaleBreak("Scale Break 1", 10, 100));
diagram.AxisY.ScaleBreaks.Add(new ScaleBreak("Scale Break 2", 110, 2000));

// Define the scale breaks' options.
diagram.AxisY.ScaleBreakOptions.Style = ScaleBreakStyle.Ragged;
diagram.AxisY.ScaleBreakOptions.SizeInPixels = 20;
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)

' Add scale breaks to the Y-axis collection, 
' with their Edge1 and Edge2 properties defined in the constructor.
diagram.AxisY.ScaleBreaks.Add(New ScaleBreak("Scale Break 1", 10, 100))
diagram.AxisY.ScaleBreaks.Add(New ScaleBreak("Scale Break 2", 110, 2000))

' Define the scale breaks' options.
diagram.AxisY.ScaleBreakOptions.Style = ScaleBreakStyle.Ragged
diagram.AxisY.ScaleBreakOptions.SizeInPixels = 20
diagram.AxisY.ScaleBreakOptions.Color = Color.Turquoise

Inheritance

Object CollectionBase ChartCollectionBase ChartElementNamedCollection ScaleBreakCollection

See Also

ScaleBreakCollection Members

Scale Breaks

DevExpress.XtraCharts Namespace