|
Area Stacked problem |
Posted by Omar on Jul-26-2008 08:04 |
|
Hi Peter
I'm having a little problem using Stacked Areas with positive and negative values.
I was specking to work like the Stacked Bars where negative values started at zero line.
I send u a picture of the problem.
It seems like I have to split 1 layer in 2 Layers (for negative and positive Data with NoValues) or something like that.
If I making something wrong OR if you have any idea how to make them work like Stacked Bar I will appreciated it.
Thanks
|
Re: Area Stacked problem |
Posted by Peter Kwan on Jul-29-2008 02:04 |
|
Hi Omar,
For area chart, ChartDirector currently does not support stacking area chart with both positive and negative values. You can only stack areas with purely positive or purely negative values.
The reason is because there is no good method to represent bipolar data using stacked area. In a stacked bar chart, we only need to concern about stacking the data values. However, in an area chart, we also need to "interpolate" the data values (to join adjacent point), and there is no good way to do that with stacked bipolar data. The stacked area style is simply not suitable for bipolar data.
For example, in your attached example, the middle chart to the right looks a little bit strange. It would be "more strange" if the data is more bipolar (like the 3 data series all ocillates between positive and negative values, or if drawn in 3D, or if there are more data sets).
Anyway, if you want to draw bipolar area chart in "stacked style", I think you may "stacked the data" with your code, then pass the data to ChartDirector to draw simple area layers. For example, instead of treating a chart as a stacked area chart with 3 data sets, you can treat it as 3 simple area layers with 3 "accumulated" data sets.
Hope this can help.
Regards
Peter Kwan |
Re: Area Stacked problem |
Posted by KS31890 on Jan-14-2011 05:19 |
|
I think this may be a good way for area chart with both positive and negative values. Please note the pink and dark green areas have both +ve and -ve values.
|
Re: Area Stacked problem |
Posted by Peter Kwan on Jan-15-2011 02:02 |
|
Hi KS31890,
From what I know, the current stacking method used by ChartDirector for bipolar data is consistent with the stacked area charts created by Microsoft Excel.
As there is no commonly accepted standard method to stack bipolar data, everybody can think of a different stacking method, and it is hard to know which method is better (whether the Excel/ChartDirector method, or the method you suggest).
If you would like to use the stacking method in your message, you may consider to perform the followings:
(a) Split each data array into two data arrays, with one array containing the positive data only (with the negative positions replaced with zero), and one array consisting of the negative data only (with the positive positions replaced with zero).
(b) Plot the positive arrays as a stacked area layer.
(c) Plot the negative arrays as another stacked area layer.
Hope this can help.
Regards
Peter Kwan |
|