Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-14205

rich:chart does not render sparse datasets

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.5.10
    • Fix Version/s: 4.5.12
    • Component/s: None
    • Labels:
      None
    • Environment:

      TomCat, Firefox

      Description

      The following code works for some graphs, doesn't display anything for some other graphs:

       <rich:chart title="NamSor API Stats" styleClass="graf">
                              <a4j:repeat value="#{namSorBean.getServiceStatsByUser(viewNamSorUser.namsorUser,1)}" var="serviceStat">
                                  <rich:chartSeries label="#{serviceStat.serviceName}" type="line">
                                      <a4j:repeat value="#{serviceStat.histo}" var="record">
                                          <rich:chartPoint x="#{record.dateShort}" y="#{record.consumptionLn}" />
                                      </a4j:repeat>
                                  </rich:chartSeries>
                              </a4j:repeat>
      

      Example not working:

      <form id="downloadForm" name="downloadForm" method="post" action="/namsor/faces/viewaccount.xhtml" enctype="application/x-www-form-urlencoded">
      <input type="hidden" name="downloadForm" value="downloadForm" />
      <a href="#" onclick="mojarra.jsfcljs(document.getElementById('downloadForm'),{'downloadForm:j_idt42':'downloadForm:j_idt42'},'');return false">Download</a> usage history.
                      <input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="-6748972939127261260:796884018544269392" autocomplete="off" />
      </form>
      <form id="apiUseHistory" name="apiUseHistory" method="post" action="/namsor/faces/viewaccount.xhtml" enctype="application/x-www-form-urlencoded">
      <input type="hidden" name="apiUseHistory" value="apiUseHistory" />
      <div class="graf chart-container" id="apiUseHistory:j_idt44"><div class="chart-title">NamSor API Stats</div><div class="chart" id="apiUseHistory:j_idt44Chart"></div><script type="text/javascript">new RichFaces.ui.Chart("apiUseHistory:j_idt44", RichFaces.jQuery.extend({
                                          handlers: {},
                                          particularSeriesHandlers: {"onplothover":[null,null,null],"onplotclick":[null,null,null]},
                                          data: [{"data":[["2015-10-25",12.312862139711692],["2015-10-26",14.901776611224083],["2015-10-27",14.755423671399239],["2015-10-28",14.602430828520129],["2015-10-29",13.628360161065546],["2015-11-02",14.201179678754213],["2015-11-03",14.200689281784712],["2015-11-05",11.18364331759435],["2015-11-10",13.025021735577573],["2015-11-20",0.6931471805599453]],"label":"gender","lines":{"show":true}},{"data":[["2015-10-23",9.490544554572004],["2015-10-26",14.902114028547388],["2015-10-27",15.079203010035226],["2015-10-28",14.627664025703298],["2015-10-29",13.58524042276822],["2015-10-31",11.146546445569266],["2015-11-02",14.201180358749468],["2015-11-03",14.200690642441854],["2015-11-05",11.18364331759435],["2015-11-09",2.1972245773362196],["2015-11-10",13.025021735577573],["2015-11-11",0.6931471805599453],["2015-11-15",2.4849066497880004],["2015-11-16",1.3862943611198906],["2015-11-18",0.6931471805599453],["2015-11-20",2.4849066497880004]],"label":"origin","lines":{"show":true}},{"data":[["2015-10-25",12.318137139226447],["2015-10-26",15.602702110126636],["2015-10-27",15.121923969160472],["2015-10-28",15.317144973089409],["2015-10-29",11.36276514638457],["2015-11-02",14.739717870855348],["2015-11-03",14.279789708602518],["2015-11-05",11.494486507453624],["2015-11-10",13.096019402064726]],"label":"parse","lines":{"show":true}}],
                                          },
                                          {"xaxis":{"axisLabel":"day"},"xtype":"string","serverSideListener":false,"legend":{},"charttype":"line","zoom":false,"ytype":"number","yaxis":{"axisLabel":"usage (ln)"}}));</script></div><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="-6748972939127261260:796884018544269392" autocomplete="off" />
      </form>
      

      Example working:

      <form id="apiUseHistory" name="apiUseHistory" method="post" action="/namsor/faces/viewnamsoruser.xhtml" enctype="application/x-www-form-urlencoded">
      <input type="hidden" name="apiUseHistory" value="apiUseHistory" />
      <div class="graf chart-container" id="apiUseHistory:j_idt31"><div class="chart-title">NamSor API Stats</div><div class="chart" id="apiUseHistory:j_idt31Chart"></div><script type="text/javascript">new RichFaces.ui.Chart("apiUseHistory:j_idt31", RichFaces.jQuery.extend({
                                          handlers: {},
                                          particularSeriesHandlers: {"onplothover":[null,null],"onplotclick":[null,null]},
                                          data: [{"data":[["2015-10-29",8.07153089355666],["2015-10-30",2.0794415416798357],["2015-11-12",0],["2015-11-19",1.0986122886681098]],"label":"gender","lines":{"show":true}},{"data":[["2015-10-29",8.07153089355666],["2015-10-30",2.0794415416798357],["2015-11-12",0],["2015-11-19",1.0986122886681098]],"label":"origin","lines":{"show":true}}],
                                          },
                                          {"xaxis":{"axisLabel":"day"},"xtype":"string","serverSideListener":false,"legend":{},"charttype":"line","zoom":false,"ytype":"number","yaxis":{"axisLabel":"usage (ln)"}}));</script></div><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="8182338739309027995:-6526158175419916779" autocomplete="off" />
      </form>                
      

      Unfortunately, I can t see why one is working the other not working.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                michpetrov Michal Petrov
                Reporter:
                namsor Elian CARSENAT
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: