Chartjs-Chart.js – Multiple Line Charts – [2]

2👍

lineChartData variable seems duplicated I think you need to name lineChartData2 the second one or whatever you want.

Check this statements:

window.myLine = new Chart(ctx).Line(lineChartData ...
window.myLine = new Chart(ctx2).Line(lineChartData2 ...

Your vars declaration in each script is:

var lineChartData = {...}
var lineChartData = {...}

Two times! So second declaration override the oldest one. You need two data sets and they must match the names of the chart.js init code.

Leave a comment