I want to place two Time Series Charts sharing the same time domain axis above each other, both with multiple datasets.
chart1 = ChartFactory.createTimeSeriesChart("", "", "", tsc1, true, true, false);
subplot1 = chartCOT.getXYPlot();
...
chart2 = ChartFactory.createTimeSeriesChart("", "", "", tsc2, true, true, false);
subplot2 = chartCOT.getXYPlot();
...
where tsc1 and tsc2 are TimeSeriesCollection datasets containing multiple TimeSeries which both have the same date range of about 5 years.
When I plot them individually, there is no problem, i.e. the time domain axis reflects the calendar dates as desired.
As soon as I combine the two plots by means of the construction:
CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
plot.setGap(10.0);
plot.add(subplot1, 2);
plot.add(subplot2, 1);
chart[ch] = new JFreeChart("label", null, plot, true);
the charts appear above each other, as desired, but the time axis does not show calendar dates anymore but values like 0, 250'000'000'000, 500'000'000'000 and so on, as they were presenting milliseconds. Furthermore, the time range is extended to the left side for about 30 years and the plot data (beginning with the year 2006) starts in the far right side and accordingly is very much compressed.
How can I preserve the correct representation of the domain axis (calendar dates between 2006 and 2012)?