In jfreechart, I have a renderer such as
GroupedStackedBarRenderer renderer = new GroupedStackedBarRenderer();
I my example I have 4 groups of 5 stacked bars (2 bars each stack), all in all 40 bars.
I have used a construction like
renderer.setSeriesPaint(0 + 2 * (length * s + g), <color for this bar>);
renderer.setSeriesPaint(1 + 2 * (length * s + g), <color for this bar>);
in order to color each bar individually, where g denotes the group, 'length' is the number of groups, s the stacked bar number within the group.
Unfortunately this does not work. What am I doing wrong?