Change X values

mkillmer
2005-01-14
2013-01-13
  • mkillmer

    mkillmer - 2005-01-14

    Hello,
    I'm working with cewolf sice 3 days.
    And now I have a problem with a generated chart. I have an table with values for each day of the last month. The chart shows me a filled area depending of the value for each day. The x-axis shows the date for the entry. But there are to many dates on the x-axis so that I can not read the date
    My question is :
    How can I change the x values to avoid the problem ? Can I define an auto scale for that ?
    I tried it with the PostProcessor - without success.

    Best Regards,
    Mario

     
    • Zoltan Luspai

      Zoltan Luspai - 2005-01-17

      Hi,

      Try to make the labels smaller in your postprocessor, for example if just the day of the date is enough then do this:

      CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
      DateTickUnit dtu = new DateTickUnit(DateTickUnit.DAY, 1, new SimpleDateFormat("d"));
      categoryplot.getRangeAxis().setTickUnit(dtu);

      ////////
      Also you can try to play with other parameters of the Axis (categoryplot.getRangeAxis()), like lowering the font size using axis.setLabelFont().
      Generally I'd recommend you to create a small GUI application displays your graph with some static data where it is fast to play with the chart look, then collect all stuff you figured out and put to a postprocessor. Then have a look a JFreechart's doc/forums/source for all the objects and properties.

       
    • mkillmer

      mkillmer - 2005-01-18

      Hello,

      thanks for your response.
      But that didn't solve my problem.

      I have found a solution with the following code :
      HorizontalCategoryAxis axis = (HorizontalCategoryAxis)plot.getDomainAxis();
      axis.setSkipCategoryLabelsToFit(true);

      But yesterday I switch to cewolf 10 and the methode setSkipCategoryLabelsToFit is not longer supported. And i didn't find an equivalent method.

      Any ideas ?

      Regards,
      Mario

       
      • Brian Fox

        Brian Fox - 2005-01-18

        i hate to sound like a broken record, but check www.jfree.org

        I am far from an expert on JfreeChart, the people there certainly are and can provide more help on their API.

        You can get access to the jfree chart object using a cewolf postprocessor.

         

Log in to post a comment.

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks