Json From .net Wcf To Javascript Array Of Arrays
I'm using jqPlot and I need to turn this JSON which I receive from a WCF service: [{ 'x': 2, 'y': 3 }, { 'x': 25, 'y': 34 }] into this array or arrays: [[2,3],[25,34]] I've tried
Solution 1:
You can use $.map() to do that:
var data = [{ "x": 2, "y": 3 }, { "x": 25, "y": 34 }]
var flattenedResult = $.map(data, function(point) {
return[[ point.x, point.y ]];
});
Post a Comment for "Json From .net Wcf To Javascript Array Of Arrays"