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', 'Total', 'Daily'],
+
           ['Day', 'Cumulative', 'Daily'],
[10, 1, 1],
+
// Day 1 = March 10, 2020
[11, 1, 0],
+
[1, 1, 1],
[12, 5, 4],
+
[2, 1, 0],
[13, 5, 0],
+
[3, 5, 4],
[14, 6, 1],
+
[4, 5, 0],
[15, 18, 12],
+
[5, 6, 1],
[16, 47, 29],
+
[6, 18, 12],
[17, 98, 51],
+
[7, 47, 29],
[18, 192, 94],
+
[8, 98, 51],
[19, 359, 167],
+
[9, 192, 94],
[20, 670, 311],
+
[10, 359, 167],
[21, 947, 277],
+
[11, 670, 311],
[22, 1236, 289],
+
[12, 947, 277],
[23, 1529, 293],
+
[13, 1236, 289],
[24, 1872, 343],
+
[14, 1529, 293],
[25, 2433, 561],
+
[15, 1872, 343],
[26, 3629, 1196],
+
[16, 2433, 561],
[27, 5698, 2069],
+
[17, 3629, 1196],
[28, 7402, 1704]
+
[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'));

Revision as of 10:06, 29 March 2020