void InitXYDiagram() { chartCalib.Series[0].Points.Clear(); chartCalib.Series[1].Points.Clear(); chartCalib.Series[0].LegendText = "---"; chartCalib.Series[1].LegendText = "---"; string serie = "{0}, {1}"; RegressionLineal oRL_serie1 = new RegressionLineal(); RegressionLineal oRL_serie2 = new RegressionLineal(); foreach (ChartPoint item in lstChartPoint_serie1) { DevExpress.XtraCharts.SeriesPoint punto = new DevExpress.XtraCharts.SeriesPoint(); punto.Argument = item.X.ToString(); punto.Values = new double[] { Convert.ToDouble(item.Y) }; oRL_serie1.AddPoint(Convert.ToDouble(item.X), Convert.ToDouble(item.Y)); chartCalib.Series[0].Points.Add(punto); chartCalib.Series[0].LegendText = string.Format(serie, oRL_serie1.getEcuation(), oRL_serie1.getR()); } foreach (ChartPoint item in lstChartPoint_serie2) { DevExpress.XtraCharts.SeriesPoint punto = new DevExpress.XtraCharts.SeriesPoint(); punto.Argument = item.X.ToString(); punto.Values = new double[] { Convert.ToDouble(item.Y) }; oRL_serie2.AddPoint(Convert.ToDouble(item.X), Convert.ToDouble(item.Y)); chartCalib.Series[1].Points.Add(punto); chartCalib.Series[1].LegendText = string.Format(serie, oRL_serie2.getEcuation(), oRL_serie2.getR()); } try { if (!double.IsNaN(oRL_serie2.r())) { tbRexp2.BackColor = oRL_serie2.r() > Convert.ToDouble(tbRexp2.Value) ? Color.White : Color.Red; } if (!double.IsNaN(oRL_serie1.r())) { tbRexp2.BackColor = oRL_serie1.r() > Convert.ToDouble(tbRexp2.Value) ? Color.White : Color.Red; } } catch { } }
void InitXYDiagram() { chartCalib.Series[0].Points.Clear(); chartCalib.Series[1].Points.Clear(); chartCalib.Series[0].LegendText = "---"; chartCalib.Series[1].LegendText = "---"; string serie = "{0}, {1}"; RegressionLineal oRL_serie1 = new RegressionLineal(); RegressionLineal oRL_serie2 = new RegressionLineal(); foreach (ChartPoint item in lstChartPoint_serie1) { DevExpress.XtraCharts.SeriesPoint punto = new DevExpress.XtraCharts.SeriesPoint(); punto.Argument = item.X.ToString(); punto.Values = new double[] { Convert.ToDouble(item.Y) }; oRL_serie1.AddPoint(Convert.ToDouble(item.X), Convert.ToDouble(item.Y)); chartCalib.Series[0].Points.Add(punto); chartCalib.Series[0].LegendText = string.Format(serie, oRL_serie1.getEcuation(), oRL_serie1.getR()); } foreach (ChartPoint item in lstChartPoint_serie2) { DevExpress.XtraCharts.SeriesPoint punto = new DevExpress.XtraCharts.SeriesPoint(); punto.Argument = item.X.ToString(); punto.Values = new double[] { Convert.ToDouble(item.Y) }; oRL_serie2.AddPoint(Convert.ToDouble(item.X), Convert.ToDouble(item.Y)); chartCalib.Series[1].Points.Add(punto); chartCalib.Series[1].LegendText = string.Format(serie, oRL_serie2.getEcuation(), oRL_serie2.getR()); } try { if (!double.IsNaN(oRL_serie2.r())) tbRexp2.BackColor = oRL_serie2.r() > Convert.ToDouble(tbRexp2.Value) ? Color.White : Color.Red; if (!double.IsNaN(oRL_serie1.r())) tbRexp2.BackColor = oRL_serie1.r() > Convert.ToDouble(tbRexp2.Value) ? Color.White : Color.Red; } catch { } }