Ejemplo n.º 1
0
        /// <summary>
        /// Returns a bar chart for a given set of values.
        /// </summary>
        /// <param name="seriesSet"></param>
        /// <param name="xValues"></param>
        /// <param name="title"></param>
        /// <returns></returns>
        public static DotNet.Highcharts.Highcharts GetBarChart(List <DotNet.Highcharts.Options.Series> seriesSet, List <string> xValues, string title)
        {
            DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts(title);
            chart.InitChart(new Chart
            {
                Height            = 320,
                Width             = 320,
                DefaultSeriesType = ChartTypes.Column
            });

            chart.SetXAxis(new XAxis
            {
                Categories = xValues.ToArray()
            });

            chart.SetLegend(new Legend {
                Enabled = false
            });
            chart.SetSeries(seriesSet.ToArray());

            chart.SetTitle(new DotNet.Highcharts.Options.Title {
                Text = title.Replace("_", " ")
            });

            return(chart);
        }
        /// <summary>
        /// Returns a bar chart for a given set of values.
        /// </summary>
        /// <param name="seriesSet"></param>
        /// <param name="xValues"></param>
        /// <param name="title"></param>
        /// <returns></returns>
        public static DotNet.Highcharts.Highcharts GetBarChart(List<DotNet.Highcharts.Options.Series> seriesSet, List<string> xValues, string title)
        {
            DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts(title);
            chart.InitChart(new Chart
            {
                Height = 320,
                Width = 320,
                DefaultSeriesType = ChartTypes.Column
            });

            chart.SetXAxis(new XAxis
            {
                Categories = xValues.ToArray()

            });

            chart.SetLegend(new Legend { Enabled = false });
            chart.SetSeries(seriesSet.ToArray());

            chart.SetTitle(new DotNet.Highcharts.Options.Title { Text = title.Replace("_", " ")});
            
            return chart;
        }