I want to set Date labels for StackedXYAreaChart, to X axis, only for marks added into DataSet.
Please see example here:
http://www.imagedump.com/index.cgi?pick=get&tp=406451
Date label places was marked with green circles.
How to set Date labels for StackedXYAreaChart
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You need to do two things:
(1) Alter the dataset so that the x-values are milliseconds since 1-Jan-1970 (as in java.util.Date);
(2) Change the x-axis from a NumberAxis to a DateAxis:
(1) Alter the dataset so that the x-values are milliseconds since 1-Jan-1970 (as in java.util.Date);
(2) Change the x-axis from a NumberAxis to a DateAxis:
Code: Select all
XYPlot plot = (XYPlot) chart.getPlot();
plot.setDomainAxis(new DateAxis("Date"));
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

