2017-05-25 47 views
0

我有一個Xamarin.Forms Android應用與Syncfusion圖表來顯示一些數據。滾動Xamarin.Forms Syncfusion圖表

我只能對編程滾動圖表,使用綁定在的ItemsSource的最後一個項目最好的結束?

所以給予區系列與ChartModel的項目來源:

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

當圖表顯示我想它在默認情況下滾動到最後:

enter image description here

謝謝,

回答

0

這一要求可以通過使用AutoScrollingDelta featur來實現即使用下面的代碼。

代碼:

DateTimeAxis在X軸=新的DateTimeAxis();

xAxis.AutoScrollingDeltaType = DateTimeDeltaType.Days;

xAxis.AutoScrollingDelta = 7;

chart.PrimaryAxis = x軸;

自動滾動:

AutoScrollingDelta特徵在SfChart用於確保指定的數據的範圍是總是在圖表中可見並滾動,以查看剩餘的數據點。 此外,我們建議您參考以下知識庫鏈接以瞭解有關此功能的更多信息。

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

問候,

Saravana Pandian M.

+0

嘿馬爺感謝您的回覆。我正在使用區域系列和xaml。有沒有什麼waybti實現你在xaml中的建議?我肯定會在後面的代碼中嘗試你的建議。謝謝 –