[Chartjs]-Multiple Chart.js charts on a single page, from 1 function but different data

1👍

As you said you would to have differents data, you can say

const data1 = {
labels: labels,
datasets: [{
    data: chartDataValues,
    backgroundColor: [
        'rgba(17, 39, 61, 1)',
        'rgba(2, 113, 184, 1)',
        'rgba(196, 226, 247, 1)',
        'rgba(0, 159, 227, 1)',
        'rgba(0, 130, 180, 1)',
        'rgba(234, 236, 236, 1)'
    ]
}]

};

and

const data2 = {
    labels: labels,
    datasets: [];

Then what you need is to make two config. Config1 and Config2.
With data: data1 for Config1, and data: data2 for config2.

Leave a comment