Skip to main content

Axis class properties

Properties described here applicable all XY and 3D axes, unless specified otherwise.

In ViewXY an unlimited count of Y or X axes can be defined. Add the Y axes by using YAxes collection property (while X axes to XAxes collection). For example,

// Adding Y-axes to the chart
chart.ViewXY.YAxes.Add(new AxisY());

// OR
AxisY axisY = new AxisY(_chart.ViewXY);
axisY.Title.Text = "Y-axis";
chart.ViewXY.YAxes.Add(axisY);

Axis properties in image
Illustration of terms used: axis, divisions, grid etc.

Value type

ValueType -property controls which value types are used by the axis labels.

// Changing axis value type
chart.ViewXY.YAxes[0].ValueType = AxisValueType.DateTime;

ValueType has the following options available:

Number

Regular numeric format for integer and decimal presentation. When AutoFormatLabels is disabled, LabelsNumberFormat applies. See labels formatting.

Note!

When AxisValueType is Number, sometimes it is still desired that Axis tick interval is tuned not towards decimal but towards time unit (e.g. 6, 60, 600). This is mostly applicable for large time scales. When user wishes to have time interval of multiply of 6 or 60 (e.g 0-30-60-90 or 0-60-120-180), Axis property AutoDivSpacingForNumbersInTime should be enabled.

Time

For time of day presentation. When AutoFormatLabels is disabled, LabelsTimeFormat applies. See labels formatting.

DateTime

Date presentation, with optional time of day. When AutoFormatLabels is disabled, LabelsTimeFormat applies here as well, similarly to Time type. See labels formatting.

Note!

For best accuracy, it is advised to set DateOriginYear, DateOriginMonth and DateOriginDay just below (minimum) dates shown in the chart.

xAxis.SetDateOrigin(new DateTime(2019, 12, 17));
// or
xAxis.DateOriginYear = 2019;
xAxis.DateOriginMonth = 12;
xAxis.DateOriginDay = 17;

Use DateTimeToAxisValue method to obtain axis values from a .NET DateTime object to be used in series data.

// Convert current time to Y value
data[0].X = chart.ViewXY.XAxes[0].DateTimeToAxisValue(DateTime.Now);
MapCoordsDegrees

Geographical map coordinate presentation in degrees decimals.

Example: 40.446195° -79.948862°

MapCoordsDegNESW

Geographical map coordinate presentation in degrees decimals, with N, E, S, W indication.

Example: 40.446195N 79.948862W

MapCoordsDegMinSecNESW

Geographical map coordinate presentation in degrees, arc minutes, arc seconds, with N, E, S, W indication.

Example: 40°2'13"N 9°58'2"W

MapCoordsDegPadMinSecNESW

Geographical map coordinate presentation in degrees, arc minutes, arc seconds, with N, E, S, W indication. The arc minute and second values are padded with zeros, if they are < 10. It is a great way to present coordinates in Y axis, as the numbers are aligned.

Example: 40°02'13"N 9°58'02"W

AutoFormatLabels format string

When AutoFormatLabels property is enabled, LightningChart tries to estimate the best suitable format string for Axis' ticks values. Auto-string is intended to be as short as possible, but avoiding adjacent value to be rounded to same string/value.

For example, when numeric values are shown, the significant digits count is controlled by zero-placeholder symbol (e.g. "0" "0.0", "0.000" etc.). However, only until 6 digits. If more precision is need label formatting switches to Exponential notation (e.g. "E+0").

If user wants to know the last used label format string, one can call Axis.GetLabelsFormat() method. If axis range was changed, one should wait until rendering is done in order to read correct string format. Possible code excerpt:

private void AxisX_RangeChanged(object sender, RangeChangedEventArgs e)
{
_chart.AfterRendering += _chart_AfterRendering;
}

private void _chart_AfterRendering(object sender, AfterRenderingEventArgs e)
{
_chart.AfterRendering -= _chart_AfterRendering;

string labelFormat = _chart.ViewXY.XAxes[0].GetLabelsFormat();
}
Note

