Why is my Line Chart not displaying (Chart.JS)?

2👍

The syntax to define a chart has changed a bit in version 2. Fiddle.

var forecastImpactLineChart = Chart.Line(ctxLineChart, {
    data: lineChartData
});

OR

var forecastImpactLineChart = new Chart(ctx, {
    type: 'line',
    data: lineChartData,
    options: options
});

👍:1

typo in the code (missing the “w” from new):

 var forecastImpactLineChart = new Chart(ctxLineChart).Line(lineChartData);

Leave a comment