I'm using Primefaces 5.1 and JSF 2.2.4. On my application I have a functionality that renders a graph based on a result of a search. The problem is when the search returns many itens my graph legend overflows the graph area here is the image:
I've looked into the documentation and couldn't find anything about the legend size or something else that could solve my problem.
There is nothing wrong with the code so I think that there is no need to add it. If you guys think otherwise please tell me.
Thanks in advance.
Primefaces Pie chart legend overflows graph area
I finally solve my problem. I had to upgrade the primefaces version to 5.2 (I was using 5.1) and since this version there are new attributes do be setted on managed bean.
What I did to the legend work properly as I wanted was two things:
On the managed bean method that process the graph I added the line:
And on the xhtml file I increased the graph size adding the style attribute size:
And voila:
What I did to the legend work properly as I wanted was two things:
On the managed bean method that process the graph I added the line:
Code: Select all
chartModel.setLegendCols(4);
Code: Select all
<p:chart type="pie"
model="#{chartMBean.chartModel}"
style="width:1200px; height:600px"/>
Jorge Campos
--
Eclipse Juno
Primefaces 6.1.RC3
JSF 2.2.8
Apache Tomcat 8.5.14
--
Eclipse Juno
Primefaces 6.1.RC3
JSF 2.2.8
Apache Tomcat 8.5.14
-
- Information
-
Who is online
Users browsing this forum: No registered users and 35 guests