Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult GraficoTecnicos()
- {
- var objData = getDataGrafico1();
- int i = 0;
- string[] categorias = new string[objData.Count];
- object[] data = new object[objData.Count];
- foreach (ZonaGraficos item in objData)
- {
- categorias[i] = item.zona;
- data[i] = item.total;
- i++;
- };
- Highcharts columnChart = new Highcharts("piechart");
- columnChart.InitChart(new Chart()
- {
- Type = ChartTypes.Column,
- BackgroundColor = new BackColorOrGradient(Color.WhiteSmoke),
- Style = "fontWeight: 'bold', fontSize: '17px'",
- BorderColor = Color.LightBlue,
- BorderRadius = 0,
- BorderWidth = 2
- });
- columnChart.SetTitle(new Title()
- {
- Text = "Desempeño"
- });
- columnChart.SetSubtitle(new Subtitle()
- {
- Text = "Incidencias por Zonas en el período"
- });
- columnChart.SetXAxis(new XAxis()
- {
- Type = AxisTypes.Category,
- Title = new XAxisTitle() { Text = "Zonas", Style = "fontWeight: 'bold', fontSize: '17px'" },
- Categories = categorias
- //Categories = new[] { "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012" }
- });
- columnChart.SetYAxis(new YAxis()
- {
- Title = new YAxisTitle()
- {
- Text = "Incidencias",
- Style = "fontWeight: 'bold', fontSize: '17px'"
- },
- ShowFirstLabel = true,
- ShowLastLabel = true,
- Min = 0
- });
- columnChart.SetLegend(new Legend
- {
- Enabled = true,
- BorderColor = Color.CornflowerBlue,
- BorderRadius = 6,
- BackgroundColor = new BackColorOrGradient(ColorTranslator.FromHtml("#FFADD8E6"))
- });
- Data _data = new Data(data);
- Color[] _color = { Color.AntiqueWhite, Color.Black, Color.Blue, Color.DarkBlue, Color.DarkGray };
- PlotOptionsSeries _ploos = new PlotOptionsSeries();
- columnChart.SetSeries(new Series[]
- {new Series{Color = Color.BlueViolet,Name = "Incidencias",Data = _data}});
- return View(columnChart);
- }
Add Comment
Please, Sign In to add comment