Different Colors For Each Column

Apr 22, 2014 at 10:57 PM
I know this is possible in Highchart, but I havent found a way to do it in dotnet highchart. This is exactly what I am looking to do http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/series/data-array-of-objects/ I can't figure out the correct syntax.
Coordinator
Apr 23, 2014 at 8:02 AM
Hi justinal64,

Here is the correct syntax to construct the same chart as in the example:
            Highcharts testChart = new Highcharts("testChart")
                .InitChart(new Chart { Type = ChartTypes.Column })
                .SetXAxis(new XAxis { Categories = new[] { "Green", "Pink" } })
                .SetSeries(new Series
                {
                    Data = new Data(new[]
                    {
                        new Point { Name = "Point 1", Y = 1, Color = ColorTranslator.FromHtml("#00FF00") },
                        new Point { Name = "Point 2", Y = 5, Color = ColorTranslator.FromHtml("#FF00FF") }
                    })
                });
Is this what you are looking for?

Regards,
Vangi
Marked as answer by Vangi on 4/23/2014 at 6:19 AM
Apr 23, 2014 at 2:18 PM
That was exactly what I was looking for. Thank you very much.