pie chart (mouse event)

19 views
Skip to first unread message

sameer

unread,
May 6, 2009, 8:48:19 AM5/6/09
to Flotr Javascript Plotting Library
Hi,
I am new to flotr but am impressed at the simplicity of the code
required to get things working. I am trying to use pie chart with
mouse click event. I would like to know which section of the pie chart
was clicked on rather than the position of the mouse click. Is this
possible?

Thanks for the great library and help.

Sameer

sameer

unread,
May 6, 2009, 8:58:52 AM5/6/09
to Flotr Javascript Plotting Library
Hi again,
I got the data by adding "position:'se'" in mouse option but only
get click on one of the pie sections!! All others seem to not respond
to the click? Am I doing something wrong.

cheers,
Sameer

Fabien Ménager

unread,
May 6, 2009, 1:09:43 PM5/6/09
to Flotr Javascript Plotting Library
Hello, for now, this is not possible to add a mouse event on the pie
slices. I know this would be good improvment, but we are currently
working on a way to handle mouse event in a better way and for every
type of plot.

sameer

unread,
May 7, 2009, 6:57:13 AM5/7/09
to Flotr Javascript Plotting Library
Thanks Fabien. I will wait until you get this sorted. I have another
issue with pie charts. I have many sections and am not getting the
colours right. Is there any way to ensure the library generates enough
colours. I have about 10-15 sections on the pie chart.
The other issue is when I have so many sections the labels are not
shown at all and the % values are overcrowded.

Sameer

Fabien Ménager

unread,
May 7, 2009, 8:42:53 AM5/7/09
to Flotr Javascript Plotting Library
Hello,
What version of Flotr do you use ? we had the same problem, a long
time ago, but it has been fixed in the latest trunk (http://
code.google.com/p/flotr/source/browse/#svn/trunk/flotr/flotr/
prototype).
Tell me if you still have the color problem with this version.
And for the displayed values, I don't know what to do, we should maybe
add another feature to find the best place for every label, but this
is not on my TODO list yet.

Sameer Velankar

unread,
May 7, 2009, 9:49:32 AM5/7/09
to fl...@googlegroups.com
hi,

  Thanks. Got it working.
My suggestion on labels would be to not show labels where fraction is less than certain value and then when you add mouse select event it makes the smaller slices bigger and shows name. I don't know if this would be too complicated but would be elegant for sure.

Sameer

Fabien Ménager

unread,
May 10, 2009, 11:42:48 AM5/10/09
to Flotr Javascript Plotting Library
You can do that with the options.pie.labelFormatter function, just by
testing the value and returning '' or the value if it is bigger than
the minimum value.

On May 7, 3:49 pm, Sameer Velankar <svelan...@gmail.com> wrote:
> hi,
>
>   Thanks. Got it working.
> My suggestion on labels would be to not show labels where fraction is less
> than certain value and then when you add mouse select event it makes the
> smaller slices bigger and shows name. I don't know if this would be too
> complicated but would be elegant for sure.
>
> Sameer
>

Sameer Velankar

unread,
Nov 6, 2009, 3:51:42 PM11/6/09
to fl...@googlegroups.com
Hi Fabien,
  I was wondering if you were able to get the mouse even ( "mouseover" or "click") working for pie charts in the new flotr version?
Thank you very much for your help
regards,
Sameer
Reply all
Reply to author
Forward
0 new messages