7 Replies Latest reply on Dec 14, 2008 12:26 AM by alain94040

    X-axis labels not showing on seam line chart

    skunk

      Hello All,


      I am trying to use Seam's chart module to show a line chart of network traffic data. At the moment it looks like:




      The problem I have is that unlike the y(range) axis, the x(domain) axis labels aren't being shown at all. I would like the x-axis labels to look like the chart below. This means not showing labels for every single bit of data. Is this possible?




      My code looks like:


      <p:linechart title="#{site.name} Network Traffic" legend="true"
          width="600" height="400" styleClass="chart"
          domainAxisLabel="Date" rangeAxisLabel="Data transferred (GigaBytes)"
          domainGridlinesVisible="true">
        <p:series key="Traffic from JANET">
          <ui:repeat value="#{organisationHome.getSiteTraffic(site)}" var="objArray">
            <p:data key="#{objArray[0].startTime}"
              value="#{objArray[0].quantity eq null ? 0 : objArray[0].quantity /1000}" />
          </ui:repeat>
        </p:series>
        <p:series key="Traffic to JANET">
          <ui:repeat value="#{organisationHome.getSiteTraffic(site)}" var="objArray">
            <p:data key="#{objArray[0].startTime}" 
              value="#{objArray[1].quantity eq null ? 0 : objArray[1].quantity /1000}" />
          </ui:repeat>
        </p:series>
      </p:linechart>
      



      Thanks,

      Dave

        • 1. Re: X-axis labels not showing on seam line chart
          minjaman

          Hello David,


          I wrote a simple enhancement of the PDF taglib. Nobody is interested to examine my enhancement. Perhaps i did something wrong?


          If you give me your line chart as single JSF without object iteration, i will try it with my enhancement.


          Sample:


          <p:linechart width="400" height="300" title="UP_45" domainLabelPosition="UP_45">
              <p:series key="partsrcvd">
                  <p:data columnKey="0" key="abcdefg" value="0" />
                  <p:data columnKey="1" key="hijklm" value="1" />
               <p:data columnKey="2" key="nopqrstuvwx" value="2" />
                  <p:data columnKey="3" key="33" value="3" />
              </p:series>
          </p:linechart>
          



          My JIRA entry


          My forum entry


          Alexander

          • 2. Re: X-axis labels not showing on seam line chart
            minjaman

            Hello David,


            You asked:



            This means not showing labels for every single bit of data. Is this possible?

            I would say: no
            Seam PDF is a very small wrapper around jfreechart. Can you draw your diagram with jfreechart? If yes, it's at least possible to enhance the Seam taglib as i did. Better with a different namespace as Seam use.


            Alexander

            • 3. Re: X-axis labels not showing on seam line chart
              skunk

              Hi Alexander,



              Alexander Kunkel wrote on Nov 17, 2008 21:23:


              I would say: no
              Seam PDF is a very small wrapper around jfreechart. Can you draw your diagram with jfreechart?


              Well that seems like a fairly fundamental flaw - seam makes it impossible to display more than ~20 data points on a chart because it can't show the labels. Has anyone managed to use this for anything actually useful?!


              I'm sure it is possible to do what I want with jFreeChart:
              http://www.jfree.org/jfreechart/images/PriceVolumeDemo1.png See how the chart has a lot of data in it, but only a few labels at the bottom. (It would be even better if it had used your UP_45 code). I will try to write my own charting library...


              Thanks

              Dave

              • 4. Re: X-axis labels not showing on seam line chart
                yanmania

                Hello,


                I have the same problem. I would like to display a chart with a lot of data (x-axis are dates). The solution is to display one label by month instead of one label by day.


                Here is my JIRA entry : https://jira.jboss.org/jira/browse/JBSEAM-3750


                Yan.

                • 5. Re: X-axis labels not showing on seam line chart
                  skunk

                  Hi Yan, thank you for submitting this to JIRA.


                  If it helps, this is the chart I am creating from an EJB instead of using seam's tags to work around this:




                  It seems for a 'TimeSeriesChart', you can't have angled dates, just vertical or horizontal, so I have opted for vertical to fit more in. This might be my mistake.


                  Thanks,

                  Dave


                  • 6. Re: X-axis labels not showing on seam line chart
                    yanmania

                    Thanks Dave,


                    It could be an alternative as long as the feature is not implemented in Seam.


                    Yan.

                    • 7. Re: X-axis labels not showing on seam line chart
                      alain94040

                      Alexander:



                      I wrote a simple enhancement of the PDF taglib. Nobody is interested to examine my enhancement. Perhaps i did something wrong?

                      Yes, I'm very much interested! I'm suffering from the same problem that the original poster is describing. What I want to do is possible jfreechart, so if it's just a matter of adding a few more tags, then let's go for it.