0👍
Your data is in the wrong format, you are pushing it into an array, but it needs to be comma separated values:
data: 20, 5, 34, etc ....
So in this part of your code:
var rating = [];
for(var i in data) {
rating.push(data[i].ratingid);
variety.push(data[i].variety);
...
}
It should be:
var rating; // set to string, not array
rating = rating + data[i].ratingid + ',';
Or if it’s a string:
rating = rating + "'" + data[i].ratingid + "',";
Hope that helps.
Source:stackexchange.com