Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
OLineChart使い方のメモ書き
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