For info. on how to obtain the latest Chart.js, please refer to the link below.
http://stackoverflow.com/documentation/chart.js/4274/getting-started-with-chart-js#t=201703251048525532779
Bar Chart Sample Code
Note, the code below uses the CDN version of Chart.js.
1 | <!DOCTYPE html> |
Result
Note that the size of the chart is beyond the width and height specified in <canvas id="myChart" width="400" height="250"></canvas>. The solution is to add responsive: false in the option field (see below pic).
Result
The chart is now responding to the width and height parameters.
--------------------------------------------------------------------------------------------------------------------------
Below is another example.
Code
1 | <!DOCTYPE html> |
Result
References:
Chart.js
Creating Beautiful Charts with Chart.js
https://www.sitepoint.com/creating-beautiful-charts-chart-js/
An Introduction to Chart.js 2.0 — Six Simple Examples
https://www.sitepoint.com/introduction-chart-js-2-0-six-examples/
Getting started with chart.js
http://stackoverflow.com/documentation/chart.js/4274/getting-started-with-chart-js#t=201703251048525532779
CDNJS Version of Chart.js
https://cdnjs.com/libraries/Chart.js
c3.js
How to Create Website Graphs from CSV Files with c3.js and PapaParse
https://youtu.be/1OK4TJfCzdY
