1
我有兩個控制,並且其中第二列圖表是使用數據表作爲聚集繪製兩個列圖表樣本谷歌可視化儀表板,谷歌可視化數據分組
'dataTable' : google.visualization.data.group(data, [0],
[{'column': 2, 'aggregation': google.visualization.data.sum, 'type': 'number'}])
和它使用的是重繪中間表格圖,
google.visualization.events.addListener(divPicker, 'statechange',
function(event) {
// group the data of the filtered table and set the result in the pie chart.
columnChart1.setDataTable(google.visualization.data.group(
// get the filtered results
table.getDataTable(),
[0],
[{'column': 2, 'aggregation': google.visualization.data.sum, 'type': 'number'}]
));
所有的代碼工作正常。但問題是,當我選擇控件時,聚合創建的圖表沒有正確更改。只有當我選擇兩次相同的控制選項時,它纔會改變。
**請注意:**我的示例[儀表板位於此處](http://jsfiddle.net/ZCKFc/) – mpsbhat 2013-04-26 13:24:47