I have a nice JavaScript Pie chart that populates with set variable:
var chartData = [{
company: "Company #1",
value: 260
}, {
company: "Company #2",
value: 201
}, {
company: "Company #3",
value: 65
}, {
company: "Company #4",
value: 39
}, {
company: "Company #5",
value: 19
}, {
company: "Company #6",
value: 190
}, {
company: "Company #7",
value: 54
}, {
company: "Company #8",
value: 74
}, {
company: "Company #9",
value: 98
}, {
company: "Company #10",
value: 138
}];
What I am trying to achieve is for the names of the company to be pulled from my MySQL database table [companies] and the values to be pulled from the same table with row [sales].
I have way more than 10 companies I do business with, but only want to chart the top 10.
Is this possible?