Hi:
I do not understand the purpose of SubSeriesDataset. I wanted to generate a dataset which contains moving averages. The example I saw in the demo code seems to use a SubSeriesDataset for doing that but I do not quite understand why. Can somebody explain?
Also would there be another way of generating a dataset containing moving averages of a HighLowDataset?
Thanks in advance...
- Himanshu
Basic question on SubseriesDataset...
Re: Basic question on SubseriesDataset...
Hi Himanshu,
Originally, SubSeriesDataset was used to restrict the data displayed on the sub plots of a combined XY plot...back when there was only one dataset per chart (held by the JFreeChart class). In more recent versions of JFreeChart, each plot (or subplot) maintains its own dataset, so SubSeriesDataset is almost redundant.
The moving average code needs to be overhauled. It returns a dataset containing both the original series and the moving average series. If you want to get at just the moving average, then the SubSeriesDataset can do this for you, but it is a kludge. A better approach would be to have the moving average generated as a series on its own, then allow you to combine it with other series as necessary.
This is a messy area of the code, I will have it cleaned up before 1.0.0 is released, but it is not top of my list right now.
Regards,
DG
Originally, SubSeriesDataset was used to restrict the data displayed on the sub plots of a combined XY plot...back when there was only one dataset per chart (held by the JFreeChart class). In more recent versions of JFreeChart, each plot (or subplot) maintains its own dataset, so SubSeriesDataset is almost redundant.
The moving average code needs to be overhauled. It returns a dataset containing both the original series and the moving average series. If you want to get at just the moving average, then the SubSeriesDataset can do this for you, but it is a kludge. A better approach would be to have the moving average generated as a series on its own, then allow you to combine it with other series as necessary.
This is a messy area of the code, I will have it cleaned up before 1.0.0 is released, but it is not top of my list right now.
Regards,
DG