I need to get an array to display the following way:
var categories = data.categories;
for(a = 0; a < data.count; a++){
var names[a] = data.name[a];
var values[a] = data.value[a];
}
There will be one "Categories" array, for example "May 2017","June 2017","July 2017","August 2017","September 2017". Then there may be 3/4 arrays containing "Name" and "Values" and I want these to loop through a loop to loop and assign these to variables.
At the moment I'm getting 'Undefined" in all variables.
My output in php is currently:
[
[{
"name": "Leads",
"data": [524, 419, 502, 598, 873],
"color": "#00afef"
}, {
"name": "Purchases",
"data": [37, 18, 32, 36, 44],
"color": "#f00"
}], {
"categories": ["May 2017", "June 2017", "July 2017", "August 2017", "September 2017"]
}
]