I have set up the following code to get array data[]; but I don't know how to put those array in chart.js line code
$data[] = array(substr($row['CHANGE_DATE'], 5), $lastMax, $lastMin);
I want to draw a line chat with X-axis as CHANGE_DATE, Y-axis: $lastMax, $lastMin
Chart.js code
<script>
// line chart data
var buyerData = {
labels : ["January","February","March","April","May","June"],
datasets : [
{
fillColor : "rgba(172,194,132,0.4)",
strokeColor : "#ACC26D",
pointColor : "#fff",
pointStrokeColor : "#9DB86D",
data : [203,156,99,251,305,247]
}
]
}
// get line chart canvas
var buyers = document.getElementById('buyers').getContext('2d');
// draw line chart
new Chart(buyers).Line(buyerData);
jscode has 6 points set for data, and your php array appears to have the first value as a date, and the second 2 values as data points. you have 6 labels, which implies 6 different data sets. So I really have no idea what you are trying plot. Without any code, can you describe the chart you are trying to create?