美文网首页
oxyplot 入门

oxyplot 入门

作者: dyg540 | 来源:发表于2018-03-13 15:18 被阅读0次
    1. 界面
      <Grid>
      <oxy:Plot Title="{Binding Title}">
      <oxy:Plot.Series>
      <oxy:LineSeries ItemsSource="{Binding Points}"/>
      </oxy:Plot.Series>
      </oxy:Plot>
      </Grid>
    2. viewmodel

    public class MainViewModel
    {
    public MainViewModel()
    {
    this.Title = "Example 2";
    this.Points = new List<DataPoint>
    {
    new DataPoint(0, 4),
    new DataPoint(10, 13),
    new DataPoint(20, 15),
    new DataPoint(30, 16),
    new DataPoint(40, 12),
    new DataPoint(50, 12)
    };
    }
    public string Title { get; private set; }
    public IList<DataPoint> Points { get; private set; }
    }

    1. logic
      this.DataContext = new MainViewModel();

    相关文章

      网友评论

          本文标题:oxyplot 入门

          本文链接:https://www.haomeiwen.com/subject/pzyzfftx.html