try { MultiView1.Visible = true; Chart1.Series.Clear(); Chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray; Chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.LightGray; MultiView1.Visible = true; DataTable table = new DataTable(); table.Columns.Add("AverageGrading"); table.Columns.Add("Date"); ArrayList listofdates = dbmanager.GetListofDatesViaAll(); foreach (DateTime date in listofdates) { double gradingresult = dbmanager.GetAverageAppraisalForSectionALL(date); string monthname = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(date.Month); table.Rows.Add(gradingresult, monthname.Substring(0, 3) + "/" + date.Year.ToString().Substring(2, 2)); } DataTableReader datareader = table.CreateDataReader(); Chart1.ChartAreas[0].AxisX.Title = "Period of appraisal"; Chart1.ChartAreas[0].AxisY.Title = "Average grade"; Chart1.DataBindCrossTable(datareader, "Date", "Date", "AverageGrading", ""); Chart1.Legends.Add("Legend"); Chart1.Legends[0].Enabled = true; Chart1.Legends[0].BackColor = System.Drawing.Color.Transparent; Chart1.Width = 1000; Chart1.Height = 600; MultiView1.ActiveViewIndex = 0; } catch (Exception e) { MultiView1.Visible = false; MessageBoxShowWithoutredirect(e.Message); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)