Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Stars
Creator
Creator

Opacity on a Stacked Bar Chart

I am trying to find a way to highlight a bar, based on a selection in a filter pane, in a stacked bar chart.  Color by expression works well for me on simple bars, but not on stacked bars because it wipes out all the different colors indicating the different pieces of my stacked bar.  I am attaching a qvf this time, in case that helps at all!  If there's any way to highlight a bar, that would be great.  Opacity was my first goal, but if there's a way to outline or have an arrow appear or.... anything that would be great.  Please let me know if you have questions.  Thank you!

3 Replies
rwunderlich

I can get you partway there in the attached qvf. 

1. It would be best to map the various PermID values into a new field like "Product Category" instead of using separate measures for each PermID of interest. Look at the table I added in the script. I only mapped 4 PermID, but you'll get the idea.

2. Look at my chart on the "Cost of Products (1)" sheet.  I've added the new field "Product Category" as a second dimension.  Now there is a single measure. To simplify, I removed some of your measure expression logic -- I didn't understand exactly what it's doing, but it seemed the only variation between measures was PermID which is now a dimension. You can try adding back the additional logic once you get the color logic sorted. 

3. You'll see that selecting a single bar fades the colors as you requested.  Unfortunately, when using "color by expression", QS will not generate a legend.  So I made a fakey legend using a table which is not optimal.

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Stars
Creator
Creator
Author

Ooooh, this is so cool!  Thank you!

I have to click through it for a while before I'll really understand what you did.  Right now I can't even figure out how your bar chart, in edit mode under data, has a "stack" and "bar" option for the primary dimensions.  Is it just a normal bar chart?  Mine doesn't have "stack"!  But I'll get there.  It looks amazing and thank you so much for doing this!!!!

(More comments after I figure out what you did!).

rwunderlich

Yes, it is a standard bar chart.  The Stack/Grouped options is under Appearance -> Presentation. 

-Rob