Version

Configuring Axis Scale Breaks

The XamFinancialChart control allows you to determine what data you would like to show for your underlying data source’s time intervals.

Overview

The XamFinancialChart allows you to exclude intervals of data on the X-Axis by placing TimeAxisBreaks in the chart’s XAxisBreaks collection.

The TimeAxisBreak elements can be configured using a unique Start, End and Interval to determine the time intervals that you would like to exclude showing data for.

In order to use the XAxisBreaks collection, the XAxisMode property must be set to Time.

Code Snippet

The following code example shows how to configure the XAxisBreaks collection to only show data not occurring on a weekend, resulting in a XamFinancialChart like the one shown below.

financialchart scale breaks wpf.png

In XAML:

<ig:XamFinancialChart x:Name="chart" ItemsSource="{Binding}" XAxisMode="Time">
    <ig:XamFinancialChart.XAxisBreaks>
        <ig:TimeAxisBreak Start="2018-1-6T00:00:00" End="2018-1-7T23:59:59" Interval="7"/>
    </ig:XamFinancialChart.XAxisBreaks>
</ig:XamFinancialChart>

In C#:

var axisBreak = new TimeAxisBreak();
axisBreak.Start = new DateTime(2018, 1, 6, 0, 0, 0);
axisBreak.End = new DateTime(2018, 1, 7, 23, 59, 59);
axisBreak.Interval = new TimeSpan(7, 0, 0, 0);
chart.XAxisBreaks.Add(axisBreak);

In Visual Basic:

Dim axisBreak As TimeAxisBreak = New TimeAxisBreak()
axisBreak.Start = New DateTime(2018, 1, 6, 0, 0, 0)
axisBreak.End = New DateTime(2018, 1, 7, 23, 59, 59)
axisBreak.Interval = New TimeSpan(7, 0, 0, 0)
chart.XAxisBreaks.Add(axisBreak)

Related Content