• Jon Wynacht

    Jon Wynacht - 2003-12-10


    I am trying to use this ChartPostProcessor in my app and have configured it in the following way:

    <jsp:useBean id="labelRotation" scope="request" class="de.laures.cewolf.cpp.RotatedAxisLabels"/>

                  title="Supplier Performance Report"
                    <cewolf:producer id="vendorPerf"/>
                  <cewolf:chartpostprocessor id="labelRotation">
                      <cewolf:param name="rotate_at" value='<%= new Integer(90) %>'/>
                <cewolf:img chartid="line" renderer="cewolf" width="400" height="300" border="0"/>

    But it doesn't seem to do anything. Doesn't even throw an error. I've cruised through the messages in this forum and can't seem to find anything about this.

    Anybody have advice or know what the problem is?



    • Kristina Tripp

      Kristina Tripp - 2003-12-17

      If haven't tried it the way you mentioned but I've rotated the axis lables via the chart post processor

      ValueAxis rangeAxis = plot.getRangeAxis();

      This sets it horizontally.
      If you do a secondary axis and want to set it horizontally
      you need to do


      Hope this is what you where looking for.

      - Kristina

    • violstar

      violstar - 2005-04-07

      I had the exact same problem and spent lots of time to debug the library.  The solution was as easy as the following.  In the chartpostprocessor tag try the following:

      <cewolf:chartpostprocessor id="labelRotation">
      <cewolf:param name="rotate_at" value='<%= new Integer(90) %>'></cewolf:param>

      As simple as that and it fixed my problem.

    • Carsten Jantzen

      Carsten Jantzen - 2005-06-01

      It didnt quite fix my problem I had a line chart and had to set the number equal or less to the number of lines in my chart else it wont rotate.
      It looks like an error in the code to me.

    • worker1983

      worker1983 - 2005-08-09

      Hi all,

      i have exactly the same problem. I want to rotate the X-Axis, so the labels are vertical.

      I try it on the way like Jon, and use the tip from violstar. But nothing happen.

      Also i try to use the code from Kristina, but its throw an error:
      cannot resolve symbol symbol : class ValueAxis location: class
      cannot resolve symbol symbol : variable plot location: class

      It's seems to be a misconfiguration problem on my JSP site.

      Can anyone tell us how we can rotat the labels? Thx.

      --sorry about my english :)  --

      • andychief

        andychief - 2005-10-28

        Hello All
        <%@page import="org.jfree.chart.axis.CategoryAxis"%>
        <%@page import="org.jfree.chart.axis.CategoryLabelPositions"%>

        ChartPostProcessor axisRange = new ChartPostProcessor() {
        public void processChart(Object chart, Map params) {
                  CategoryPlot plot = (CategoryPlot) ((JFreeChart) chart).getPlot();
                  NumberAxis valueAxis = (NumberAxis) plot.getRangeAxis();
                  CategoryAxis domainAxis = plot.getDomainAxis();
                // Set label orientation
          pageContext.setAttribute("axisRange", axisRange);


        <cewolf:chartpostprocessor id="axisRange">

        Here are the three pieces you need and let me know if you still have problems.


    • DonM

      DonM - 2006-01-30

      There seems to be confusion about the purpose of the rotate_at parameter.  When you supply a value of 90, it does not mean rotate 90 degrees. It means that if your Dataset contains at least 90 categories, the label will be rotated.  If you want the label always rotated, supply a value of zero. Please review the source for the RotatedAxisLabels class and you will see what it was intended to do.  If you want to rotate the labels other than UP_90 or STANDARD, you will need to write your own ChartPostProcessor.


Log in to post a comment.