8.4. Mixing locales on the same chart

The locale could be set for whole chart using the code:

 
chart.setLocale(new Locale("es"));

Then the numbers formatting and date formatting could be set individually for each chart element:

1
2
3
4
5
6
DateListAxisMapper dateMapper;
SimpleDateFormat df = new SimpleDateFormat(pattern, Locale.FR);
dateMapper.setDateFormat(df, Calendar.YEAR);
 
MathAxisMapper mm;
mm.setNumberFormat(NumberFormat.getInstance(Locale.UK));