2016-12-13 21 views
1

我需要反轉Series(OxyPlot.Series)類型的ElementCollection。 Reverse() - functoin給出一個含糊的味精,因爲我可以使用System.Linq.Enumarable.Reverse或OxyPlot.EnumerableExtensions.Reverse。兩者都不會顛倒我的ElementCollection。無法使用OxyPlot系列反轉ElementCollection

OxyPlot.EnumerableExtensions.Reverse<Series>(lineseries); 
System.Linq.Enumerable.Reverse<Series>(lineseries); 

!!線系列是一個ElementCollection所以只是名稱..不行系列

任何建議嗎?

回答

0

使用lineseries.Points.Reverse();

我已經嘗試過了,我的作品嚐試。

0

使用OxyPlot LineSeries綁定,您可以修改ObservableCollection並將其反轉。

<oxy:Plot x:Name="P6" Title="Paddle Graph 6" Grid.ColumnSpan="2"> 
     <oxy:Plot.Series> 
      <oxy:LineSeries ItemsSource="{Binding Points}"/> 
     </oxy:Plot.Series> 
    </oxy:Plot> 

而且你觀察到的集合:

Points = new ObservableCollection<DataPoint>(); 
    Points.Reverse();