Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create a correct stacked bar chart with 'missing' values?

R. BuitenhuisJul 21 2017 — edited Jul 21 2017

I use the following query for a APEX 5.1.1 stacked bar chart:

select 2015 as label, 'Rent' as series, 548 as value from dual

union

select 2016, 'Rent', 553 from dual

union

select 2017, 'Rent', 561 from dual

union

select 2016, 'Car', 7385 from dual

union

select 2015, 'Furniture', 1673 from dual

union

select 2017, 'Furniture', 2385 from dual

As you can see there are no values for 'Car' in 2015 and 2017 and no value for 'Furniture' in 2016.

The chart I get looks like this:

Demo wrong stacked bar.png

This is not what I expected. So what am I doing wrong?

When I add the missing values using this query:

select 2015 as label, 'Rent' as series, 548 as value from dual

union

select 2016, 'Rent', 553 from dual

union

select 2017, 'Rent', 561 from dual

union

select 2015, 'Car', 0 from dual

union

select 2016, 'Car', 7385 from dual

union

select 2017, 'Car', 0 from dual

union

select 2015, 'Furniture', 1673 from dual

union

select 2016, 'Furniture', 0 from dual

union

select 2017, 'Furniture', 2385 from dual

Then I get the correct chart:

Demo right stacked bar.png

Is there a way to accomplish this without adding the 'missing'values?

This post has been answered by Hilary Farrell-Oracle on Jul 21 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2017
Added on Jul 21 2017
3 comments
558 views