paulguz Report post Posted August 27, 2014 (edited) (Apologies for the repost; I think I originally had this in the wrong subforum) Hi, In my collaboration tool, I need to capture the slice event and programatically slice the same chart on a different browser. The function slicePlotItem() requires an index for the data item to be sliced, but the data argument of slicingStart (or slicingEnd) does not contain this index. How do you suggest determining the index of the sliced data? Thanks, Paul Edited August 27, 2014 by paulguz Share this post Link to post Share on other sites
Nabajeet Report post Posted August 28, 2014 Hi Paul, To get the index of the sliced data you can use 'dataplotClick' event in place of slicingStart (or slicingEnd).Please check out this fiddle:http://jsfiddle.net/...charts/b533S/4/For more info on this please search dataplotClick in:http://docs.fusionch...sionCharts.htmlHope this helps Share this post Link to post Share on other sites
paulguz Report post Posted August 28, 2014 Thanks Nabajeet, The problem with that event is that the 'isSliced' property of argObj is always false. See http://jsfiddle.net/b533S/5/. I note that this property isn't documented, so it maybe isn't quite a bug. Paul Share this post Link to post Share on other sites
paulguz Report post Posted August 28, 2014 A simple solution (albeit one which shouldn't be necessary) is to compare the chart's slices at the start and end of the slice, and find the slice that changed, like so: var chartSliceStateStart = []; //the state of the chart's slices before slicing var chartSliceStateEnd = []; //the state of the chart's slices after slicing FusionCharts.addEventListener('slicingStart', function (event, args) { chartSliceStateStart = []; for (var i=0; i < event.sender.getJSONData().data.length; i++) { chartSliceStateStart.push(event.sender.isPlotItemSliced(i)); } }); FusionCharts.addEventListener('slicingEnd', function (event, args) { callServerHub(function () { var sliceIndex = 0; var clickedSliceFound = false; chartSliceStateEnd = []; for (var i = 0; i < event.sender.getJSONData().data.length; i++) { chartSliceStateEnd.push(event.sender.isPlotItemSliced(i)); } var i =0; while (!clickedSliceFound && i < chartSliceStateStart.length) { clickedSliceFound = chartSliceStateStart[i] != chartSliceStateEnd[i]; sliceIndex = i; i++; } if (clickedSliceFound) { // do something with sliceIndex } }); }); Share this post Link to post Share on other sites
Nabajeet Report post Posted September 2, 2014 Hi Paul, What you can do is use both the events 'dataplotClick' and 'slicingStart/slicingEnd' to get the slice index and sliced state.http://jsfiddle.net/b533S/10/ Hope this helps. Share this post Link to post Share on other sites