I am creating a bar chart using chart.js however the values i want in the bar chart is a php array, one array for the values and one array for the labels. How do i add these arays to the bar chart. Currently I have this for the data for the bar chart:
ar barData = {
labels : ["January","February","March","April","May","June"],
datasets : [
{
fillColor : "#48A497",
strokeColor : "#48A4D1",
data : [456,479,324,569,702,600]
}
]
}
I tried to do the following, but it still did not work:
<script type="text/javascript">
var chartLabels= <?php echo $chartLabels; ?>
var chartValues= <?php echo $chartValues; ?>
</script>
I would like to replace the 'labels' with a php array, as well as the 'data'