Use same colour for series in multi-bar chart [message #1257579] |
Wed, 26 February 2014 15:37  |
Eclipse User |
|
|
|
Hi,
I'm using the BIRT chart API in Eclipse. I've created a multi-bar chart using two series (i.e. {1, 2, 3, 4} and {4, 5, 6, 3} as the y-values for some x-values). The chart is attached as image1 and shown here.

As you can see, the bars for each x-value have the same colour! What I want is for the bars for each series to have the same colour. In other words, the first bar for each x-value would be blue and the second bar for each x-value would be red. See attached "correctimage".

I have tried everything to get this to work but have not had any luck. Specifically:
- I can get all the bars to be the exact same colour by setting the entries in seriesPalette for the x-axis series definition to be the same (attached as image2):
sdX.getSeriesPalette().getEntries().clear();
sdX.getSeriesPalette().getEntries().add(ColorDefinitionImpl.create(100, 0, 0, 210));
sdX.getSeriesPalette().getEntries().add(ColorDefinitionImpl.create(100, 0, 0, 210));

- I have tried to use multiple x-axes, multiple y-axes, but no luck.
- I have to tried to call "sdY.getSeriesPalette().update(f)" as I've seen in some places, but no luck.
How does one do this?!
Thanks for your help.
Attachment: image1.png
(Size: 18.47KB, Downloaded 1881 times)
Attachment: image2.png
(Size: 20.43KB, Downloaded 1665 times)
Attachment: correctimage.png
(Size: 88.26KB, Downloaded 1725 times)
|
|
|
|
Re: Use same colour for series in multi-bar chart [message #1257699 is a reply to message #1257618] |
Wed, 26 February 2014 18:01   |
Eclipse User |
|
|
|
Hi,
Thank you for your response. As I mentioned, I'm using the BIRT API in Eclipse (Java code) and not the BIRT report/chart tool...
Would you know what API would let me change how the series is coloured (i.e. instead of by category, use by "value series"?
Thanks.
|
|
|
Re: Use same colour for series in multi-bar chart [message #1257737 is a reply to message #1257699] |
Wed, 26 February 2014 18:47   |
Eclipse User |
|
|
|
I found this API to setColorByCategory, but this is in IChart in the script.api package... My Chart object is an instance of IChartObject in the org.eclipse.birt.chart.model package.
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.birt.chart.doc.isv%2Fchartscript%2Fapi%2Forg%2Feclipse%2Fbirt%2Fchart%2Fscript%2Fapi%2FIChart.html
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04818 seconds