If DataCursor is enabled (ViewXY.DataCursor.Visible = True), then Axis.GetLabelsFormat() method returns format string used for Axis values formatting in ResultTable. Typically it is higher precision than Ticks labels.

Tick value labels formatting

AutoFormatLabels allows the count of decimals, time format representation, or the use of exponential representation, to be calculated automatically to be suitable for visible range. To set the value formatting manually, AutoFormatLabels should be disabled.

chart.ViewXY.YAxes[0].AutoFormatLabels = false;

LabelsNumberFormat can be used to set the format of numeric values.

// Always use two decimals
chart.ViewXY.YAxes[0].LabelsNumberFormat = "0.00";

// Exponential presentation with one decimal
chart.ViewXY.YAxes[0].LabelsNumberFormat = "0.0E+00";
tip

.NET support many Standard and Custom numeric format strings.

To set the time formatting manually, use LabelsTimeFormat property. It supports any count of second fractions (e.g. “.ffffffff”) allowing precise zoomed views.

// Show hours, minutes, seconds and four significant digits
_chart.ViewXY.YAxes[0].LabelsTimeFormat = "HH:mm.ss.ffff";
tip

.NET support many Standard and Custom date and time format strings.

tip

Examples of usage (for custom label format string) could be found in our Demo application (see Learning from Demo): ExampleHighLow; ExampleTrillionDigital, ExampleCursorProjectOnAxes, ExampleECGPaperGrid.

Range setting

Set the value range of an axis by giving values to Minimum and Maximum properties. Minimum should be less than Maximum. When trying to set Minimum > Maximum, or vice versa, internal limiter will limit the values near the other value. To set both values simultaneously, use SetRange(…) method. Passing Minimum > Maximum in SetRange() automatically flips these values so that Minimum < Maximum.

chart.ViewXY.YAxes[0].Minimum = 5;
chart.ViewXY.YAxes[0].SetRange(5, 10);

The value range of Y axis can be scrolled directly by dragging the axis with mouse when AllowScrolling is enabled. Minimum or Maximum can be modified by dragging the ScaleNib area (end of an axis) up or down when AllowScaling property is enabled.

// Enabling / disabling dragging with mouse
chart.ViewXY.YAxes[0].AllowScrolling = true;
chart.ViewXY.YAxes[0].AllowScaling = true;

Restoring range

Axis has properties RangeRevertEnabled, RangeRevertMaximum and RangeRevertMinimum. They can be used to revert axis ranges to specific values when mouse zooming is applied from right to left. See RightToLeftZoomAction for details.

Axis divisions, ticks' interval

AutoDivSpacing -property allows the major divisions to be calculated automatically. It is enabled by default. The spacing is calculated based on value labels’ font size and AutoDivSeparationPercent properties to be as user-friendly as possible. AutoDivSeparationPercent leaves a space between the value labels. It is based on the label’s height, meaning that increasing the value reduces the amount of major divisions.

AutoDivSpacing and AutoDivSeparationPercent do not affect minor divisions. Instead, they are calculated between major divisions based on the MinorDivCount property value. The default value is five minor ticks and they are enabled (MinorDivTickStyle.Visible property)

// 100 percent of value labels’ height left between each label
chart.ViewXY.YAxes[0].AutoDivSeparationPercent = 100;

// Enabling minor division ticks
chart.ViewXY.YAxes[0].MinorDivTickStyle.Visible = true;
chart.ViewXY.YAxes[0].MinorDiv = 5;

If AutoDivSpacing is disabled, the division spacing can be controlled manually with MajorDiv and MajorDivCount -properties. MajorDiv controls the spacing by magnitude, whereas MajorDivCount controls it by division count (only one of those 2 properties should be set, another will be calculated automatically). KeepDivCountOnRangeChange property can be used to force maintaining the divisions count the same whenever the axis range is changed, regardless of MajorDiv setting.

