how can i get category/serie value from jqplot barchart in a javascript function called inside extender primefaces attribute? -
i have following code:
<p:barchart id="bar" extender="extbar" value="#{primebean.findbarmodel('simplebarchart')}" /> <script> function ext() { } </script>
will renderized values:
[ [[5,1], [1,2], [3,3], [4,4]], [[4,1], [7,2], [1,3], [2,4]] ]
how can category/serie value inside ext function ? there element can these values inside ext ?
yes , it's easy. add widgetvar
attribute <p:barchart
way :
<p:barchart widgetvar="mywidget" ... />
the can access data in javascript using mywidget.cfg.data
. you'll array of array can read using regular js.
you can test online in showcase, open javascript console if browser has 1 , type : widget_basic.cfg.data
Comments
Post a Comment