Is there a way to make a stacked area style plot using time series data?
I was able to use OverlaidXYPlot to get the plots to show up together, but I"d really like them to show up as stacked area plots but stacked area plots only seem to work w/ CategoryDatasets. I was able to fake the kind of plot I'm looking for by using a SimpleDateFormatter to lay out my category names, but I'd like something with the intelligience of a BasicTimeSeries and the XY Plots.
Anyone know if this is doable?
Thanks,
Jonathan
Stacked area using time series
Re: Stacked area using time series
Hi Jonathan,
The problem is that each series is permitted to have a different set of x-values, so you can't always guarantee that the data aligns for stacking purposes. I'm not sure of a good way to get around that.
Regards,
DG
The problem is that each series is permitted to have a different set of x-values, so you can't always guarantee that the data aligns for stacking purposes. I'm not sure of a good way to get around that.
Regards,
DG
Re: Stacked area using time series
Surely missing data for a particular series/point in a stacked area chart should just be counted as zero?
Regards,
Richard...
Regards,
Richard...
Re: Stacked area using time series
I had this same question actually, but I couldn't figure out a good way to get around it, using built-in methods. What I ended up doing was using a standard Area renderer, but editing my dataset by going back and adding the values of the previous series... Of course, in my case, I was only dealing with 4 series, so the actual process of adding only involved a few additions, which wasn't too bad...
mina.
mina.
Re: Stacked area using time series
Missing data is easy to handle, I was thinking more about how to handle two series where the x-values aren't aligned, for example:
Series 1:
x = 1.0, y = 5.0
x = 2.0, y = 6.5
x = 3.0, y = 7.6
Series 2:
x = 1.2, y = 3.0
x = 2.1, y = 7.5
x = 3.0, y = 6.0
How would you display this in a stacked area chart?
The problem here is that XYDataset allows the x-values to be independent between series. It would be possible to "extend" XYDataset so that the x-values are always the same for all series (maybe call it TableXYDataset), for example:
x = 1.0, y1 = 5.0, y2 = 3.0
x = 2.0, y1 = 6.5, y2 = 7.5
x = 3.0, y1 = 7.6, y2 = 6.0
...then it would be easier to generate a stacked area chart, using a custom renderer with XYPlot.
Regards,
DG
Series 1:
x = 1.0, y = 5.0
x = 2.0, y = 6.5
x = 3.0, y = 7.6
Series 2:
x = 1.2, y = 3.0
x = 2.1, y = 7.5
x = 3.0, y = 6.0
How would you display this in a stacked area chart?
The problem here is that XYDataset allows the x-values to be independent between series. It would be possible to "extend" XYDataset so that the x-values are always the same for all series (maybe call it TableXYDataset), for example:
x = 1.0, y1 = 5.0, y2 = 3.0
x = 2.0, y1 = 6.5, y2 = 7.5
x = 3.0, y1 = 7.6, y2 = 6.0
...then it would be easier to generate a stacked area chart, using a custom renderer with XYPlot.
Regards,
DG