2016-12-13 20 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();