任何人都可以告诉我们如何将jfreechart中的日期值国际化(2013年6月30日至2013年6月30日)。
感谢。
答案 0 :(得分:1)
如果所需的Locale
不是您的默认Locale
,则可以从Supported Locales中明确指定:
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setDateFormatOverride(new SimpleDateFormat("dd-MMM-yyyy", new Locale("es", "ES")));
在分发中的TimeSeriesChartDemo1
,included中进行了测试。另请参阅与DateFormatSymbols
相关的answer。
答案 1 :(得分:0)
要仅更改语言(并保留JFreechart的动态格式),请使用setLocale
代替setDateFormatOverride
:
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setLocale(new Locale("es", "ES"));