Multiple Chart Display in single page

Help
2005-06-02
2013-01-13
  • sharmoha732

    sharmoha732 - 2005-06-02

    In My Application I want to display Multiple Bar Charts. Here I want to put DatasetProducer object generation in a Loop and do the same. But It always displays chart with First Index. Can anybody help me out?

     
    • Brian Fox

      Brian Fox - 2005-06-03

      I had this problem. I seem to recall you need to use a different chart id each iteration.

      Here's an example:
                <jsp:useBean id="TotalBySyndrome" class="com.stchome.ahedd.charts.datasets.CountStatsDataset"/>
                    <logic:iterate name="syndromes" scope="page" id="syndrome" type="com.stchome.ahedd.struts.beans.SyndromeBean">
                        <tr>
                          <td colspan="4">
                          <table width="100%">
                            <tr>
                              <td>
                                    <cewolf:chart id="<%=syndrome.getName()%>"
                                                  title="Counts of"
                                                  type="timeseries"
                                                  xaxislabel="Date"
                                                  yaxislabel="Total">
                                      <cewolf:data>
                                        <cewolf:producer id="TotalBySyndrome" usecache="false">
                                          <cewolf:param name="syndrome" value="<%=syndrome.getObjectId()%>"/>
                                          <cewolf:param name="startDate" value="<%=(String)request.getAttribute("fromDate")%>"/>
                                          <cewolf:param name="endDate" value="<%=(String)request.getAttribute("toDate")%>"/>
                                          <cewolf:param name="location" value="<%=(String)request.getAttribute("location")%>"/>
                                          <cewolf:param name="sessionId" value="<%=session.getId()%>"/>              
                                        </cewolf:producer>
                                      </cewolf:data>
                                      <cewolf:chartpostprocessor id="TotalBySyndrome">
                                          <cewolf:param name="syndrome" value="<%=syndrome.getObjectId()%>"/>
                                          <cewolf:param name="startDate" value="<%=(String)request.getAttribute("fromDate")%>"/>
                                          <cewolf:param name="endDate" value="<%=(String)request.getAttribute("toDate")%>"/>
                                          <cewolf:param name="sessionId" value="<%=session.getId()%>"/>              
                                      </cewolf:chartpostprocessor>
                                    </cewolf:chart>
                                    <cewolf:img chartid="<%=syndrome.getName()%>" renderer="cewolf" width="480" height="360" timeout="600">
                                      <cewolf:map tooltipgeneratorid="TotalAllSyndromes" linkgeneratorid="TotalAllSyndromes"/>
                                    </cewolf:img>
                                    <p>   
                                  </td>
                                </tr>
                            </table>       
                          </td>
                        </tr>
                    </logic:iterate>

       
    • C_J

      C_J - 2007-08-29

      I got the same problem.. I used your solution to test my program out .. but same chart is dispalyed twice .. here is the code if you can help that will be greatly appreciated ..

      <% String i = "test";%>
      <jsp:useBean id="pageViews" class="orbisproperty.Components.Charts.LineChart_Property_Stats"/>
      <jsp:setProperty name="pageViews"  property="categories" value="<%=cat%>" />
      <jsp:setProperty name="pageViews"  property="seriesNames" value="<%=series%>" />
      <jsp:setProperty name="pageViews"  property="reference" value="TLSR95" />
      <cewolf:chart
          id="<%=i%>"
          title="Property View Statistics"
          type="line"
          xaxislabel="Day"    
          yaxislabel="Views"
          legendanchor="south">    
                  <cewolf:gradientpaint>
                      <cewolf:point x="0" y="0" color="#FFFFFF"/>
                      <cewolf:point x="0" y="300" color="#CCCCCC"/>
                  </cewolf:gradientpaint>           
          <cewolf:data>
              <cewolf:producer id="pageViews" usecache="false">
                  <cewolf:param name="paramName" value='<%=new java.util.Date().getTime()%>' />
              </cewolf:producer>
          </cewolf:data>
      </cewolf:chart>
      <p>
      <cewolf:img chartid="<%=i%>" renderer="/servlet/cewolf" width="400" height="300">       
      </cewolf:img>
      </P>
      <br><br>
      able807
      <%i = "test2";%>
      <jsp:setProperty name="pageViews"  property="reference" value="able807" />
      <cewolf:chart
          id="<%=i%>"
          title="Property View Statistics"
          type="line"
          xaxislabel="Day"    
          yaxislabel="Views"
          legendanchor="south">    
                  <cewolf:gradientpaint>
                      <cewolf:point x="0" y="0" color="#FFFFFF"/>
                      <cewolf:point x="0" y="300" color="#CCCCCC"/>
                  </cewolf:gradientpaint>           
          <cewolf:data>
              <cewolf:producer id="pageViews" usecache="false">
                  <cewolf:param name="paramName" value='<%=new java.util.Date().getTime()%>' />
              </cewolf:producer>
          </cewolf:data>
      </cewolf:chart>
      <p>
      <cewolf:img chartid="<%=i%>" renderer="/servlet/cewolf" width="400" height="300">       
      </cewolf:img>
      </P>

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks