Back to Devexpress

ScaleBreak Class

corelibraries-devexpress-dot-xtracharts-1a1ac3b6.md

latest5.3 KB
Original Source

ScaleBreak Class

Represents an individual scale break within the collection.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class ScaleBreak :
    ChartElementNamed,
    IScaleBreak,
    IScaleDiapason
vb
Public Class ScaleBreak
    Inherits ChartElementNamed
    Implements IScaleBreak,
               IScaleDiapason

The following members return ScaleBreak objects:

Remarks

With XtraCharts, you have the capability to replace sections of an axis’ range with scale breaks, created either manually, automatically, or both.

The ScaleBreak class contains settings that define the functionality of scale breaks that are manually created for a chart control’s axis. The created ScaleBreak objects reside within the ScaleBreakCollection class, and can be accessed via the Axis.ScaleBreaks property.

This collection allows you to manipulate its items by adding new or removing existing ScaleBreak objects. A particular ScaleBreak object can be accessed within the collection using either indexer notation, or by its name, using specific methods of the collection (see the ScaleBreakCollection.Item property).

For a scale break to be created, its ScaleBreak.Edge1 and ScaleBreak.Edge2 properties should be defined. These determine the axis values of the range that a scale break should replace.

The options of automatic scale breaks are represented by the AutoScaleBreaks class.

Note

Scale breaks created automatically don’t present in the ScaleBreakCollection.

The common appearance settings of scale breaks (both manual and automatic) are contained in the ScaleBreakOptions class.

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 ChartElement ChartElementNamed ScaleBreak

See Also

ScaleBreak Members

ScaleBreakCollection

ScaleBreakOptions

AutoScaleBreaks

Scale Breaks

DevExpress.XtraCharts Namespace