Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
y-series grouping in stacked bar chart
jimtonic
Hi,
I am new to BIRT (version 2.3.1) and wonder how can I group different axises values
My situation is:
I have dataA, dataA' , dataB and dataB' and id
I want to plot a graph that id is on x-axis
while dataA and dataA' are on a Stacked Bar, and dataB and dataB' is on other Stacked Bar.
but how?
Any help or hint is highly appreciated.
Find more posts tagged with
Comments
mwilliams
Hi jimtonic,
Am I understading correctly? You want to have a single chart with 4 series with 2 in one bar and 2 in another right next to it for each "id"?
jimtonic
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>Hi jimtonic,<br />
<br />
Am I understading correctly? You want to have a single chart with 4 series with 2 in one bar and 2 in another right next to it for each "id"?</p></blockquote>
<br />
<br />
Yes. Thanks for your help.
KaiWeing
Hi jimtonic,
What does your data layout look like? How does it differentiate between dataA and dataA'?
I suppose you would use id as the category series and ' or not ' as grouping if your data layout allows that.
E.g. if this is your data layout:
id, '-flag, amout
Then you use amount as value series, id as category series and '-flag as grouping series.
Hope that helps, Kai
jimtonic
<blockquote class='ipsBlockquote' data-author="KaiWeing"><p>Hi jimtonic,<br />
<br />
<br />
What does your data layout look like? How does it differentiate between dataA and dataA'?<br />
I suppose you would use id as the category series and ' or not ' as grouping if your data layout allows that.<br />
<br />
E.g. if this is your data layout:<br />
id, '-flag, amout<br />
Then you use amount as value series, id as category series and '-flag as grouping series.<br />
<br />
Hope that helps, Kai</p></blockquote>
<br />
<br />
Thanks for your reply.<br />
<br />
For your last suggestion, it seems that there is a common property (value) like a '-flag to group relevant fields together. right ?<br />
<br />
This is my stupid table<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
--
-- Table structure for insp_cln_lvl
--
DROP TABLE IF EXISTS `insp_cln_lvl`;
CREATE TABLE `insp_cln_lvl` (
`bld_flr_rm_id` char(8) COLLATE utf8_bin NOT NULL,
`inspect_date` datetime NOT NULL,
`eac_ceiling_val` float NOT NULL COMMENT 'Actual EAC Value',
`dac_ceiling_val` float NOT NULL,
`eac_floor_val` float NOT NULL,
`dac_floor_val` float NOT NULL,
`eac_inventory_val` float NOT NULL,
`dac_inventory_val` float NOT NULL,
`eac_wall_val` float NOT NULL,
`dac_wall_val` float NOT NULL,
`eac_ceiling_resu` float DEFAULT NULL COMMENT 'After running myModel, the eac score',
`dac_ceiling_resu` float DEFAULT NULL,
`eac_floor_resu` float DEFAULT NULL,
`dac_floor_resu` float DEFAULT NULL,
`eac_inventory_resu` float DEFAULT NULL,
`dac_inventory_resu` float DEFAULT NULL,
`eac_wall_resu` float DEFAULT NULL,
`dac_wall_resu` float DEFAULT NULL,
PRIMARY KEY (`bld_flr_rm_id`,`inspect_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
</pre>
<br />
Say <br />
A = eac_ceiling_val (the actual value)<br />
A' = eac_ceiling_resu (the result value)<br />
B = dac_ceiling_val (the actual value)<br />
B' = dac_ceiling_resu (the result value)<br />
<br />
I want to compare A with A' whereas B with B' at the same time. I have read an example from <br />
<br />
<br />
combinationchart.html<br />
<a class='bbc_url' href='
http://download.eclipse.org/birt/downloads/examples/reports/2.1/combochart/combinationchart.html'>Created
by Camtasia Studio 3</a><br />
<br />
highlighting.html<br />
<a class='bbc_url' href='
http://download.eclipse.org/birt/downloads/examples/reports/2.1/highlighting/highlighting.html'>Created
by Camtasia Studio 3</a><br />
<br />
I wonder how I can do the similar thing.
KaiWeing
Hi jimtonic,
ok, looks like your data layout makes things a little difficult. You have all four values in one row, is that right?
It would be easier if your layout would be more like this (with better names, though):
ac-type: eac, dac
what: floor, celing
content-type: actual, result
amout: the value
then you could use amout as value series, ac-type as category and content-type as grouping (and filter by celing if that is the only one you want to see).
I'm not sure if you can create a grouping for more than one field one series.
Kai
jimtonic
Hi Kai,
Thanks.
I have learnt one thing that grouping a set of data needs common value (-flag).