谷歌图表添加选项的图表


Google Charts adding options to the charts

我使用这个代码创建图表,它的工作原理,但我需要添加的选项,只是不知道在哪里添加它们。

<script type="text/javascript">
    function drawVisualizationHourlyChart() {
        var data = google.visualization.arrayToDataTable([ // Create and populate the data table.
            ['Date - Hour:Minute', 'Cares', 'Bikes', 'Both'],
            <?php
            while( $row = $result->fetch_assoc() ){
                extract($row);
                echo "['Date: ($dateandtime) - {$hour}:{$minute}', {$cars}, {$bikes}, {$both}],";
            }
            ?>
        ]);
            new google.visualization.LineChart(document.getElementById('mydiv')).   // Create and draw the visualization.
            draw(data, {legend: 'bottom', title:"titles here"});
    }
    google.setOnLoadCallback(drawVisualizationHourlyChart);
</script>

我要做的是把下面所有的代码添加到上面的代码中。

 var options = {  
   //options go here
});

我在哪里添加选项?

选项是绘制方法的第二个参数。

var options = {
  legend: 'bottom',
  title:"titles here"
  };
chart.draw(data, options);