js/chart.js
// Draw the chart and set the chart values
Draw the chart and set the chart values
Draw the chart and set the chart values
function drawChart() {
        var data = google.visualization.arrayToDataTable([
        ['Pollution', 'Pollutants'],
        ['PM 1',38],
        ['PM 2.5',81],
        ['Pm 10',101],
        ['No2',6.51],
        ['CO2',12.6],
        ['CO',12.82],
        ['Humidity',32],
        ['Temp',45]
      ]);
        var options = {'title':'Pollution','width':600,'height':400};
        var chart = new google.visualization.ColumnChart(document.getElementById('piechart'));
        chart.draw(data, options);
      }
function drawChart ( ) { var data = google . visualization . arrayToDataTable ( [ [ 'Pollution' , 'Pollutants' ] , [ 'PM 1' , 38 ] , [ 'PM 2.5' , 81 ] , [ 'Pm 10' , 101 ] , [ 'No2' , 6.51 ] , [ 'CO2' , 12.6 ] , [ 'CO' , 12.82 ] , [ 'Humidity' , 32 ] , [ 'Temp' , 45 ] ] ) ; var options = { 'title' : 'Pollution' , 'width' : 600 , 'height' : 400 } ; var chart = new google . visualization . ColumnChart ( document . getElementById ( 'piechart' ) ) ; chart . draw ( data , options ) ; }
Draw the chart and set the chart values
Draw the chart and set the chart values
// Optional; add a title and set the width and height of the chart // Display the chart inside the <div> element with id="piechart"