Dynamic <p:chartSeries> for a lineChart

UI Components for JSF
Post Reply
GiriGG
Posts: 12
Joined: 16 Jun 2009, 01:25

07 Aug 2009, 01:07

Hi,

I am trying to generate a lineChart with multiple <p:chartSeries> by a <c:forEach loop.

<p:lineChart id="line" value="#{SearchBean.responseTimeList}" var="graph" xfield="#{graph[0]}" style="chartStyle" styleClass="column11" >
<c:forEach var="series" items="#{BAMSearchBean.responseTimeList}" begin="1" varStatus="idx">
<p:chartSeries label="Event" value="#{series}" ></p:chartSeries>
</c:forEach>
</p:lineChart>

responseTimeList is an arrayList of object[]. For example responseTimeList can have following object[]
0 - Object[] for xField value
1 - Object[] for 1st chartSeries
2 - Object[] for 2nd chartSeries


I can see all values are coming correctly, but chart is not getting rendered due to c:forEach. I have modified BaseChartRenderer.getFieldName(String expressionString) method to work for graph[0] & {series}. Please help me by suggesting how to solve this issue.


Thanks.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Aug 2009, 21:29

Hi, why dont you convert your responseTimeList array to a list.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests