[英]how to customize Google Chart calendar?
我想在Google圖表(日歷圖表)中添加評論。
但是,我不了解Google圖表的選項和使用方法。
當我添加addcolumn時,此工作不能。
請給我一些幫助。
<<<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
您是否要讓評論顯示在工具提示中? 您想如何查看呈現的評論信息?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.