我在网上找到了以下代码,并希望将其改编为我现有的代码.
这是在我找到的点击中显示/隐藏数据系列的代码:
http://jsfiddle.net/asgallant/6gz2Q/
到目前为止,这是我的改编:
function drawChart() {
var data = new google.visualization.arrayToDataTable([
['Draw', '1997', '1998'],
['1', 1236777, 1408007],
['2', 834427, 572882],
['3', 2164890, 1614181],
['4', 1893574, 3897171],
['5', 2851881, 673906],
['6', 359504, 630853]
]);
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
// create columns array
var columns = [];
// display these data series by default
var defaultSeries = [1];
var series = {};
for (var i = …Run Code Online (Sandbox Code Playgroud)