在调整页面大小时,它可以扩展或缩短p:图表吗?

时间:2016-06-10 19:08:54

标签: jsf primefaces charts resize jqplot

如果可能的话,我想更改浏览器窗口的图表大小。

这是我的代码:

<b:column col-xs="12" col-md="12" >
    <p:chart widgetVar="foo" type = "pie" model="#{graphicBean.pieModel}" rendered="#{not empty graphicBean.pieModel}"/>
</b:column>

1 个答案:

答案 0 :(得分:2)

The <p:chart> supports responsive mode. Set it to 'true'. The following line is from Primefaces documentation.

In responsive mode, chart is redrawn when window is resized

<p:chart type="line" model="#{chartView.lineModel1}" style="height:300px;" responsive="true"/>

Please refer this for an example.