[Chartjs]-Multiple charts in one page โ€“ Chartjs

2๐Ÿ‘

โœ…

You are passing ctx as a parameter for chart2, which should be ctx2. Right now both of your graphs are pointing to same document element i.e. to element with id chart1.

const myChart2 = new Chart(ctx2, {
    type: 'line',
    data: data2,
    options: options2
})

Just do this

Leave a comment