簡體   English   中英

谷歌日歷圖表日期彈出(工具提示)問題

[英]Google calendar chart date popup(tool tip) issues

當光標放在日歷圖表上時,日期應該像第二個附加圖像一樣彈出(如工具提示),在我的代碼中它顯示為(參見圖中的第一個圖),我希望我的輸出如第二個圖所示。 請指導我解決此問題,下面是我的代碼。

    <script>  
      $.getScript("https://www.google.com/jsapi", function () {
          google.load('visualization', '1.1' , { 'callback':  calenderchart, 'packages': ['calendar'] });
      });

    function calenderchart(data) {

       var dataTable = new google.visualization.DataTable();
       dataTable.addColumn({ type: 'date', id: 'Date' });
       dataTable.addColumn({ type: 'number', id: 'Won/Loss' });
       dataTable.addRows([
          [ new Date(2012, 3, 13), 37032 ],
          [ new Date(2012, 3, 14), 38024 ],
          [ new Date(2012, 3, 15), 38024 ],
          [ new Date(2012, 3, 16), 38108 ],
          [ new Date(2012, 3, 17), 38229 ],
          // Many rows omitted for brevity.
          [ new Date(2013, 9, 4), 38177 ],
          [ new Date(2013, 9, 5), 38705 ],
          [ new Date(2013, 9, 12), 38210 ],
          [ new Date(2013, 9, 13), 38029 ],
          [ new Date(2013, 9, 19), 38823 ],
          [ new Date(2013, 9, 23), 38345 ],
          [ new Date(2013, 9, 24), 38436 ],
          [ new Date(2013, 9, 30), 38447 ]
        ]);
        var chart = new        google.visualization.Calendar(document.getElementById('calendar_basic'));
        var options = {
            title: "",
            tooltip: {isHtml: true}
        };
        chart.draw(dataTable, options);

    }
</script>
<body>
    <div id="calendar_basic" style="width: 1000px;"ng-init ='calanderchart()'></div>
</body>

在此輸入圖像描述

在此輸入圖像描述

似乎在這里工作正常,你可以分享更多嗎?

你網頁上的任何CSS?

 google.load('visualization', '1.1', { callback: function () { var dataTable = new google.visualization.DataTable(); dataTable.addColumn({ type: 'date', id: 'Date' }); dataTable.addColumn({ type: 'number', id: 'Won/Loss' }); dataTable.addRows([ [ new Date(2012, 3, 13), 37032 ], [ new Date(2012, 3, 14), 38024 ], [ new Date(2012, 3, 15), 38024 ], [ new Date(2012, 3, 16), 38108 ], [ new Date(2012, 3, 17), 38229 ], [ new Date(2013, 9, 4), 38177 ], [ new Date(2013, 9, 5), 38705 ], [ new Date(2013, 9, 12), 38210 ], [ new Date(2013, 9, 13), 38029 ], [ new Date(2013, 9, 19), 38823 ], [ new Date(2013, 9, 23), 38345 ], [ new Date(2013, 9, 24), 38436 ], [ new Date(2013, 9, 30), 38447 ] ]); var chart = new google.visualization.Calendar(document.getElementById('calendar_basic')); chart.draw(dataTable, { tooltip: {isHtml: true} }); }, packages: ['calendar'] }); 
 <script src="https://www.google.com/jsapi"></script> <div id="calendar_basic" style="width: 1000px;"></div> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM