Reputation: 155
Can any one please tell how to internationalize the date value in jfreechart like (30 Jun 2013 to 30 junio 2013).
Thanks.
Upvotes: 2
Views: 656
Reputation: 4659
To change only the language (and keep dynamic format from JFreechart) use setLocale
instead of setDateFormatOverride
:
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setLocale(new Locale("es", "ES"));
Upvotes: 0
Reputation: 205785
If the desired Locale
is not your default Locale
, you can specify it explicitly from among the Supported Locales:
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setDateFormatOverride(new SimpleDateFormat("dd-MMM-yyyy", new Locale("es", "ES")));
Tested in TimeSeriesChartDemo1
, included in the distribution. See also this related answer regarding DateFormatSymbols
.
Upvotes: 1