// Major ticks after each 20 units (0, 20, 40, 60…)
chart.ViewXY.YAxes[0].MajorDiv = 20;

// Show exactly five major divisions
chart.ViewXY.YAxes[0].MajorDivCount = 5;
// Keep the division count the same even if the axis range is changed
chart.ViewXY.YAxes[0].KeepDivCountOnRangeChange = true;
Note

The position (interval) of standard axis labels are calculated is such way that overlap between them is prevented (even when automatic division spacing is not set).

When DivisionReduction property is enabled (default), ticks' count can be smaller than set with MajorDivCount (with AutoDivSpacing disabled). In contrast, when DivisionReduction is disabled ticks' count will be as set by MajorDiv or MajorDivCount -properties, but axis-labels will be drawn only to some of them (without overlapping).

Only CustomTicks labels are allowed to overlap if DivisionReduction is disabled.

Tick Style

Major division tick style can be set from MajorDivTickStyle property. Edit the ticks and labels orientation by using MajorDivTickStyle.Alignment property. The value labels are drawn next to major division ticks. Respectively, the minor division properties can be modified with MinorDivTickStyle property.

// Changing alignment and tick length of the major division ticks
chart.ViewXY.YAxes[0].MajorDivTickStyle.Alignment = Alignment.Far;
chart.ViewXY.YAxes[0].MajorDivTickStyle.LineLength = 20;
Note!

For AxisY class, the ticks (minor or major) Alignment property is taken into account only if ViewXY. AxisLayout. YAxisAutoPlacement property is 'Off' or ViewXY. AxisLayout. AutoAdjustMargins property is disabled. Same applies for AxisX class (with corresponding names of properties).

LabelTicksGap

Gap between labels and ticks is controlled by LabelTicksGap property. Value is in pixels (default is 5).

Grid

Horizontal grid lines are drawn on vertical positions of division ticks. Major grid for major division ticks, minor grid for minor division ticks. MajorGrid and MinorGrid properties can be used to edit the appearance of the grids.

// Modifying the grid styles
chart.ViewXY.YAxes[0].MajorGrid.Color = Color.FromArgb(100, 200, 200, 200);
chart.ViewXY.YAxes[0].MinorGrid.Pattern = LinePattern.Dash;

Custom ticks

Axis tick positions and label texts can be manually set by using custom ticks. Set CustomTicksEnabled true and define the positions of the ticks with the CustomTicks list property.

Custom tick properties
Custom tick properties

Custom ticks can consist of a tick, a grid or both. Use Style to select between Tick, Grid or TickAndGrid respectively. The color of a tick or a grid can be modified via Color property. Set tick length in Length property. The grid line pattern follows the setting of MajorGrid.Pattern and PatternScale properties of axis.

CustomAxisTick has AxisValue and LabelText properties to define their positions and corresponding label texts. When using custom ticks, disable AutoFormatLabels to show the custom label texts. Furthermore, InvalidateCustomTicks() should be called after setting new custom ticks in code.

// Adding a custom tick with a green tick and grid line
_chart.ViewXY.YAxes[0].CustomTicks.Add(new CustomAxisTick(_chart.ViewXY.YAxes[0], 14, "Sell level\nUSD 14", 10, true, Colors.Green, CustomTickStyle.TickAndGrid));

// White tick with no grid line
_chart.ViewXY.YAxes[0].CustomTicks.Add(new CustomAxisTick(_chart.ViewXY.YAxes[0], 12.2, "Month\nmedian", 20, true, Colors.White, CustomTickStyle.Tick));

// Red tick and grid line
_chart.ViewXY.YAxes[0].CustomTicks.Add(new CustomAxisTick(_chart.ViewXY.YAxes[0], 11, "Buy level\nUSD 11", 10, true, Colors.Red, CustomTickStyle.TickAndGrid));

