The json needs to be in this format:
var data = [
['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14],
['Out of home', 16],['Commuting', 7], ['Orientation', 9]
];
But in my action method I can't figure out how to construct the json to be rendered in that format. Here is what I have:
var json = new[] {
new[] {"Pending", summaryData.Sum(a => (int)a.Pending).ToString() },
new[] {"Completed", summaryData.Sum(a => (int)a.Completed).ToString()}
};
return Json(json, JsonRequestBehavior.AllowGet);
Which returns the following JSON:
[["Pending","146"],["Completed","914"]]
This is close except that their are quotes around the numeric values and jqPlot doesn't seem to like it. Unfortunately if I try to do a Int32.Parse(...) on it I get an exception.
Any ideas how to best do this?
Thanks