plot.addHoverListener( new PlotHoverListener() {
@Override
public void onPlotHover( Plot plot, PlotPosition position, PlotItem item )
{
plot.getOptions().getGlobalSeriesOptions().getPieSeriesOptions().getLabel().setShow(true);
System.out.println(item.getSeries().getData().getY(0));
}
}, true );However, when I hover, the label doesn't show, etc. I'd also like to change the text in the label, but that isn't working either.
The PlotHoverListener itself is working because the system.out.println line is working...
Thanks in advance for any help!
private void showOrHideLabel(Integer seriesIndex) { Element child = plot.getElement().getFirstChildElement(); while (null != child) { if (child.getClassName().equals("pieLabel")) { int index = Integer.parseInt(child.getId().replaceAll("pieLabel", "")); if (null != seriesIndex && index == seriesIndex) { child.getStyle().setDisplay(Style.Display.INLINE); } else { child.getStyle().setDisplay(Style.Display.NONE); } } child = child.getNextSiblingElement(); }}<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:p="urn:import:com.googlecode.gflot.client">
<ui:style> @external pieLabel;
.pie .pieLabel { display: none; } </ui:style>
<ui:with field='res' type='com.googlecode.gflot.examples.client.resources.Resources' />
<g:HTMLPanel> <p:SimplePlot ui:field="plot" width="300px" height="300px" addStyleNames="{style.pie}"/> <p ui:field='hovering'/> </g:HTMLPanel></ui:UiBinder>