[Chartjs]-Chartjs undefined length when using 2 datasets

2👍

After checking your code and comparing with one that worked (taken from this site) the problem became apparent.

First: your labels’ property doesn’t match – in length – with the data’s. That might explain the length problem you mentioned.

Second, you have to move the labels property into the data object.

data: {
    labels: ["1", "2", "3", "4", "5", "6", "7"],
    ...

Check this working example based on your code.

Hope it helps.

2👍

It seems you need the X-axis labels in your main data:

    data: {
       labels : ["January", "February", "March", "April", "May", "June", "July"],
       datasets: [

DEMO

Leave a comment