Hi Tobias,
In BIRT, you can normally use the X-axis grouping... and then select an
interval of 10... and then select Count for the aggregation... Then, for
the Y-axis you could select any field since it was just counting them...
and select the 'name' for the optional grouping. The two problem you
would see with this approach is that the grouping would go from 0-9 and
not 1-10 (although easily fixed with a computed field subtracting 1 from
each value)... but then the labels would not look right.
A better way is to create a computed column that divides the values by
10 and just returns the whole integer so that 1-10 has a grouping of 0,
11-20 has a grouping of 1, etc, like below:
Math.floor((row["pieces"]-1) / 10)
...then to get the labels correct, fix up your computed column like below:
grp= Math.floor((row["pieces"]-1) / 10);
lbl = ((grp*10)+1) +" to " + ((grp*10)+10);
lbl;
This returns 1 to 10, 2 to 20, 3 to 30, and so on.
On your chart, select your computed column for the X-axis and turn on
grouping by interval of 1, with COUNT as the aggregation.
Select any column for the Y-axis since we are just counting rows...
and then select 'name' for the optional grouping.
I created this example and posted it to BIRT Exchange at:
http://www.birt-exchange.com/devshare/designing-birt-reports/572-birt-grouped-chart-example/
You can download it from there and even run it live to see what it looks
like.
Virgil
Tobias Mayer wrote:
hello,
today i tried getting started with building my first birt report but
it is somehow more difficult than i thought.
my sample data (csv) contains the name of a person and a number
tim - 10
tim - 18
tim - 3
tim - 22
tim - 28
kai - 7
kai - 21
kai - 14
kai - 29
kai - 15
kai - 23
kai - 23
i like to get a bar chart comparing both persons and looking like this:
- X-Axis should have steps 1-10, 11-20, 21-30, ... and there at each
step there should be one bar for each person
- Y showing how often some nummer of the x-range occured
- at X 1-10 tims bar should have a y-value of 2 (because of
numbers 3 and 10)
- at X 1-10 kais bar should have a y-value of 1 (because of the 7)
should look like this for the sample data above
first bar is for kai
second bar is for tim
----- fixed with font -----
4 | - - - - x -
3 | - - - - x -
2 | - x x - x x
1 | x x x x x x
--+-----------------------
| 1-10 11-20 21-30
---------------------------
i hope you unterstand what i mean ...
it would be really nice if someone could create such a report for me
so i can see how it is done.
TIA
Tobias Mayer