// Allow showing the custom tick strings
_chart.ViewXY.YAxes[0].CustomTicksEnabled = true;
_chart.ViewXY.YAxes[0].AutoFormatLabels = false;
_chart.ViewXY.YAxes[0].MajorGrid.Pattern = LinePattern.Dot;
_chart.ViewXY.YAxes[0].InvalidateCustomTicks();

Custom ticks on Y axis
Custom ticks on Y axis. On the left, axis.AutoFormatLabels = false. On the right, AutoFormatLabels = True.

Minor ticks or grids are not shown when CustomAxisTicksEnabled is true. To set arbitrary minor ticks or grids, just add CustomAxisTicks in the CustomTicks collection with different colors or line lengths.

info

To see feature demonstration as example, check Custom axis ticks, Date axes and custom ticks from our Demo.

Event based axis value formatting

Besides CustomAxisTicks, axis value labels can also be formatted via FormatValueLabel -event. It modifies each value label of the corresponding axis based on the returned string value. The event has e.Axis and e.Value properties, which can be used access the axis object and the label value being modified. Unlike CustomAxisTicks, FormatValueLabel cannot be used to change the position of the labels, as they still follow the division settings (Axis divisions) for the axis.

// Subscribing to FormatValueLabel -event for the Y-axis
_chart.ViewXY.YAxes[0].FormatValueLabel += Chart_FormatValueLabel;

// Modifying the value labels inside the event
private string Chart_FormatValueLabel(object sender, FormatValueLabelEventArgs e)
{
return "Y-axis value: " + e.Value.ToString();
}

FormatAxisValues
FormatAxisValues used with the lower y-axis. The values are shown as ”Y-axis value: ” + current value.

FormatValueLabel can be used with both Y- and X-axis as well as with every axis in View3D.

info

To see feature demonstration as example, check Business dashboard, ExamplePersistentIntensitySignal, ExampleAxisLabelRangeEdit from our Demo.

How to create Axis labels with scientific notation could be found in our special guide.

Reversed X and Y axis

By enabling Reversed property, X and Y axis can be shown reversed, so that minimum value is above/later than the maximum value. Handy feature when, for example, visually negating polarity of the series data assigned to the Y axis.

chart.ViewXY.YAxes[0].Reversed = true;

Logarithmic axes

Set ScaleType to Logarithmic to use a logarithmic presentation. Set the logarithm base value with LogBase property. The chart can also show logarithmic values between 0…1. Use LogZeroClamp to set the minimum value in the axis. To use typical minimum value of a log axis, set 1. To use values below zero, set a proper small positive value, like 1.0E-20, suitable for the used data. To use special formatting for tick labels, set LogLabelsType.

// Setting a logarithmic axis
chart.ViewXY.YAxes[0].ScaleType = ScaleType.Logarithmic;
chart.ViewXY.YAxes[0].LogBase = 10;
chart.ViewXY.YAxes[0].LogZeroClamp = 1;
chart.ViewXY.YAxes[0].LogLabelsType = LogLabelsType.Log10Exponential;

Exponential presentation for 10 base

Logarithmic Y axis, base 10
Logarithmic Y axis with values near zero. LogZeroClamp is set to 1.0E-20. LogBase is set to 10, LogLabelsType is set to Log10Exponential, to show the values in 1.0E presentation.

Natural logarithm

Set LogBase to Math.E, and set LogLabelsType to LogE_MultiplesOfNeper option.

Natural logarithm
Natural logarithm view. LogBase is set to Math.E LogLabelsType is set to LogE_MultiplesOfNeper.

Axis position

Axis vertical or horizontal position defined by ViewXY. AxisLayout options (see Axis layout options). X-axes is controlled by AxisLayout. XAxisAutoPlacement property, while Y-axes is controlled by AxisLayout. YAxisAutoPlacement property.

Only when auto-placement is Off the Axis.Position property is taken into account. Position set X-axis placement as percents of the graph height (where 0 sets the axis in top edge, 50 in the middle and 100 in bottom edge). While Y-axis placed as percents of the graph width (0 sets the axis in left edge, 50 in the middle and 100 in right edge).

