Articles in this section
Category / Section

How to display fixed number of data points in Chart

1 min read

Auto scrolling delta feature in SfChart is used to ensure that the specified range of data is always visible in the chart. You can view the remaining data points by scrolling. It always shows the recently added data points at the end, and scrolling will be reset to the end of the range whenever a new point is added. The following code examples illustrate how to specify the auto scrolling delta value for different axis types.

Category axis

The AutoScrollingDelta property of ChartAxis is used to customize the number of visible points to be displayed in chart when using the category axis.

XAML:

<chart:SfChart.PrimaryAxis>
       <chart:CategoryAxis AutoScrollingDelta="3"/>
</chart:SfChart.PrimaryAxis>

 

C#:

chart.PrimaryAxis = new CategoryAxis
{
      AutoScrollingDelta = 3
};

 

Screenshot:

C:\Users\divya.venkatesan\AppData\Local\Microsoft\Windows\INetCache\Content.Word\Category.png

 

Numerical axis

The AutoScrollingDelta property of ChartAxis is used to customize the visible range to be displayed in chart when using the numerical axis.

XAML:

<chart:SfChart.PrimaryAxis>
       <chart:NumericalAxis AutoScrollingDelta="10"/>
</chart:SfChart.PrimaryAxis>

 

C#:

chart.PrimaryAxis = new NumericalAxis
{
      AutoScrollingDelta = 10
};

 

Screenshot:

C:\Users\divya.venkatesan\AppData\Local\Microsoft\Windows\INetCache\Content.Word\Numerical.png

 

Date-Time axis

The AutoScrollingDelta property of ChartAxis is used to customize the visible range to be loaded in chart when using the date-time axis, and the AutoScrollingDeltaType property of DateTimeAxis is used to specify the date-time component for AutoScrollingDelta value.

XAML:

<chart:SfChart.PrimaryAxis>
       <chart:DateTimeAxis AutoScrollingDelta="3" AutoScrollingDeltaType="Months"/>
</chart:SfChart.PrimaryAxis>

 

C#:

chart.PrimaryAxis = new DateTimeAxis
{
      AutoScrollingDelta = 3,
      AutoScrollingDeltaType = DateTimeDeltaType.Months
};

 

Screenshot:

C:\Users\divya.venkatesan\AppData\Local\Microsoft\Windows\INetCache\Content.Word\DateTime.png

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied