1

I've got the following chart made with JFreeChart: alt text

Is it possible (and if it is how) to extend the dates on the x-axis so that they contain the year, eg. 4-II-2010, 5-II-2010, ..., 6-III-2010?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Vasilen Donchev
  • 975
  • 4
  • 14
  • 26

1 Answers1

2

It's not clear how you are formatting the dates now, but setDateFormatOverride in DateAxis allows you to specify a suitable SimpleDateFormat. If not already available, you should be able to override getShortMonths() in DateFormatSymbols for the Roman numerals.

Addendum: For correct localization, it may be easier to do something like this:

DateAxis axis = (DateAxis) plot.getDomainAxis();
DateFormatSymbols dfs = DateFormatSymbols.getInstance(); // default locale
String[] roman = { ... };
dfs.setShortMonths(roman);
axis.setDateFormatOverride(new SimpleDateFormat("dd-MMM-yyyy", dfs));
trashgod
  • 203,806
  • 29
  • 246
  • 1,045