I am using google pie chart where i want to disable the click event on the slices of pie. This is my code:
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['State Group', 'Names'],
['Andhra Pradesh', 9],
['Madhya Pradesh', 4.5],
['Tamilnadu / Pondicherry', 7],
['Karnataka', 2.5],
['Others', 1]
]);
var options = {
// title: 'My Daily Activities',
pieSliceText: 'none',
pieHole: 0.80,
slices: { 0: {color: '#46B1C9'},
1: {color: '#84C0C6'},
2: {color: '#F37992'},
3: {color: '#6A6478'},
4: {color: '#C9CCCA'},
},
};
var chart = new google.visualization.PieChart(document.getElementById('donutchart'));
chart.draw(data, options);
}
i have used this code to disable to click event, but somehow it is not working!
google.visualization.events.addListener(chart, 'ready', function(){
$("#donutchart").unbind("click");
});
Try this ...