Created
March 24, 2017 12:10
-
-
Save ochilab/ceff738a9bc9660ad2196329b9086a3d to your computer and use it in GitHub Desktop.
OLineChart使い方のメモ書き
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RingArray<PerformanceInfo>[] ring = new | |
RingArray<PerformanceInfo>[3]; ////RingArray型の配列を三個用意 | |
//その箱の中の要素として扱いたい型を指定する。 | |
EnumerableDataSource<PerformanceInfo>[] ds = new | |
EnumerableDataSource<PerformanceInfo>[3]; ////加算するデータソース型の配列を三個宣言 | |
LineGraph[] chart = new LineGraph[3]; | |
public OLineChart(ChartPlotter cp, int num) { | |
this.cp = cp; //こっちでのcpに代入 | |
//ペンの色を設定 | |
lineColor[0] = Colors.Red; | |
lineColor[1] = Colors.Blue; | |
lineColor[2] = Colors.Green; | |
for (int i = 0; i < num; i++) { | |
ring[i] = new RingArray<PerformanceInfo>(200); | |
//200のリングの長さ 一個ずつ設定 | |
ds[i] = new | |
EnumerableDataSource<PerformanceInfo>(ring[i]); /// ring[0]はds[0]、他も同様 | |
ds[i].SetXMapping(pi => pi.Time); | |
ds[i].SetYMapping(pi => pi.Value); | |
chart[i] = cp.AddLineGraph(ds[i], lineColor[i], 1.0); | |
} | |
cp.LegendVisible = false; | |
} | |
public void add(int id, int x, int y) { | |
ring[id].Add(new PerformanceInfo(x, y)); | |
chart[id].DataSource = null; | |
chart[id].DataSource = ds[id]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment