I am getting below result through ajax and the data which I get in ajax success is
[{
"plants_ref_id": "1",
"plant_name": "MCW",
"employees_data": "6,6,80,70,60,30,2,3,12,12,37.00,60.00,64666.666667,8000.0000"
},{
"plants_ref_id": "3",
"plant_name": "SJCPL",
"employees_data": "4,5,6,7,7,7,6,4,4,5,20.00,3.00,176923.076923,38461.5385"
}]
I am trying to convert this data to format
[{
name: 'MCW',
data: [6,6,80,70,60,30,2,3,12,12,37.00,60.00,64666.666667,8000.0000
]},{
name: 'SJCPL',
data: [4,5,6,7,7,7,6,4,4,5,20.00,3.00,176923.076923,38461.5385]
}]
I am trying to convert to this format for generating highcharts as https://jsfiddle.net/mcj075jf/
How do I convert to the above format in jQuery using for loop or $.each. Please help.