Difference between revisions of "Web Element: Data"
Line 11: | Line 11: | ||
// Some raw data (not necessarily accurate) | // Some raw data (not necessarily accurate) | ||
var data = google.visualization.arrayToDataTable([ | var data = google.visualization.arrayToDataTable([ | ||
− | ['Day', ' | + | ['Day', 'Cumulative', 'Daily'], |
− | [ | + | // Day 1 = March 10, 2020 |
− | [ | + | [1, 1, 1], |
− | [ | + | [2, 1, 0], |
− | [ | + | [3, 5, 4], |
− | [ | + | [4, 5, 0], |
− | [ | + | [5, 6, 1], |
− | [ | + | [6, 18, 12], |
− | [ | + | [7, 47, 29], |
− | [ | + | [8, 98, 51], |
− | [ | + | [9, 192, 94], |
− | [ | + | [10, 359, 167], |
− | [ | + | [11, 670, 311], |
− | [ | + | [12, 947, 277], |
− | [ | + | [13, 1236, 289], |
− | [ | + | [14, 1529, 293], |
− | [ | + | [15, 1872, 343], |
− | [ | + | [16, 2433, 561], |
− | [ | + | [17, 3629, 1196], |
− | [ | + | [18, 5698, 2069], |
+ | [19, 7402, 1704] | ||
]); | ]); | ||
+ | // Set chart options | ||
var options = { | var options = { | ||
title : 'COVID-19 Cases in Turkey', | title : 'COVID-19 Cases in Turkey', | ||
− | vAxis: {title: 'Cases'}, | + | vAxis: {title: 'Cases', maxValue: '20000'}, |
hAxis: {title: 'Day'}, | hAxis: {title: 'Day'}, | ||
seriesType: 'bars', | seriesType: 'bars', | ||
− | series: {0: {type: 'line'}} | + | series:{ |
+ | 0: {type: 'line', color: '#982F00'}, | ||
+ | 1: {type: 'bars', color: 'red'},}, | ||
+ | 'width':600, | ||
+ | 'height':400, | ||
+ | }; | ||
var chart = new google.visualization.ComboChart(document.getElementById('chart_div')); | var chart = new google.visualization.ComboChart(document.getElementById('chart_div')); |
hkilter.com by H. K. Ilter is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
© 2020 H. K. Ilter