Adjust pie chart slice size by dragging the edge
I'm trying to adapt the growing pie demo on Raphaël's website to suit my own needs. http://raphaeljs.com/growing-pie.html
The demo is almost perfect as it is, but I would like the user to be able to drag the edges 开发者_Python百科of the slices to adjust their size, instead of clicking on them. This would be not only more intuitive, but also allow for adjusting the size exactly, instead of the stepped approach in the demo.
How would I go about this? Thanks in advance.
Try approaching your solution from a different UI perspective. Does the user have to manipulate the PI? Or, can the PI represent the user's response? Ask the user for a percentage, or some other value... then draw the UI interactively. This would eliminate the need to constantly calculate a value for every mousemove event triggered (basically) every pixel the mouse moves.
I would look at using GSAP for this. It has a Raphaël plugin and a Directional Rotation plugin.
精彩评论