gflot icon indicating copy to clipboard operation
gflot copied to clipboard

pie chart tooltip

Open jiang305 opened this issue 11 years ago • 4 comments

Hi,

Is it possible to have tooltips for each pie sector?

in my ui.xml <g:HTMLPanel> <p:SimplePlot ui:field="plot" />

/g:HTMLPanel

In my class, I added @UiField ParagraphElement hovering;

and

plot.addHoverListener( new PlotHoverListener() { @Override public void onPlotHover( Plot plot, PlotPosition position, PlotItem item ) { hovering.setInnerText("test"); } }, true );

But it does not work. Do you have any idea where it will be wrong?

Thanks

jiang305 avatar Nov 04 '13 20:11 jiang305

in my ui.xml, I added

. Sorry, for some reason, it won't display correctly in my previous post.

jiang305 avatar Nov 04 '13 20:11 jiang305

image

jiang305 avatar Nov 04 '13 20:11 jiang305

I think you are missing the hoverable option on grid : plotOptions.setGridOptions( GridOptions.create().setHoverable( true ) );

You can also look at source code of the pie example.

nmorel avatar Nov 05 '13 19:11 nmorel

Thanks for your help. I also found a issue where you can't setHoverable for specific pie sector.

jiang305 avatar Nov 06 '13 14:11 jiang305