【发布时间】:2016-05-01 09:45:45
【问题描述】:
您好,我正在尝试使用 angular-google-chart 指令版本 0.1.0 制作交互式谷歌图表(气泡图)。
图表渲染工作顺利,直到我想在点击图表中的任何气泡时触发外部事件。
我的 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
但它仍然没有给我正确的价值,尤其是在连续点击气泡时。
感谢任何帮助
【问题讨论】:
标签: javascript angularjs charts google-visualization