protected void ShowChartAction(EstadisticaExamenList estadisticas) { if (estadisticas == null || estadisticas.Count == 0) { return; } Chart chart = GetChart(); foreach (EstadisticaExamenInfo item in estadisticas) { System.Windows.Forms.DataVisualization.Charting.Series serie = new System.Windows.Forms.DataVisualization.Charting.Series { Name = item.NumeroPregunta.ToString(), ChartType = SeriesChartType.StackedColumn, Color = item.PorcentajeFallos < 85 ? Color.FromArgb(216, 43, 43) : Color.FromArgb(255, 0, 0), BorderColor = item.PorcentajeFallos < 85 ? Color.Gray : Color.Red, IsValueShownAsLabel = false, IsXValueIndexed = true }; chart.Series.Add(serie); serie.Font = new Font(serie.Font.FontFamily, 5, serie.Font.Style); serie.Points.Add(BuildPoint(item)); } chart.ChartAreas[0].AxisY.Maximum = 104.99; chart.ChartAreas[0].AxisY.Interval = 5; chart.ChartAreas[0].AxisX.Interval = 1; chart.ChartAreas[0].AxisY.Title = "% Fallos"; chart.ChartAreas[0].AxisX.Title = "Preguntas"; chart.ChartAreas[0].AxisX.LabelAutoFitMinFontSize = 5; chart.ChartAreas[0].AxisX.LabelStyle.Font = new Font(chart.ChartAreas[0].AxisX.LabelStyle.Font.FontFamily, 4, chart.ChartAreas[0].AxisX.LabelStyle.Font.Style); chart.Titles[0].Text = "Estadísticas de Fallo de Preguntas en Examen: " + EntityInfo.Titulo; chart.AlignDataPointsByAxisLabel(); _chart_mng.ChartForm.Plano_RB.Checked = true; _chart_mng.ChartForm.Datos_GB.Visible = false; _chart_mng.ChartForm.Estilo_GB.Visible = false; _chart_mng.ShowChart(); }
private void Estadisticas_BT_Click(object sender, EventArgs e) { if (EntityInfo.FechaEmision.Date > DateTime.Today.Date) { MessageBox.Show(Resources.Messages.EXAMEN_NO_EMITIDO); return; } if (!EntityInfo.Desarrollo) { EstadisticaExamenList estadisticas = EstadisticaExamenList.GetList(Entity); ShowChartAction(estadisticas); ExamenReportMng reportMng = new ExamenReportMng(AppContext.ActiveSchema); EstadisticaExamenRpt rpt = reportMng.GetEstadisticaReport(EntityInfo, estadisticas, CompanyInfo.Get(AppContext.ActiveSchema.Oid, false)); ReportViewer.SetReport(rpt); ReportViewer.ShowDialog(); } }