json should 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 cannot figure out how to build json to display in this 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 they are quotes around numeric values, and jqPlot does not seem to like it. Unfortunately, if I try to do Int32.Parse (...) on it, I get an exception.
Any ideas how to do this best?
thanks