Colors in Stacked bar chart


I am using Jaspersoft Studio version using JasperReports Library version 6.3.2 (Community Edition).

I have a weird thing happening with the colors in a stacked bar chart : between 2 runs of the report it happens that the colors in the stacked bars swap around or 1 color swallows one of the other colors. And the next I run it it either runs correctly again (or not). There seems to be no apparent reason for this behaviour (or I can't find one at least), it is just random. 

The query I use is as follows : select category, color, nrofrecords from <table> group by category, color order by category, color. Category can have 10 values maximum, color only 3 (red-orange-green).

When it runs correctly it looks like this : 

But when it goes wrong red and orange or red and green are switched around or green swallows orange or any other combination occurs.

FYI : x axis = category, y axis is nrofrecords and series = color


dirk.diels's picture
Joined: Jan 9 2019 - 2:45am
Last seen: 1 week 21 hours ago

I found what caused the problem : when the nrofrecords for a category/colour = 0 then a record for that combination is still needed in the query.

dirk.diels - 1 month 6 days ago

0 Answers:

No answers yet