gflot
gflot copied to clipboard
pie chart tooltip
Hi,
Is it possible to have tooltips for each pie sector?
in my ui.xml <g:HTMLPanel> <p:SimplePlot ui:field="plot" />
/g:HTMLPanelIn 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
in my ui.xml, I added
. Sorry, for some reason, it won't display correctly in my previous post.
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.
Thanks for your help. I also found a issue where you can't setHoverable for specific pie sector.