Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. RingArray<PerformanceInfo>[] ring = new
  2. RingArray<PerformanceInfo>[3]; ////RingArray型の配列を三個用意
  3. //その箱の中の要素として扱いたい型を指定する。
  4.  
  5. EnumerableDataSource<PerformanceInfo>[] ds = new
  6. EnumerableDataSource<PerformanceInfo>[3]; ////加算するデータソース型の配列を三個宣言
  7.  
  8. LineGraph[] chart = new LineGraph[3];
  9.  
  10.  
  11. public OLineChart(ChartPlotter cp, int num) {
  12. this.cp = cp;  //こっちでのcpに代入
  13. //ペンの色を設定
  14. lineColor[0] = Colors.Red;
  15. lineColor[1] = Colors.Blue;
  16. lineColor[2] = Colors.Green;
  17.  
  18. for (int i = 0; i < num; i++) {
  19. ring[i] = new RingArray<PerformanceInfo>(200);
  20. //200のリングの長さ  一個ずつ設定
  21. ds[i] = new
  22. EnumerableDataSource<PerformanceInfo>(ring[i]); /// ring[0]はds[0]、他も同様
  23. ds[i].SetXMapping(pi => pi.Time);
  24. ds[i].SetYMapping(pi => pi.Value);
  25. chart[i] = cp.AddLineGraph(ds[i], lineColor[i], 1.0);
  26. }
  27. cp.LegendVisible = false;
  28. }
  29.  
  30. public void add(int id, int x, int y) {
  31. ring[id].Add(new PerformanceInfo(x, y));
  32. chart[id].DataSource = null;
  33. chart[id].DataSource = ds[id];
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement