0
我正在使用this插件(Github),它使用Google Charts(繪製PieChart)。我想使用Google的API中的select事件和getSelection()方法。例如,當用戶點擊它時,提醒元素的ID。如何使它發生?gvChart(Google Chart)jquery插件。如何調用事件函數
Google's documentation on the plugin.
我正在使用this插件(Github),它使用Google Charts(繪製PieChart)。我想使用Google的API中的select事件和getSelection()方法。例如,當用戶點擊它時,提醒元素的ID。如何使它發生?gvChart(Google Chart)jquery插件。如何調用事件函數
Google's documentation on the plugin.
對不起,夥計們),我不需要插件了。使用Google的代碼而不是使用該jQuery插件要容易得多。
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities'
};
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>