[Chartjs]-Chart.js t.ticks.map is not a function

9👍

The labels requires a array variable but the var lbls = $('#lbls').html() returns a string so splitting it with ‘,’ will do the job

var myChart = new Chart(ctx, {
type: 'line',
data: {
    labels: lbls.split(','),
    datasets: [{
        label: '# of Votes',
        data:  [20, 10]
    }]
}
});

Leave a comment