charts - PrimeFaces Piechart: Tooltips are not displaying in my local environment -
i have recreated example page shown in primefaces showcase at:
http://www.primefaces.org/showcase/ui/chart/pie.xhtml
the pie chart display , able tweak pie chart model available setters , getters, hovering on piece of pie not display tooltip @ all.
this not browser issue, in same browser tooltips display on demo site.
the jqplot-highlighter-tooltip div showing in html source, not getting updated on hover. there no errors shown in javascript console.
i using 5.2 maven dependancy, , have tried 4.0 - no change.
would appreciate ideas.
thanks.
the code managed bean follows:
package org.primefaces.examples; import org.primefaces.model.chart.piechartmodel; import javax.annotation.postconstruct; import javax.faces.bean.managedbean; import java.io.serializable; @managedbean public class chartview implements serializable { private static final long serialversionuid = 1075867144472594293l; private piechartmodel piemodel1; private piechartmodel piemodel2; @postconstruct public void init() { createpiemodels(); } public piechartmodel getpiemodel1() { return piemodel1; } public piechartmodel getpiemodel2() { return piemodel2; } private void createpiemodels() { createpiemodel1(); createpiemodel2(); } private void createpiemodel1() { piemodel1 = new piechartmodel(); piemodel1.set("brand 1", 540); piemodel1.set("brand 2", 325); piemodel1.set("brand 3", 702); piemodel1.set("brand 4", 421); piemodel1.settitle("simple pie"); piemodel1.setlegendposition("w"); } private void createpiemodel2() { piemodel2 = new piechartmodel(); piemodel2.set("brand 1", 540); piemodel2.set("brand 2", 325); piemodel2.set("brand 3", 702); piemodel2.set("brand 4", 421); piemodel2.settitle("custom pie"); piemodel2.setlegendposition("e"); piemodel2.setfill(false); piemodel2.setshowdatalabels(true); piemodel2.setdiameter(150); } }
the code view page is:
<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head/> <h:body> <p:chart type="pie" model="#{chartview.piemodel1}" style="width:400px;height:300px" /> <p:chart type="pie" model="#{chartview.piemodel2}" style="width:400px;height:300px" /> </h:body> </html>
i have faced same problem. using extender fixed :
facelet :
<script type="text/javascript"> function pieextender() { this.cfg.highlighter = { show: true, tooltiplocation: 'n', useaxesformatters: false, formatstring: '%s = %d' }; } </script>
managed bean :
piemodel.setextender("pieextender");
for more tweaking see : http://www.jqplot.com/docs/files/plugins/jqplot-highlighter-js.html
Comments
Post a Comment