Hey,<br />
<br />
I want to show bar series with error bars in BIRT. Working from the example package on <a class='bbc_url' href='
http://www.eclipse.org/articles/article.php?file=Article-BIRTChartEngine/index.html'>http://www.eclipse.org/articles/article.php?file=Article-BIRTChartEngine/index.html</a> I modified the buildYSeries() method in BarChartBuilder.java to the following:<br />
<br />
<code><br />
protected void buildYSeries() {<br />
<br />
NumberDataSet orthoValuesDataSet1 = NumberDataSetImpl.create(dataSet<br />
.getTechnitians());<br />
<br />
BarSeries bs1 = (BarSeries) BarSeriesImpl.create();<br />
bs1.setDataSet(orthoValuesDataSet1);<br />
bs1.setRiserOutline(null);<br />
<br />
<br />
// Lower error bar series data set<br />
StockDataSet dsStockValuesLower = StockDataSetImpl<br />
.create(new StockEntry[] {<br />
new StockEntry(7, 7, 8, 7),<br />
new StockEntry(4, 4, 5, 4),<br />
new StockEntry(3, 3, 4, 3),<br />
new StockEntry(11, 11, 12, 11),<br />
new StockEntry(1, 1, 2, 1),<br />
new StockEntry(2, 2, 3, 2) });<br />
<br />
// Upper error bar series data set<br />
StockDataSet dsStockValuesUpper = StockDataSetImpl<br />
.create(new StockEntry[] {<br />
new StockEntry(9, 8, 9, 9),<br />
new StockEntry(6, 5, 6, 6),<br />
new StockEntry(5, 4, 5, 5),<br />
new StockEntry(13, 12, 13, 13),<br />
new StockEntry(3, 2, 3, 3),<br />
new StockEntry(4, 3, 4, 4) });<br />
<br />
// Create stock series<br />
StockSeries ssl = (StockSeries) StockSeriesImpl.create();<br />
ssl.getLineAttributes().setColor(ColorDefinitionImpl.BLUE());<br />
ssl.setDataSet(dsStockValuesLower);<br />
<br />
StockSeries ssu = (StockSeries) StockSeriesImpl.create();<br />
ssu.getLineAttributes().setColor(ColorDefinitionImpl.BLUE());<br />
ssu.setDataSet(dsStockValuesUpper);<br />
<br />
// Create scatter series<br />
ScatterSeries ss = (ScatterSeries) ScatterSeriesImpl.create();<br />
ss.getMarker().setType(MarkerType.CIRCLE_LITERAL);<br />
ss.setDataSet(orthoValuesDataSet1);<br />
<br />
SeriesDefinition sdY1 = SeriesDefinitionImpl.create();<br />
yAxis.getSeriesDefinitions().add(sdY1);<br />
sdY1.getSeriesPalette().update(ColorDefinitionImpl.BLACK());<br />
sdY1.getSeries().add(bs1);<br />
sdY1.getSeries().add(ssl);<br />
sdY1.getSeries().add(ssu);<br />
sdY1.getSeries().add(ss);<br />
<br />
}<br />
</code><br />
<br />
So I abused a StockSeries and a ScatterSeries to create the following result: <a class='bbc_url' href='
http://picasaweb.google.com/jeroen.vangoey/BIRT#5303389950399700658'>Picasa Web Albums - BioGeek - BIRT</a><br />
<br />
Three questions:<br />
* The dot of the scatter series isn't always perfectly centered on the vertical bar of my error bars (see for example the dots beloning to the cities Bejing, Xian and Nanning in the picture). Is there a way to correct this?<br />
* I added my BarSeries to my SeriesDefinition ( sdY1.getSeries().add(bs1); ), but my bars aren't showing. Is there a way to make the bar chart visible?<br />
* If I remove the line "ss.setDataSet(orthoValuesDataSet1);" in the above code, I get the bars from my bar chart, and the upper error bar I defined, but my lower error bar end the dot from the scatter plot aren't showing any more, see: <a class='bbc_url' href='
http://picasaweb.google.com/jeroen.vangoey/BIRT#5303394787772763634'>Picasa Web Albums - BioGeek - BIRT</a><br />
How do i get these back?<br />
<br />
The last 2 questions are related. Essentially, the effect I'm trying to achieve is to produce a bar chart, and centered on the top of each series a dot with two error bars extending from it, something like in this mockup: <a class='bbc_url' href='
http://picasaweb.google.com/jeroen.vangoey/BIRT#5303397516897454530'>Picasa Web Albums - BioGeek - BIRT</a><br />
<br />
Of course I'm going to refactor my code to include a method which takes 2 parameters (the height of the bar and the standard deviation to draw the error bars from) instead of the hardcoded numbers I have now, but any other comments about how I would achieve this effect (possibly without misusing stock- and scatterseries) would be appreciated.<br />
<br />
Thanks in advance,<br />
Jeroen Van Goey