您好我正在使用angular-google-chart指令版本0.1.0製作交互式google圖表(氣泡圖)。製作交互式Angular google圖表指令集成氣泡圖
圖表渲染運行正常,直到我想通過點擊圖表中的任何氣泡來觸發外部事件。
我的HTML
<div google-chart chart="chartObject" style="{{cssStyle}}" custom-select="handleSelect"></div>
JS
$scope.handleSelect=function(selection){
console.log(selection);
};
$scope.chartObject = {};
$scope.chartObject.type = "BubbleChart";
$scope.chartObject.displayed = true;
$scope.chartObject.data = {
"cols": [{
"id": "xx",
"label": "xx",
"type": "xx",
"p": {}
}, {
"id": "xx",
"label": "xx",
"type": "number",
"p": {}
}, {
"id": "xx",
"label": "xxx",
"type": "number",
"p": {}
}, {
"id": "",
"label": "",
"type": "number",
"p": {}
}],
"rows": $scope.data
};
$scope.chartObject.options = {
"chartArea": {
top: 10,
bottom: 0,
width: '82%',
height: '85%'
},
"isStacked": "false",
"height": 280,
"fill": 1,
"displayExactValues": true,
"colorAxis": {
minValue: 0,
colors: ['#ff0000', '#ff5300', '#ff8900', '#ffb800', '#ffd600', '#ffe800', '#beee07', '#8edc0c', '#58ce34', '#22ac19']
},
"vAxis": {
"title": "Support Level",
"minValue": 0,
"maxValue": $scope.yaxis_value,
"viewWindowMode": "pretty",
"gridlines": {
"count": 5
},
"gridlines.color": "#D3D3D3"
},
"hAxis": {
"title": "No. Of Incident",
"maxValue": $scope.xaxis_value,
"gridlines": {
"count": 4
},
"gridlines.color": "#D3D3D3"
},
};
$scope.chartObject.formatters = {};
});
我的問題是,當我點擊任何氣泡圖怎麼弄,我通過圖表的確切行值或值。
參考鏈接我用: http://embed.plnkr.co/lOXTg5XRggwdctUedvfl/preview
但它仍然沒有給我正確的值,特別是對泡沫的連續點擊。
任何幫助表示讚賞
謝謝你的時間。 我把你的建議的代碼,並添加了一些額外的邏輯,我的問題得到解決。將把我的代碼放在這裏 –