public BSummaryGraph(DataGridView p) { int row; const int colBmin = 11; const int colBmax = 13; const string sBmin = "Bmin"; const string sBmax = "Bmax"; const string sChartArea = "ChartArea1"; dgvWeatherAnalysis = p; InitializeComponent(); BattChart.Series[sBmin].XValueType = ChartValueType.Date; BattChart.Series[sBmax].XValueType = ChartValueType.Date; BattChart.ChartAreas[sChartArea].AxisY.Minimum = 3.4; BattChart.ChartAreas[sChartArea].AxisY.Maximum = 4.5; row = 1; foreach (DataGridViewRow dgvr in dgvWeatherAnalysis.Rows) { if (dgvr.Cells[0].Value != null) { DateTime x = DateParser.DateStringToDateTime((string)dgvr.Cells[0].Value); BattChart.Series[sBmin].Points.AddXY(x.ToOADate(), dgvr.Cells[colBmin].Value); BattChart.Series[sBmax].Points.AddXY(x.ToOADate(), dgvr.Cells[colBmax].Value); row++; } } InitializeComponent(); }
public HSummaryGraph(DataGridView p) { int row; const int colHmin = 6; const int colHavg = 8; const int colHmax = 9; const string sHmin = "Hmin"; const string sHavg = "Havg"; const string sHmax = "Hmax"; dgvWeatherAnalysis = p; InitializeComponent(); HSummary.Series[sHmin].XValueType = ChartValueType.Date; HSummary.Series[sHavg].XValueType = ChartValueType.Date; HSummary.Series[sHmax].XValueType = ChartValueType.Date; row = 1; foreach (DataGridViewRow dgvr in dgvWeatherAnalysis.Rows) { if (dgvr.Cells[0].Value != null) { DateTime x = DateParser.DateStringToDateTime((string)dgvr.Cells[0].Value); HSummary.Series[sHmin].Points.AddXY(x.ToOADate(), dgvr.Cells[colHmin].Value); HSummary.Series[sHavg].Points.AddXY(x.ToOADate(), dgvr.Cells[colHavg].Value); HSummary.Series[sHmax].Points.AddXY(x.ToOADate(), dgvr.Cells[colHmax].Value); row++; } } }
public PSummary(DataGridView p) { const string sPmin = "Pmin"; const string sPavg = "Pavg"; const string sPmax = "Pmax"; const int colPmin = 15; const int colPavg = 17; const int colPmax = 18; int row; dgvWeatherAnalysis = p; InitializeComponent(); this.pressureChart.Series[sPmin].XValueType = ChartValueType.Date; this.pressureChart.Series[sPavg].XValueType = ChartValueType.Date; this.pressureChart.Series[sPmax].XValueType = ChartValueType.Date; this.pressureChart.ChartAreas[0].AxisY.Minimum = 99000; this.pressureChart.ChartAreas[0].AxisY.Maximum = 104000; row = 1; foreach (DataGridViewRow dgvr in dgvWeatherAnalysis.Rows) { if (dgvr.Cells[0].Value != null) { DateTime x = DateParser.DateStringToDateTime((string)dgvr.Cells[0].Value); this.pressureChart.Series[sPmin].Points.AddXY(x.ToOADate(), dgvr.Cells[colPmin].Value); this.pressureChart.Series[sPavg].Points.AddXY(x.ToOADate(), dgvr.Cells[colPavg].Value); this.pressureChart.Series[sPmax].Points.AddXY(x.ToOADate(), dgvr.Cells[colPmax].Value); row++; } } }