LineChart.xaml.cs 858 B

1234567891011121314151617181920212223242526272829303132333435
  1. using LiveCharts;
  2. using LiveCharts.Wpf;
  3. using System;
  4. using System.Windows.Controls;
  5. namespace FastGithub.UI
  6. {
  7. /// <summary>
  8. /// LineChart.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class LineChart : UserControl
  11. {
  12. public SeriesCollection SeriesCollection { get; } = new SeriesCollection();
  13. public string[] Labels { get; set; }
  14. public Func<double, string> YFormatter { get; set; }= value => value.ToString("0.00");
  15. public LineSeries ReadSeries { get; } = new LineSeries();
  16. public LineSeries WriteSeries { get; } = new LineSeries();
  17. public LineChart()
  18. {
  19. InitializeComponent();
  20. this.SeriesCollection.Add(this.ReadSeries);
  21. this.SeriesCollection.Add(this.WriteSeries);
  22. DataContext = this;
  23. }
  24. }
  25. }