Esempio n. 1
0
 private void CargarFormularioChartPorSexo()
 {
     //conexionBD.Add(dataSource);
     //conexionBD.Add(initialCatalog);
     //conexionBD.Add(user);
     //conexionBD.Add(password);
     rcView.Series.Clear();
     BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
     barSeries.Name = "Q1";
     BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
     barSeries2.Name = "Q2";
     BarSeries barSeries3 = new BarSeries("Performance", "RepresentativeName");
     barSeries3.Name = "Q2";
     SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter da = new SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter();
     SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable dt = new WinUI.SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable();
     da.Connection.ConnectionString = cadenaConexion;
     da.Fill(dt);
     foreach (DataRow dr in dt.Rows)
     {
         barSeries.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Paciente"].ToString()), dr["nombre"].ToString()));
         barSeries.ShowLabels = true;
         barSeries2.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Femenino"].ToString()), dr["nombre"].ToString()));
         barSeries3.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Masculino"].ToString()), dr["nombre"].ToString()));
         barSeries2.ShowLabels = true;
         barSeries3.ShowLabels = true;
     }
     rcView.View.Palette = KnownPalette.Cold;
     //rcView.ShowToolTip = true;
     this.rcView.Series.Add(barSeries);
     this.rcView.Series.Add(barSeries2);
     this.rcView.Series.Add(barSeries3);
     pbLeyenda.Image = global::SisOxi.WinUI.Properties.Resources.LeyendaSexo1;
 }
Esempio n. 2
0
 private void CargarFormularioChartPorSexo()
 {
     
     //conexionBD.Add(dataSource);
     //conexionBD.Add(initialCatalog);
     //conexionBD.Add(user);
     //conexionBD.Add(password);
     rcView.Series.Clear();
     //SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter da = new SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter();
     //SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable dt = new WinUI.SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable();
     //da.Connection.ConnectionString = cadenaConexion;
     //da.Fill(dt);
     //rcView.DataSource = dt;
     //BarSeries barSeries = new BarSeries("Paciente", "Enfermedad");
     //barSeries.DataMember = "Paciente";
     //barSeries.LegendTitle = "Paciente";
     //rcView.Series.Add(barSeries);
     //rcView.ShowLegend = true;
     rcView.Title = "      Grafico de Barras para la Frencuencia en Sexo de Todas las Enfermedades";
     rcView.ShowTitle = true;
     BarSeries barSeries = new BarSeries("Paciente", "nombre");
     barSeries.Name = "Q1";
    
     BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
     barSeries2.Name = "Q2";
     BarSeries barSeries3 = new BarSeries("Performance", "RepresentativeName");
     barSeries3.Name = "Q2";
     SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter da = new SisOxibariterapiaDataSetTableAdapters.spr_ReporteEnfermedadesPorSexoTableAdapter();
     SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable dt = new WinUI.SisOxibariterapiaDataSet.spr_ReporteEnfermedadesPorSexoDataTable();
     da.Connection.ConnectionString = cadenaConexion;
     da.Fill(dt);
     DataTable dx = new DataTable();
     dx.Columns.Add("nombre");
     dx.Columns.Add("Femenino");
     dx.Columns.Add("Masculino");
     foreach (DataRow dr in dt.Rows)
     {
         dx.Rows.Add(dr["nombre"].ToString(),dr["Femenino"].ToString(),dr["Masculino"].ToString());
         barSeries.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Paciente"].ToString()), dr["nombre"].ToString()));
         barSeries.ShowLabels = true;
         barSeries.LegendTitle = "Paciente";
         
         barSeries2.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Femenino"].ToString()), dr["nombre"].ToString()));
         barSeries3.DataPoints.Add(new CategoricalDataPoint(Convert.ToDouble(dr["Masculino"].ToString()), dr["nombre"].ToString()));
         barSeries2.LegendTitle = "Femenino";
         barSeries2.ShowLabels = true;
         barSeries3.ShowLabels = true;
         barSeries3.LegendTitle = "Masculino";
         
     }
     
     
     rcView.View.Palette = KnownPalette.Cold;
     //rcView.ShowToolTip = true;
     this.rcView.Series.Add(barSeries);
     this.rcView.Series.Add(barSeries2);
     this.rcView.Series.Add(barSeries3);
     
     this.rcView.ShowLegend = true;
     //this.rcView.Controllers.Add(new SmartLabelsController());
     this.rcView.ShowSmartLabels = true;
     this.rcView.LegendTitle = "Leyenda";
     this.rcView.ChartElement.LegendElement.TitleElement.Font = new Font(rcView.ChartElement.Font.FontFamily.Name, 18);
     foreach (LegendItemElement item in this.rcView.ChartElement.LegendElement.StackElement.Children)
     {
         item.Font = new Font(rcView.ChartElement.Font.FontFamily.Name, 14);
     }
     //this.rcView.ChartElement.LegendPosition = LegendPosition.Float;
     //this.rcView.ChartElement.LegendOffset = new Point(200, 0);
     //this.rcViewPastel.Series.Add(series);
     //pbLeyenda.Image = global::SisOxi.WinUI.Properties.Resources.LeyendaSexo1;
     dtPie = dx;
     CargarCboEnfermedad(dx);
     
     
 
 }