0
votes

I have a Xamarin.Forms Android app with a Syncfusion chart to display some data.

Am I able to programmatic scroll the chart to the end preferable using Bindings to the last item in the ItemsSource?

So given a Area Series with an item source of ChartModel:

        <chart:AreaSeries   
            ItemsSource ="{Binding ChartModel,Mode=TwoWay}"
            XBindingPath="PaymentDateFormatted"
            YBindingPath="PaidAmount"               
            Color="#9cd58e">
                .....
            </chart:AreaSeries>

When the chart displays I would like it to be scrolled to the end by default:

enter image description here

Thanks,

1

1 Answers

0
votes

This requirement can be achieved by using AutoScrollingDelta feature. Use the below code.

Code:

DateTimeAxis xAxis = new DateTimeAxis();

xAxis.AutoScrollingDeltaType = DateTimeDeltaType.Days;

xAxis.AutoScrollingDelta = 7;

chart.PrimaryAxis = xAxis;

AutoScrolling:

AutoScrollingDelta feature in SfChart is used to ensure that the specified range of data is always visible in the chart and scroll to view the remaining data points. Additionally, we recommend you to refer the below knowledge base link to know more about this feature.

KB Link: https://www.syncfusion.com/kb/7721/how-to-display-fixed-number-of-data-points-in-sfchart

Regards,

Saravana Pandian M.