Chartjs-How to get line x value from Label chart js

0👍

Check creating new chart https://www.chartjs.org/docs/latest/developers/charts.html, you are missing options, structure should look like:

    new Chart(ctx, {
        type: 'MyType',
        data: data,
        options: options
    });

Next thing is that labels what you send to chart should be in array, you can’t write like labels: something it should be labels: [something], because it’s trying to map array with labels and you don’t have array, then it reproduces error.

Leave a comment