Create dynamic JSON from foreach
问题 I'm using jquery flot charts to represent my data. Here's the example JSFiddle I made that shows how the JSONS's required for the chart should look. The data source is from a MySql stored procedure that has the below output example: I need to represent in the chart, the count values stacked for different innumber 's on y-axis, the name values on x-axis, and in another chart, the values for outnumber . (in stacked bars). -The data series should match, so the specific labels should appear