We are using SmartClient Version: SNAPSHOT_v9.0d_2013-04-04/PowerEdition Deployment (built 2013-04-04).
We are working with scatter charts and we are facing an issue with the hover popups. Just to simplify things, we have taken a code sample given on the http://www.smartclient.com/smartgwtee/showcase/#scatterPlotCharting and enabled the popup hover as given below -
1. Enabled hover popup by setShowHoverComponents(true);
2. Here is the implementation of getHoverComponents() -
public Canvas getHoverComponent() {
VLayout layout = createVLayout();
DrawnValue nearestDrawnValue = getNearestDrawnValue();
HTMLFlow htmlFlow = new HTMLFlow("First Value - " + nearestDrawnValue.getRecord().getAttributeAsString ("animal") + " | Second Value - " + nearestDrawnValue.getRecord().getAttributeAsString ("Time"));
// DrawnValue[] nearestDrawnValue = getNearestDrawnValues();
// HTMLFlow htmlFlow = new HTMLFlow("First Value - " + nearestDrawnValue[0].getRecord().getAttributeAsString("animal") + " | Second Value - " + nearestDrawnValue[0].getRecord().getAttributeAsString("Time"));
htmlFlow.setAutoHeight();
htmlFlow.setWidth(DVConstants.THREE_HUNDRED);
layout.addMember(htmlFlow);
return layout;
}
private VLayout createVLayout() {
VLayout layout = new VLayout();
layout.setBackgroundColor("white");
layout.setShowEdges(true);
layout.setOverflow(Overflow.VISIBLE);
layout.setWidth(300);
layout.setAutoHeight();
layout.setPadding(10);
layout.setBorder("2px solid black");
return layout;
};
Here, we are getting value of getNearestDrawnValue() as null and hence it breaks further.
We also tried getNearestDrawnValues() [code in commented line] method but it does not show hover popup when we take the mouse pointer to the plotted spot. However, it shows hover popup for some of the spots if mouse pointer is taken little away from the actual spot.
Screenshot is attached.
Please help us in getting this resolved.
Thanks
Madanji
We are working with scatter charts and we are facing an issue with the hover popups. Just to simplify things, we have taken a code sample given on the http://www.smartclient.com/smartgwtee/showcase/#scatterPlotCharting and enabled the popup hover as given below -
1. Enabled hover popup by setShowHoverComponents(true);
2. Here is the implementation of getHoverComponents() -
public Canvas getHoverComponent() {
VLayout layout = createVLayout();
DrawnValue nearestDrawnValue = getNearestDrawnValue();
HTMLFlow htmlFlow = new HTMLFlow("First Value - " + nearestDrawnValue.getRecord().getAttributeAsString ("animal") + " | Second Value - " + nearestDrawnValue.getRecord().getAttributeAsString ("Time"));
// DrawnValue[] nearestDrawnValue = getNearestDrawnValues();
// HTMLFlow htmlFlow = new HTMLFlow("First Value - " + nearestDrawnValue[0].getRecord().getAttributeAsString("animal") + " | Second Value - " + nearestDrawnValue[0].getRecord().getAttributeAsString("Time"));
htmlFlow.setAutoHeight();
htmlFlow.setWidth(DVConstants.THREE_HUNDRED);
layout.addMember(htmlFlow);
return layout;
}
private VLayout createVLayout() {
VLayout layout = new VLayout();
layout.setBackgroundColor("white");
layout.setShowEdges(true);
layout.setOverflow(Overflow.VISIBLE);
layout.setWidth(300);
layout.setAutoHeight();
layout.setPadding(10);
layout.setBorder("2px solid black");
return layout;
};
Here, we are getting value of getNearestDrawnValue() as null and hence it breaks further.
We also tried getNearestDrawnValues() [code in commented line] method but it does not show hover popup when we take the mouse pointer to the plotted spot. However, it shows hover popup for some of the spots if mouse pointer is taken little away from the actual spot.
Screenshot is attached.
Please help us in getting this resolved.
Thanks
Madanji