2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
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:
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:
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:
|
2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.
You can achieve this requirement by using ZoomFactor/ZoomPosition of ChartAxis. Please find the code snippet below.
Code Example:
chart.PrimaryAxis = new CategoryAxis()
{
ZoomFactor = 0.5,
ZoomPosition = 0
};
ZoomFactor:
ZoomFactor defines the percentage of visible range from the total range of axis. For instance, when the Range is from 0 to 100 and ZoomFactor is 0.5, the visible range will be 0 to 50 or 50 to 100 (the start of the range will be determined by ZoomPosition).
ZoomPosition:
ZoomPosition defines the start of the range of values that need to be displayed as a result of ZoomFactor. For the above scenario, when the ZoomPosition is 0.25 then the visible range will be from 25 to 75.
Note: The sum of ZoomFactor and ZoomPosition must also fall within the value of 0 to 1.
+1 Naveen