AXAxisAutoPlacement = Off
XAxisAutoPlacement = Off. Automatic axis placement is disabled, and Position and Alignment properties of each axis apply separately. First axis Position = 0, Second axis Position = 50 and Third axis position = 100.

YAxisAutoPlacement = Off
YAxisAutoPlacement = Off. Automatic axis placement is disabled, and Position and Alignment properties of each axis apply separately. First axis Position = 0, Second axis Position = 20 and Third axis position = 80.

Converting between axis values and screen coordinates

Axes have methods to convert axis values (data point values) to screen coordinates and screen coordinates to axis values. Use ValueToCoord method to convert an axis value to a screen coordinate, and CoordToValue to convert a screen coordinate to an axis value. Set UseDIP = False, if pixels are preferred, not Device independent pixels (DIPs) (see more about DPI handling).

float screenCoordinate = _chart.ViewXY.XAxes[0].ValueToCoord(axisValue, true);

ValueToCoord and CoordToValue methods are available after the chart has got its final size. For example, subscribe to chart. AfterRendering event to ensure the chart has been fully rendered.

To convert multiple values or coordinates at once, use ValuesToCoords and CoordsToValues methods. ValuesToCoords takes input as double array and returns screen coordinates as float array. CoordsToValues takes input as integer array for X axis (but as float array for Y axis) and return axis values as double array.

chart.ViewXY.YAxes[0].CoordsToValues(coordArray, out doubleValueArray, false);

Converting between axis values and DateTime

Although Axis labels can show time-date, internally LightningChart axis uses double type (and precision) values. While label type is controlled by Value property, the data itself should be converted from DateTime to double-type with DateTimeToAxisValue method. For example,

lineSeriesPoints[point].X = _chart.ViewXY.XAxes[0].DateTimeToAxisValue(dataA[point].Date);

Note, if Value property is set to Time or DateTime option, when data point value is used as represented in seconds (this is what DateTimeToAxisValue method conversion is about).

When user wants to convert axis/series double-type value back to DateTime, one should use Axis AxisValueToDateTime method.

Note!

For best conversion accuracy, it is advised to set DateOriginYear, DateOriginMonth and DateOriginDay just below (minimum) dates shown in the chart.

xAxis.SetDateOrigin(new DateTime(2024, 12, 17));
// or
xAxis.DateOriginYear = 2024;
xAxis.DateOriginMonth = 12;
xAxis.DateOriginDay = 17;

Axis end point labels

Regular axis major ticks and labels are placed at uniform intervals. Therefore, axis minimum or maximum could be without a label, especially when the axis is panned, scrolled or logarithmic axis is zoomed deeply. The labels can be enforced to be shown at both ends of axis by enabling EndPointLabelsVisible property.

PreferEndPointLabelsOverNearbyMajorTick property controls if the end label or a regular major tick label is preferred if their positions overlap. EndPointMajorTickThreshold property defines the number of major ticks that must be visible before the end point labels are hidden. The default -1 means the end point labels will always be visible. If logarithmic axis major tick count less than or equal to EndPointMajorTickThreshold, then label next to minor tick will be shown.

EndPointLabels
On the left chart’s X axis PreferEndPointLabelsOverNearbyMajorTick is disabled, while on the right this property is enabled. The left chart’s Y axis is set to always show end labels (EndPointLabelsVisible=true, EndPointMajorTickThreshold=-1), while the right chart’s Y axis is configured to show a minor tick in addition to one major tick (EndPointLabelsVisible=true, EndPointMajorTickThreshold=1).

Y Axis specific properties

MiniScale

MiniScale is a miniature X and Y axis substitute. In some applications this kind of scale presentation is preferred for quick visual overview of data magnitude, or alternatively, when there’s no space for actual axes. MiniScale can be enabled via Visible -property. MiniScale is a sub-property of Y axis class. However, the X dimension is always bound to the first X axis (XAxes[0]). Set the visible units by modifying Units.Text property of X and Y axis. MiniScale cannot be used together with logarithmic axes.

