Advertisement
Guest User

OxyPlot creating model in VM

a guest
Jul 24th, 2016
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. PlotModel model = new PlotModel();
  2. CategoryAxis axis = new CategoryAxis
  3. {
  4.     Position = AxisPosition.Bottom,
  5.     MajorStep = 1,
  6.     MinorStep = 1,
  7.     TextColor = OxyColors.RoyalBlue,
  8.     FontSize = 10,
  9.     MajorGridlineStyle = LineStyle.LongDash
  10. };
  11. LineSeries series = new LineSeries
  12. {
  13.     MarkerType = MarkerType.Circle,
  14.     MarkerFill = OxyColor.FromRgb(0x20, 0xf0, 0xf0),
  15.     Color = OxyColor.FromRgb(0x20, 0x20, 0xf0)
  16. };
  17. for (int i = 0; i < data.Length; i++)
  18. {
  19.     series.Points.Add(new DataPoint(i, data[i].Count));
  20.     axis.Labels.Add(data[i].Label);
  21. } //efor
  22. model.Axes.Add(axis);
  23. model.Series.Add(series);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement