Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo



  • violstar

    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.

  • 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

    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

      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

    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.