I want to place two time series diagrams dividing one axis of the time domain on top of each other, as with multiple data sets.
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 that have the same date range of about 5 years.
When I draw them individually, there is no problem, that is, the axis of the temporary domain reflects the calendar dates at will.
As soon as I combine the two graphs using the construct:
CombinedDomainXYPlot plot = new CombinedDomainXYPlot(); plot.setGap(10.0); plot.add(subplot1, 2); plot.add(subplot2, 1); chart[ch] = new JFreeChart("label", null, plot, true);
charts appear one above the other at will, but the time axis no longer shows calendar dates, but values ββsuch as 0, 250'000'000'000, 500'000'000'000, etc., since they were representing milliseconds. In addition, the time range extends to the left side for approximately 30 years, and the plot data (starting from 2006) begin on the right side and are accordingly very compressed.
How to maintain the correct representation of the domain axis (calendar dates from 2006 to 2012)?