[Chartjs]-Chart.js date formatting use for

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,
});

Leave a comment