JSON Serializer Error

May 23, 2013 at 6:21 PM
Hi,

I need help with the Highcharts implementation. I keep on getting JSON serializer error whenever i try to set a tooltip for a basic line chart. Here is my code [which i took from your home page]:
protected void Page_Load(object sender, EventArgs e)
        {
            
             

                DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts("chart")
           .SetXAxis(new XAxis
           {
               Categories = new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }
           })
           .SetSeries(new Series
           {
               Data = new Data(new object[] { 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4 })
           }).SetTooltip(new Tooltip() { Shared=true, Crosshairs = new Crosshairs(true, true), Enabled = true });

                ltrChart.Text = chart.ToHtmlString();

            
        }
Here is the stack trace:
[NotImplementedException: Not implemented serialization array of type: System.Boolean[]]
   DotNet.Highcharts.JsonSerializer.GetJsonArray(Array obj, Boolean useCurlyBracketsForObject) in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\JsonSerializer.cs:71
   DotNet.Highcharts.JsonSerializer.GetJsonObject(Object obj, Boolean appendCurlyBrackets) in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\JsonSerializer.cs:100
   DotNet.Highcharts.JsonSerializer.GetValue(Object value, Type type, JsonFormatter formatter) in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\JsonSerializer.cs:136
   DotNet.Highcharts.JsonSerializer.GetJsonObject(Object obj, Boolean appendCurlyBrackets) in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\JsonSerializer.cs:104
   DotNet.Highcharts.JsonSerializer.Serialize(T obj, Boolean appendCurlyBrackets) in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\JsonSerializer.cs:34
   DotNet.Highcharts.JsonSerializer.Serialize(T obj) in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\JsonSerializer.cs:27
   DotNet.Highcharts.Highcharts.GetOptions() in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\Highcharts.cs:353
   DotNet.Highcharts.Extensions.AppendHighchart(StringBuilder sb, Highcharts chart) in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\Extensions.cs:66
   DotNet.Highcharts.Highcharts.ToHtmlString() in C:\Users\VanKol00\Dropbox\Projects\Mvc.Html.Chart\DotNet.Highcharts\Highcharts.cs:293
Can you point out anything wrong that i might have done in the implementation? Thanks.
Coordinator
May 26, 2013 at 10:23 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.