| Summary: | Stack bar chart by y-grouping | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | David Paquin <dpaquin> |
| Component: | BIRT | Assignee: | 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
This bug is fixed in the bird exchang . ---Fengfu.liu 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
|