public void Ajoute_Data(st_Graph_Datas datas, int position_X) { if (chart.gameObject.activeSelf) { chart.DataSource.StartBatch(); } byte channel_id; for (byte i = 0; i < datas.datas.nb_datas_to_send; i++) { channel_id = datas.datas.Datas[i].Channel; //Check if this channel already exist or create it Create_New_Channel($"Channel_{channel_id}", channel_id); //Then add the datas to this channel if (chart.gameObject.activeSelf) { chart.DataSource.AddPointToCategory($"Channel_{channel_id}", position_X, datas.datas.Datas[i].Data); } //And to the history try { Data_Historique[channel_id].Add(new Vector2(position_X, datas.datas.Datas[i].Data)); } catch { } } if (chart.gameObject.activeSelf) { if (position_X > chart.DataSource.HorizontalViewSize) { chart.DataSource.HorizontalViewOrigin++; } chart.DataSource.EndBatch(); } }
public void Ajoute_Data(st_Graph_Datas datas) { Ajoute_Data(datas, index_position_X++); }