Search code examples
javajfreechart

How to internationalize the date value in jfreechart?


Can any one please tell how to internationalize the date value in jfreechart like (30 Jun 2013 to 30 junio 2013).

Thanks.


Solution

  • 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.