PDA

View Full Version : Is possible to make the "slices" of a pie chart clickable?



Fire-Dragon-DoL
26 Jan 2012, 10:48 AM
I would like to use a pie chart as a "menu", it will be something like my home page.
However I noticed that there isn't an event "click" for series and nothing like itemclick under Chart class.

I would like to know if there is any possibility to do this, eventually how.
The only idea I have in mind is to fetch the DOM object and eventually hook to normal DOM click event.

The fact that there are tips for "pie chart slices" let me think that they may have mousedown/up events too (they intercept mouse over to do it).

Thanks for any suggestion

Fire-Dragon-DoL
28 Jan 2012, 1:33 AM
Also, are "slices" of the pie chart some ext.js components or they are just internal to the pie chart?

campersau1
29 Jan 2012, 8:42 AM
I've checked the source of the series and I have found that each slices is an Ext.draw.Sprite which has these events:

'beforedestroy', 'destroy', 'render', 'mousedown', 'mouseup', 'mouseover', 'mouseout', 'mousemove', 'click'
which are not documented by the way.

So you might get it work if you edit the code in the pie series where the sprites are added.

But it would be even better if this functionallity would be in extjs itself.

Fire-Dragon-DoL
29 Jan 2012, 9:15 AM
Well, thanks a lot by the way, this helps me so much!