I am using swtchart to create a chart with category axis and multiple bar series. In addition, I am setting error bars for each series. The problem I am having is that the error bars are not shown on the bar series but always at the position of the tick at the x-axis (where category labels are). I am attaching the picture of the chart. There are two error bars that are shown on top of each other for most of the series.
Here is the portion of the code where I am adding error bars:
double[][] yAxisValues=new double[dataList[0].length][dataList.length];
double[][] errorValues = new double[dataList[0].length][dataList.length];
i=0;
for (ChartData[] chartDataList : dataList) {
int j=0;
for (ChartData data : chartDataList) {
yAxisValues[j][i] = data.getAverage();
errorValues[j][i] = data.getStDev();
j++;
}
i++;
}
for (int j = 0; j < allSeries.length; j++) {
allSeries[j].setYSeries(yAxisValues[j]);
IErrorBar yErrorBar = allSeries[j].getYErrorBar();
yErrorBar.setType(ErrorBarType.PLUS);
yErrorBar.setPlusErrors(errorValues[j]);
yErrorBar.setVisible(true);
yErrorBar.setLineWidth(2);
}
I have made a simple change in the way pixelcoordinates are calculated for error bar in BarSeries.java to fix this issue. The patch is attached.
fixed in 0.10.0