x-axis value display vertically

ART Help
artUser
2012-05-07
2012-09-12
  • artUser

    artUser - 2012-05-07

    hello

    i encounter a question when use line type graphic , the x-axis value is unable
    to display vertically , the same as datetime type graphic ;

    i want to show every week's data in graphic , the x-axis unit is week ; i
    found it is hard to achieve my object if use datetime type , so i use line
    instead.since there are many week's data need to be display , the x-axis value
    overlap each other , it difficult to distinguish them ;

    i hope you can give me some advice , thanks in advanced !

     
  • Timothy Anyona

    Timothy Anyona - 2012-05-07

    I assume you're talking about the x-axis labels. Someone else mentioned this
    on the forum a short while back. The only thing I can think of is to increase
    the graph size e.g. enter 800x800. The other, more permanent solution may be
    to display the labels at an angle instead of horizontally. I could try this
    out and let you know what code to change.

     
  • artUser

    artUser - 2012-05-07

    maybe what i say is not clear , sorry !

    as we know there is code :

    "org.jfree.chart.axis.DateAxis dateaxis = (org.jfree.chart.axis.DateAxis)
    plot.getDomainAxis();

    dateaxis.setVerticalTickLabels(true); "

    in class ArtXY.java

    so, use codes above we can let x-axis value display vertically when using
    ArtXY.java to generate graph ,, now , i wonder if

    i control in the same way when using line type graph.

    i know we can increase the graph size , but if the total number of x-axis
    value increase , the problem still exist;

     
  • Timothy Anyona

    Timothy Anyona - 2012-05-07

    OK. cewolf provides an easy way to achieve this. I've committed the required
    change to showGraph.jsp so you can get this file from svn trunk and use it.

    Basically, make the following changes to showGraph.jsp. (No changes are
    required for the art.graph java files)

    At the top of the file, add

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

    Add a chartpostprocessor element below the existing one with something like
    the following

    <cewolf:chartpostprocessor id="labelRotation">
            <cewolf:param name="rotate_at" value="5"/>
            <cewolf:param name="remove_at" value="50"/>
    </cewolf:chartpostprocessor>
    

    This will display labels vertically if there are more than 5 items. It you
    want it to be always vertical, replace "5" with "1"

     
  • artUser

    artUser - 2012-05-07

    now , i know how to do it with your help , thank you !

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks