Difference between revisions of "Web Element: Data"
Line 5: | Line 5: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
− | google.charts.load('current', {packages: ['corechart | + | google.charts.load('current', {'packages':['corechart']}); |
− | google.charts.setOnLoadCallback( | + | google.charts.setOnLoadCallback(drawVisualization); |
− | function | + | function drawVisualization() { |
− | + | // Some raw data (not necessarily accurate) | |
− | + | var data = google.visualization.arrayToDataTable([ | |
− | + | ['Day', 'Total', 'Daily'], | |
+ | [10, 1, 1], | ||
+ | [11, 1, 0], | ||
+ | [12, 5, 4], | ||
+ | [13, 5, 0], | ||
+ | [14, 6, 1], | ||
+ | [15, 18, 12], | ||
+ | [16, 47, 29], | ||
+ | [17, 98, 51], | ||
+ | [18, 192, 94], | ||
+ | [19, 359, 167], | ||
+ | [20, 670, 311], | ||
+ | [21, 947, 277], | ||
+ | [22, 1236, 289], | ||
+ | [23, 1529, 293], | ||
+ | [24, 1872, 343], | ||
+ | [25, 2433, 561], | ||
+ | [26, 3629, 1196], | ||
+ | [27, 5698, 2069], | ||
+ | [28, 7402, 1704] | ||
+ | ]); | ||
− | + | var options = { | |
− | + | title : 'Daily COVID-19 Cases (Turkey)', | |
− | + | vAxis: {title: 'Cases'}, | |
+ | hAxis: {title: 'Day'}, | ||
+ | seriesType: 'bars', | ||
+ | series: {1: {type: 'line'}} }; | ||
− | + | var chart = new google.visualization.ComboChart(document.getElementById('chart_div')); | |
− | + | chart.draw(data, options); | |
− | + | } | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</script> | </script> | ||
</head> | </head> |
hkilter.com by H. K. Ilter is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
© 2020 H. K. Ilter