Chartjs-HereChartJS Line Chart with Time Axis

1👍

Tthe syntax is different if you are using Chart.js v1 or v2.

You imported the v1.02 library using <script src="http://www.chartjs.org/assets/Chart.js"></script>.

But you actually used the v2 syntax :

var myChart = new Chart(ctx, {
    type: 'line',
    data: data_live,
    options: live_options
});

You can fix this by importing the right library (which is the v2) :

<!-- The following is the latest version of Chart.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.min.js"></script>

Leave a comment