How can we make the pie charts slice as a hyperlink or how to show at least hand cursor on slices.
check the code below. which i am using creating a pie chart using amcharts.
var initChart = function() {
if (chart) chart.destroy();
var config = scope.config || {};
chart = AmCharts.makeChart(scope.chartid, {
"type": "pie",
"theme": "light",
"marginTop": 10,
"marginBottom":10,
"allLabels": [{
"text": scope.index,
"color": "green",
"bold" : true,
"align": "center",
"size": 20,
"y": 190,
}],
"dataProvider":scope.chartdata,
"titleField": "title",
"valueField": "percent",
"fontSize": 14,
"labelRadius": 10,
"radius": "25%",
"innerRadius": "45%",
"labelText": "[[title]]",
"balloonText":"Sales Amt: $[[amt]]",
"showHandOnHover":true,
"export": {
"enabled": true
},
"responsive": {
"enabled": true,
"addDefaultRules": false,
"rules": [
{
"maxWidth": 400,
"overrides": {
"fontSize": 6,
"labelRadius": 5,
"radius": "20%",
"innerRadius": "40%",
"allLabels": [{
"text": "1.02",
"color": "green",
"bold" : true,
"align": "center",
"size": 10,
"y": 210,
}]
}
}
]
},
"pullOutOnlyOne":true,
"startEffect":"easeOutSine",
"pullOutEffect":"easeOutSine",
"listeners": [{
"event": "clickSlice",
"method": function(e) {
var dp = e.dataItem.dataContext;
scope.selectoption1=dp.title;
if(scope.selectoption1!="OTHERS"){
var object ={
"title":scope.selectoption1,
"id":dp.id
}
$rootScope.$emit('selecteddonutchartdep', object);
}
e.chart.validateData();
}
}]
})
};
Is there a way to show hand cursor on pie chart slice
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…