// Configuring a MiniScale
chart.ViewXY.YAxes[0].MiniScale.Visible = true;
chart.ViewXY.YAxes[0].MiniScale.VerticalAlign = AlignmentVertical.Bottom;
chart.ViewXY.YAxes[0].MiniScale.Offset.SetValues(-10, -30);
chart.ViewXY.YAxes[0].MiniScale.PreferredSize = new SizeDoubleXY(30, 30);
chart.ViewXY.XAxes[0].Units.Text = "s";
chart.ViewXY.YAxes[0].Units.Text = "µV";

MiniScale
MiniScale in the bottom-right corner of the graph.

UsePalette

The palette coloring can be set for Y axis line too. Enable UsePalette property of Y axis and assign the preferred series in PaletteSeries property.

//Color the Y axis too with the series palette
_chart.ViewXY.YAxes[0].PaletteSeries = pls;
_chart.ViewXY.YAxes[0].UsePalette = true;

X Axis specific properties

Real-time monitoring scrolling

When making a real-time/streaming (monitoring) solution, the X axis must be scrolled to correctly show the current monitoring position, which usually is the time stamp of latest signal point. Set the latest time stamp to ScrollPosition property after the new signal points have been set to a series.

// Set real-time monitoring scroll position to the latest X value
chart.ViewXY.XAxes[0].ScrollPosition = latestDataPoint.X;

LightningChart has several scrolling modes, selected using ScrollMode property.

chart.ViewXY.XAxis[0].ScrollMode = XAxisScrollMode.Scrolling;

None

The default option. No scrolling is applied when setting ScrollMode to None. This is often the selection to use when not using real-time monitoring.

Stepping

When collected data reaches the end of the X axis, the axis with all series data is shifted left by a stepping interval. This shift is executed every time the X axis end is reached. SteppingInterval property is defined as value range.

chart.ViewXY.XAxes[0].SteppingInterval = 3;

ScrollMode Stepping
X axis scroll mode: stepping

Scrolling

X axis is kept stationary until scrolling gap has been reached, after which the X axis with all series is continuously shifted left. If the scrolling should take effect when the scroll position reaches the end of X axis, set ScrollingGap to 0. ScrollingGap property is defined as percents of graph width.

chart.ViewXY.XAxes[0].ScrollingGap = 15;

ScrollMode Scrolling
X axis scroll mode: scrolling



Waveform stability during scrolling

LightningChart supports incremental rendering data construction of real-time signal, when using series. AddPoints(), AddValues() or AddSamples() -methods. This means that rendering data is calculated only from the new part of data and combined with the existing rendering data.

PointLineSeries, SampleDataSeries, AreaSeries and HighLowSeries have a specific property for ScrollMode = Scrolling, which effects the visual stability of scrolled series maintaining the waveform quality. The property is called ScrollingStabilizing.

chart.ViewXY.PointLineSeries[0].ScrollingStabilizing = true;

When ScrollingStabilizing is enabled, floating point coordinates are rounded to nearest integer coordinate, which results into a visually stable, non-fluctuating waveform. In most cases, this is the best approach. It may, however, distort the phase info slightly when rounding the coordinates.

When ScrollingStabilizing is disabled, data rendering uses floating point coordinates which appear as slightly fluctuating waveform when GPU decides the pixel coordinate. This gives better visual quality especially when displaying sine data where there’s a transition going up and down nearly every other pixel.

To use incremental rendering data construction, add new points as follows

chart.BeginUpdate();
series.AddPoints(array,false);
xAxis.ScrollPosition = latestXValue;
chart.EndUpdate();

Full refresh of rendering data can be made any time with InvalidateData() call of series.

chart.BeginUpdate();
series.AddPoints(array,false);
series.InvalidateData();
xAxis.ScrollPosition = latestXValue;
chart.EndUpdate();

ScrollingStabilizing
Waveform stability during scrolling

Sweeping

