protected void BuildFromCSV(string fileName) { ChartValuesBefore1.Clear(); ChartValuesBefore2.Clear(); ChartValuesAfter1.Clear(); ChartValuesAfter2.Clear(); DataTable dt = CSV_DataTable.ConvertCSVtoDataTable(fileName); int step = 1; if (dt.Rows.Count > 100) { step = dt.Rows.Count / 100; } try { for (int i = 1; i < dt.Rows.Count; i = i + step) { if (dt.Rows[i][1].ToString() != "") { ChartValuesBefore1.Add(new MeasureModel { ValueX = Convert.ToDouble(dt.Rows[i][1]), ValueY = Convert.ToDouble(dt.Rows[i][0]) }); ChartValuesBefore2.Add(new MeasureModel { ValueX = Convert.ToDouble(dt.Rows[i][2]), ValueY = Convert.ToDouble(dt.Rows[i][0]) }); } if (dt.Rows[i][3].ToString() != "") { ChartValuesAfter1.Add(new MeasureModel { ValueX = Convert.ToDouble(dt.Rows[i][3]), ValueY = Convert.ToDouble(dt.Rows[i][0]) }); ChartValuesAfter2.Add(new MeasureModel { ValueX = Convert.ToDouble(dt.Rows[i][4]), ValueY = Convert.ToDouble(dt.Rows[i][0]) }); } //MessageBox.Show(i.ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected DataTable BuildFromCSV(string fileName) { ChartValues.Clear(); DataTable dt = CSV_DataTable.ConvertCSVtoDataTable(fileName); for (int i = 1; i < dt.Rows.Count; i++) { ChartValues.Add(new MeasureModel { ValueX = Convert.ToDouble(dt.Rows[i][0]), ValueY = Convert.ToDouble(dt.Rows[i][1]) }); } return(dt); }