问题
How can I display the names of the days ("Sunday, Monday....") on the time axis, instead of just the date ?
回答1:
You can use setDateFormatOverride(), as shown here.
Addendum:
isn't there a way to change only the top level?
ChartPanel has methods related to the zoom state. You should be able to set the date format as desired either by overriding the chartChanged()
method or in response to user input, as suggested in this example.
回答2:
Yes:
DateAxis xAxis = (DateAxis) plot.getDomainAxis();
xAxis.setTickUnit(new DateTickUnit(
DateTickUnit.DAY,
1,
new SimpleDateFormat("EEE", Locale.DE)));
来源:https://stackoverflow.com/questions/5583757/display-days-in-timeserieschart