Dynamic generation of Bar Charts in Primefaces

…衆ロ難τιáo~ 提交于 2019-12-06 05:46:35

The solution is to use p:barchart into a p:datagrid. This datagrid will be loaded through a list of barcharts. Further create the list with a class type which contains barchart,title and color as attributes.And this perfectly solves your problem.

Solution:

<p:dataGrid id="chartdataGrid" var="list" value="#{Bean.chartList}" columns="2" style="border:none;">

  <p:barChart 
        value="#{list.chart}" title="#{list.title}"
        style="height:190px;width:350px" 
        barMargin="20" min="0" barPadding="10" animate="true" seriesColors="#{list.barColor}" />

</p:dataGrid>

if any you need any further clarification for this problem and its detail solution then i will love to provide it.

Hope my Solution helps you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!