Project lessons learned. How to hover in a chart the easy way,
Thank you for the fixes. I will reincorporate the fixes using 4.1 best practices and add a list grid, and repost a sample.
So far I have learned a lot. For other readers ...
1) In general, create a data value formatter. Don't try to use add a hover handler with mouseout and mouse move handlers for events to the hover. It's too much work. . Use ValueFormatters instead.
Here I display a label and the number of docs, the the highlighting still works.
BTW: I'd love a legend formatter, but ...
2) Modify the above with settings to improve the design.
3) There is a shocking difference in 4.1 to 4.0
4) FacetValueMaps (especially if isomorphic implements return a getDrawnValues(fvm)[] are an excellent way to query the chart's current data and synchronize a grid to an interactive facetchart.
Thanks .... 4.1
Thank you for the fixes. I will reincorporate the fixes using 4.1 best practices and add a list grid, and repost a sample.
So far I have learned a lot. For other readers ...
1) In general, create a data value formatter. Don't try to use add a hover handler with mouseout and mouse move handlers for events to the hover. It's too much work. . Use ValueFormatters instead.
Here I display a label and the number of docs, the the highlighting still works.
Code:
chart.setDataValueFormatter(new ValueFormatter(){ // TODO Auto-generated method stub public String format(Object value){ if (chart.getNearestDrawnValue()!=null){ Record record = chart.getNearestDrawnValue().getRecord(); return "" + record.getAttribute("label") + " " + "- " + record.getAttribute("docs") + "" + // ""; } else return value.toString(); // no record just return the value } });
2) Modify the above with settings to improve the design.
3) There is a shocking difference in 4.1 to 4.0
4) FacetValueMaps (especially if isomorphic implements return a getDrawnValues(fvm)[] are an excellent way to query the chart's current data and synchronize a grid to an interactive facetchart.
Thanks .... 4.1
Comment