Back to Devexpress

ScaleBreakOptions.SizeInPixels Property

corelibraries-devexpress-dot-xtracharts-dot-scalebreakoptions-489534d2.md

latest4.1 KB
Original Source

ScaleBreakOptions.SizeInPixels Property

Gets or sets the size of scale breaks.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

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

Property Value

TypeDescription
Int32

An integer, representing the distance between the edges of scale breaks, in pixels. It should be greater than or equal to -1 and less than 50.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to SizeInPixels
Axis

.ScaleBreakOptions .SizeInPixels

|

Remarks

Note that the SizeInPixels property simultaneously affects all the scale breaks available for an axis (both automatic and manual ).

The following images demonstrate the SizeInPixels property in action.

SizeInPixels = 5SizeInPixels = 20

Note that if the SizeInPixels property is set to -1 , the edges of the scale breaks will overlap, and a zero value means that their edges will meet.

In addition, to adjust the appearance of a scale break, you can use the following properties: ScaleBreakOptions.Style and ScaleBreakOptions.Color.

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

See Also

Scale Breaks

ScaleBreakOptions Class

ScaleBreakOptions Members

DevExpress.XtraCharts Namespace