• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Controling Chart Display Using JFreeChart

 
Ranch Hand
Posts: 2206
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In MSExcel a chart is displayed as left axis then a space the a tick mark. The category label and plot values(bar, line, point etc.) are centered in this space. Then the next space and so on.

I my JfreeChart it appears that the tick mark is driving where the values are placed. How can I make the space between the tick marks the category area so between the marks my category label and values are displayed?
 
Steve Dyke
Ranch Hand
Posts: 2206
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it figured out.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have the same problem.
How did you solve it?
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since Steve posted almost a year ago he may not see your reply.
 
ron cook
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the solution too.

Rather than using DateAxis, use the PeriodAxis and PeriodAxisLabelInfo, as follows:

PeriodAxis domainAxis = new PeriodAxis("Date");
domainAxis.setAutoRangeTimePeriodClass(Month.class);
domainAxis.setMajorTickTimePeriodClass(Month.class);

PeriodAxisLabelInfo[] info = new PeriodAxisLabelInfo[2];
info[0] = new PeriodAxisLabelInfo(Month.class, new SimpleDateFormat("MMM"));
info[1] = new PeriodAxisLabelInfo(Year.class, new SimpleDateFormat("yyyy"));
domainAxis.setLabelInfo(info);


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic