COVID-19 : Build Basic Chart with HTML5 and ChartJS

Animate with ChartJS
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js"></script>
<div class="container"><canvas id="myChart"></canvas></div><script>let myChart = document.getElementById('myChart').getContext('2d')let masspopChart = new Chart(myChart,{type:'bar', //bar,horizontal,pie,line,polar area data:{labels:['Washington','New Jersey','Louisiana','Michigan','California','Georgia','Illinois','Florida','Massachusetts','Colorado','Pennsylvania','Texas','Connecticut','Indiana','Ohio','Virginia','Wisconsin','Arizona','Oklahoma','South Carolina','Nevada','Mississippi','Missouri'], //names of the statesdatasets:[{label:'Death', //name of the data//The Data in array corresponds to each statesdata:[965,198,161,151,132,124,80,66,56,48,47,41,37,34,32,29,20,18,17,16,16,15,14,13],backgroundColor:'red' //background colour of the chart}]}})</script>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nirvik Basnet

Nirvik Basnet

Software Engineer• AI/ML• Mobile & Web Developer