Requirement Bar chart from MySql data , i have working code for static bar chart the code as follows -->
<script>
var data = [
[0, 11], //London, UK
[1, 15], //New York, USA
[2, 25], //New Delhi, India
[3, 24], //Taipei, Taiwan
[4, 13], //Beijing, China
[5, 18] //Sydney, AU
];
var dataset = [
{ label: "barchart", data: data, color: "#5482FF" }
];
var ticks = [
[0, "London"],
[1, "New Mumbai"],
[2, "New Delhi"],
[3, "Taipei"],
[4, "Beijing"],
[5, "Sydney"]
];
<script>
but for dynamic bar chart data is coming from database and data is in also array format as follows
Array
(
[0] => Array
(
[product] => abc
[total] => 21
)
[1] => Array
(
[product] => xyz
[total] => 1
)
[2] => Array
(
[product] => pqr
[total] => 13
)
)
how to create bar chart from this data ? or any suggestion?