1👍
I have it working now, just need to find a way to format the date without using numeric format. I think the reason it wasnt working at first is cause i was using an outdated version of chart.js.
var data = <?php print_r(json_encode($data)) ?> ;
var dates = [];
var vote = [];
for (var i in data) {
dates.push(data[i].timestamp);
vote.push(data[i].count);
}
var data = {
labels: dates,
type: "line",
datasets: [{
backgroundColor: '#585b72d9',
data: vote,
}],
};
var myBarChart = Chart.Line("examChart", {
data: data,
});
- [Chartjs]-How to have hover effect on the entire line in line chart in chart js
- [Chartjs]-How to display chart using Chartjs with JSON data in Laravel
Source:stackexchange.com