0
votes

There are two pie-charts. I want the functionality so that only one slice of the pie-charts pulls out whichever last clicked. "pullOutOnlyOne" is working only for single pie-chart. I need it to be worked like this, If i click on a slice of One pie-chart then second one, then slice of first pie-chart should pulled in.

JSFIDDLE

I tried this one but unable to capture which pie-chart and which slice...:( var lastClickedSlice; ... ... { "event": "clickSlice", "method": function (e) { if (lastClickedSlice === "") { lastClickedSlice = e.dataItem.dataContext; } else { console.log(JSON.stringify(lastClickedSlice)); lastClickedSlice.clickSlice(lastClickedSlice.index); lastClickedSlice = e.dataItem.dataContext; } } } How to implement this thing with 2 or more than 2 pie-charts?

1

1 Answers

0
votes

Add click listners on each slice of the chart, for example on chart-1 slice click event below :

"listeners": [{ "event": "clickSlice", "method": function(e) {
chart2.pullOutRadius = "0%"; chart2.validateData(); chart2.pullOutRadius = "20%"; chart2.validateData(); } }]

Working Demo here : https://jsfiddle.net/6oo9jvLj/5/