Building on what @RamizWachtler has answered, you can add to the options section of the chart to scale the times out properly. I'll note that this doesn't seem to work with Charts.js 2.3. Added a working snippet that uses the latest Charts.js version as of April 2019. Additionally I've changed the time formatting to be ISO8601 compliant. With Chart.js, it is possible to create mixed charts that are a combination of two or more different chart types. A common example is a bar chart that also includes a line dataset. Creating a mixed chart starts with the initialization of a basic chart. var myChart = new Chart(ctx, { type: 'bar', data: data, options: options }); At this point we have a standard bar chart. Now we need to convert one of the datasets to a line dataset. And then we add 'line', and that tells Chart.js that this is a line chart that we're creating. And then we'll type a comma, and go down to the next line. And then the next thing we need is all the data that's going to go into that chart. So we'll type in the word data. And then this data property is going to be an object. .chart-container { width: 80%; height: 480px; margin: 0 auto; } In the above code we are targeting class .chart-container and setting its width, height and margin. Feel free to define your own style. I will always encourage you to experiment with the code and try it yourself. JavaScript. Now its time to create the line graph. Canvas
19 Jan 2020 Chart.js is a cool open source JavaScript library that helps you render HTML5 charts. I'm going to use the same example I used for the tutorial How to charts is to transform the data so it can fit in a bar chart / line chart / etc.
7 Oct 2017 index.html#.
< title>Line Chart Test