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
Source:stackexchange.com