Sweeping mode gives probably the most user-friendly real-time monitoring view. Sweeping uses two X axes. The first axis is collected full after which a sweeping gap appears. The second X axis is then swept over the first one. Both X axes show their own value labels. SweepingGap property is defined as percents of graph width.

chart.ViewXY.XAxes[0].SweepingGap = 5;

ScrollMode Sweeping
X axis scroll mode: sweeping

Triggering

The X axis position is determined by a series value exceeding or falling below a trigger level. Use Triggering property to set the triggering options. Triggering can be set active by enabling Triggering. TriggeringActive property.

One series has to be set as a triggering series. Accepted triggering series types are PointLineSeries and SampleDataSeries. Set the triggering Y level with Triggering. TriggerLevel. Use Triggering. TriggeringXPosition to order where the level triggered point will be drawn horizontally, as percents of graph width.

ScrollMode Triggering
X axis scroll mode: Triggered with static X grid.

When using a triggered X-axis scroll position, it usually is not suitable to show the regular X axis with values and grid because of jumping from place to another based on the incoming series data.

  • Approach 1: Use static X grid. Hide the regular X axis objects by setting XAxis.Visible = false (or LabelsVisible = false, MajorGrid.Visible = false and MinorGrid.Visible = false). Then, show the static X grid by setting Triggering.StaticMajorXGridOptions and Triggering.StaticMinorXGridOptions.

  • Approach 2: Create another X axis, with preferred scale, and set it to ViewXY collection. Don’t assign the second XAxis for the series.

For scale indication, use Y axis MiniScale or define an AnnotationXY to show range like “200 ms/div”.

info

To see feature demonstration as example, check Oscilloscope from our Demo.

Scale breaks

Starting from version 8, X axes support ScaleBreaks. ScaleBreaks allow excluding specific X ranges, e.g. inactive trading hours/dates or machinery off-production hours. All the series, that have been assigned to the specified X axis, are clipped, including axis and labels themselves.

There are limitations of when ScaleBreaks can be used: ScrollMode must be set to ‘None’ and ScaleType to ‘Linear’.

Insert the ScaleBreak objects in ScaleBreaks collection of X axis.

ScaleBreak properties
ScaleBreak properties

Specify the range of the break with Begin and End. They are given as axis values, not DateTimes. Use axis. DateTimeToAxisValue method to convert them if using DateTimes.

Gap width can be adjusted with Gap, also 0 is accepted if no gap should be visible. Gap appearance can be configured with Style.

  • With Style = ‘Fill’, adjust the fill with Fill property.
  • With Style = ‘DiagonalLineUp’ or ‘DiagonalLineDown’, adjust the appearance with DiagonalLineSpacing and LineStyle properties.

By setting Enabled = False, the break is made not effective.

PointLineSeries, AreaSeries and HighLowSeries have ContinuousOverScaleBreak property. By enabling it, a connecting line will be rendered over the gap.

ScaleBreak disabled
Original trading data, Monday to Friday, 10 AM – 6 PM. ScaleBreaks haven’t been applied. Majority of the time range doesn’t have data as stock exchange has been closed making it harder to see the essential info. PointLineSeries jumping from Close-to-Close values.

ScaleBreak enabled
ScaleBreaks applied to exclude non-active trading hours. More screen space is available for essential data. Style = Fill, Gap = 10. PointLineSeries jumping from Close-to-Close values, PointLineSeries.ContinuousOverScaleBreak = True.

ScaleBreak enabled
ScaleBreaks applied, during non-active trading hours. Style = DiagonalLinesUp, Gap = 20. PointLineSeries.ContinuousOverScaleBreak = True.

ScaleBreak enabled
PointLineSeries.ContinuousOverScaleBreak = False. The lines are not connected from previous point to next point over the gap. Instead, they continue to their original direction as if no scale break has been defined.

info

To see feature demonstration as example, check ExampleTradingScaleBreaks, ExampleLineSeriesXYFeatures from our Demo.

Mode details about ScaleBreaks could be found in following blog