2016-04-25 90 views
0

我想在Google圖表(日曆圖表)中添加評論。如何自定義Google圖表日曆?

但是,我不明白谷歌圖表的選項和如何使用。

當我添加addcolumn,這項工作不能。

請給我一些幫助..

enter image description here

<<<source code>>>> 
<html> 
    <head> 
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 
    <script type="text/javascript"> 
     google.charts.load("current", {packages:["calendar"]}); 
     google.charts.setOnLoadCallback(drawChart); 

    function drawChart() { 
     var dataTable = new google.visualization.DataTable(); 

     dataTable.addColumn({ type: 'date', id: 'Date' }); 
     dataTable.addColumn({ type: 'number', id: 'Won/Loss' }); 
     // dataTable.addColumn({ type: 'string', id:'comment'}); // Error 
     dataTable.addRows([ 

      [ new Date(2015, 3, 11), 4], // I want to add comment 
      [ new Date(2015, 3, 12), 3], 
      [ new Date(2015, 3, 10), 8], 
      [ new Date(2015, 1, 13), 5], 
      [ new Date(2015, 3, 14), 7] 

      ]); 

     var chart = new google.visualization.Calendar(document.getElementById('calendar_basic')); 

     var options = { 
     title: "Red Sox Attendance", 
     height: 1050, 
     }; 

     chart.draw(dataTable, options); 
    } 
    </script> 
    </head> 
    <body> 
    <div id="calendar_basic" style="width: 1000px; height: 350px;"></div> 
    </body> 
</html> 

    enter code here 

回答

0

你試圖讓您的評論出現在工具提示?您希望如何看到呈現的評論信息?