Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357114

Summary: Stack bar chart by y-grouping
Product: z_Archived Reporter: David Paquin <dpaquin>
Component: BIRTAssignee: Birt-Chart-inbox <Birt-Chart-inbox>
Status: CLOSED FIXED QA Contact: Sissi Zhu <szhu>
Severity: normal    
Priority: P3 CC: bluesoldier
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description David Paquin CLA 2011-09-08 11:51:27 EDT
The current implementation of the bar chart allows users to create a stacked chart, where each stack is a single series. It would be useful for my application (and I would assume some others) to be able to stack each y grouping. See http://www.birt-exchange.org/org/forum/index.php/topic/23355-any-way-to-stack-by-y-series-groupings/ for a full description.
Comment 1 Xiaoying Gu CLA 2011-12-29 01:18:23 EST
This bug is fixed in the bird exchang . ---Fengfu.liu
Comment 2 Xiaoying Gu CLA 2011-12-29 01:29:15 EST
in the bird exchange,the administrator BIRT Guru provide the Solution for the issue below:
------------------------------------------------------------------------------

Try something like this to actually change the series identifier:
 
function beforeGeneration( chart, icsc ){importPackage(Packages.java.util);importPackage(Packages.org.eclipse.birt.chart.model.data.impl);importPackage(Packages.org.eclipse.birt.chart.model.component.impl);importPackage(Packages.org.eclipse.birt.chart.model.type.impl);importPackage(Packages.org.eclipse.birt.chart.model.attribute); var xAxis = chart.getAxes().get(0);var yAxis = xAxis.getAssociatedAxes().get(0);var xSerieDef = xAxis.getSeriesDefinitions().get(0);var numSeries = yAxis.getSeriesDefinitions().size();var i=0;while (i < numSeries){var ySerieDef = yAxis.getSeriesDefinitions().get(i);i++; ySerieDef.getSeries().get(0).setSeriesIdentifier("My Series " + i.toString());}}
 
This will change the legend in the label. The code above will change them to My Series 1, My Series 2, etc... You'll just have to replace that with your way to name them what you want. 

Hope this helps. 
-------------------------------------------------------------------------------
make the change by Fengfu.liu