public void SetDefault(bool bIsCreateConfigFile) { this.chart = new chart() { type = "column" }; this.title = new title() { text = "" }; this.subtitle = new subtitle() { text = "" }; this.xAxis = new xAxis() { categories = new List <string>(), crosshair = true }; this.yAxis = new yAxis() { min = 0, title = new title() { text = "" } }; this.tooltip = new tooltip() { headerFormat = @"<span style='font - size:10px'>{point.key}</span><table>", pointFormat = "<tr><td style='color:{series.color};padding:0'>{series.name}: </td><td style='padding:0'><b>{point.y:,.2f}</b></td></tr>", footerFormat = "</table>", shared = true, useHTML = true }; this.plotOptions = new plotOptions() { column = new column() { animation = true, pointPadding = 0.1f, borderWidth = 0 }, line = new line() { animation = true, marker = new marker() { enabled = false, symbol = "circle", radius = 2 } }, spline = new spline() { animation = true, marker = new marker() { enabled = false, symbol = "circle", radius = 2 } } }; this.series = new List <series>() { //new series() { name = "Tokyo", data = new List<float?>() { 49.9f, 71.5f, 106.4f, 129.2f, 144.0f, 176.0f, 135.6f, 148.5f, 216.4f, 194.1f, 95.6f, 54.4f } }, //new series() { name = "New York", data = new List<float?>() { 83.6f, 78.8f, 98.5f, 93.4f, 106.0f, 84.5f, 105.0f, 104.3f, 91.2f, 83.5f, 106.6f, 92.3f } }, //new series() { name = "London", data = new List<float?>() { 48.9f, 38.8f, 39.3f, 41.4f, 47.0f, 48.3f, 59.0f, 59.6f, 52.4f, 65.2f, 59.3f, 51.2f } }, //new series() { name = "Berlin", data = new List<float?>() { 42.4f, 33.2f, 34.5f, 39.7f, 52.6f, 75.5f, 57.4f, 60.4f, 47.6f, 39.1f, 46.8f, 51.1f } } }; this.credits = new credits() { enabled = false }; this.exporting = new exporting() { enabled = true }; // hightcharts-ng need this //this.options = new options() //{ // chart = this.chart, // plotOptions = this.plotOptions, // tooltip = this.tooltip //}; if (bIsCreateConfigFile) { CreateConfigFile("ColumnCharts.xml"); } }
public void SetDefault(bool bIsCreateConfigFile) { this.chart = new chart() { type = "pie" }; this.title = new title() { text = "" }; this.subtitle = new subtitle() { text = "" }; this.tooltip = new tooltip() { pointFormat = "{series.name}: <b>{point.percentage:.2f}%</b>" }; this.plotOptions = new plotOptions() { pie = new pie() { animation = true, allowPointSelect = true, cursor = "pointer", dataLabels = new dataLabels() { enabled = true, format = "<b>{point.name}</b>: {point.percentage:.2f} %" } } }; this.exporting = new exporting() { enabled = true }; this.series = new List <series>() { //new Charts.PieCharts.series() { name = "Brands", colorByPoint = true, data = new List<dataItem>() // { // new dataItem() { name = "Microsoft Internet Explorer", y = 56.33f }, // new dataItem() { name = "Chrome", y = 24.03f }, // new dataItem() { name = "Firefox", y = 10.38f }, // new dataItem() { name = "Safari", y = 4.77f }, // new dataItem() { name = "Opera", y = 0.91f } // } //} }; this.credits = new credits() { enabled = false }; // hightcharts-ng need this //this.options = new options() //{ // chart = this.chart, // plotOptions = this.plotOptions, // tooltip = this.tooltip //}; //var chart = new chart(); //chart.type = "pie"; //chart.plotShadow = false; //var options3d = new options3d(); //options3d.enabled = true; //options3d.alpha = 45; //options3d.beta = 0; //chart.options3d = options3d; //this.chart = chart; //var title = new title(); //title.text = ""; //var style = new style(); //style.fontSize = "14px"; //style.color = "#000000"; //title.style = style; //this.title = title; //var tooltip = new tooltip(); //tooltip.pointFormat = "{series.name}: <b>{point.percentage:.1f}%</b>"; //this.tooltip = tooltip; //var plotOptions = new plotOptions(); //var pie = new pie(); //pie.animation = false; //pie.allowPointSelect = true; //pie.cursor = "pointer"; //pie.depth = 35; //var dataLabels = new dataLabels(); //dataLabels.enabled = true; //dataLabels.format = "<b>{point.name}</b>: {point.percentage:.1f} %"; //style = new style(); //style.color = "black"; //dataLabels.style = style; //pie.dataLabels = dataLabels; //plotOptions.pie = pie; //this.plotOptions = plotOptions; //var listSeries = new List<series>(); //var series = new series(); //series.name = "Total Energy"; //series.colorByPoint = true; //listSeries.Add(series); //this.series = listSeries; //var credits = new credits(); //credits.enabled = false; //this.credits = credits; if (bIsCreateConfigFile) { CreateConfigFile("PieCharts.xml"); } }