# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor

## Issue turning on legend on a bar chart

Hi all,

When coloring by expression a stacked bar chart, the legend options stop being displayed. Does anyone have any idea why? I must provide the user with legend and I'm not being able to do it.

Thank you!

1 Solution

Accepted Solutions
Luminary

## Re: Issue turning on legend on a bar chart

First you would create the Dimension (in your case it will be "InventoryFrozenWrapPeriod"):

then click  "add dimension" then "Done"

Then Edit the Dimension:

now you can set colors by each dimensional value.

5 Replies
Luminary

## Re: Issue turning on legend on a bar chart

When using an expression to apply color, there is no longer a legend.  A great solution to this is to create a Master Dimension an apply the color in the master item.  same principle works if you're coloring by measure.  The trick is to create the measure/dimension then re-edit the item to have the ability to adjust the color.

Contributor

## Re: Issue turning on legend on a bar chart

Thank you Joe. I can color measures in master items... but not dimensions. How do you would you do it?

Actually, i've tried to create a dimension on master items with this expression

=if(InventoryFrozenWrapPeriod='', rgb(208,120,87),

if(InventoryFrozenWrapPeriod='>12_MONTH',rgb(221,157,131),

if(InventoryFrozenWrapPeriod='6-12_MONTH',rgb(236,201,187),

if(InventoryFrozenWrapPeriod='2-6_MONTH',rgb(166,133,83),

if(InventoryFrozenWrapPeriod='1-2_MONTH',rgb(196,173,138),

if(InventoryFrozenWrapPeriod='0-1_MONTH',rgb(219,205,185)))))))

but it doesn't work...

Instead of using a chart with 1 measure and 2 dimension, i could use 1 dimension and x measures (defined on master items where I can color them), but that would take me too much time...

Luminary

## Re: Issue turning on legend on a bar chart

First you would create the Dimension (in your case it will be "InventoryFrozenWrapPeriod"):

then click  "add dimension" then "Done"

Then Edit the Dimension:

now you can set colors by each dimensional value.

Contributor

## Re: Issue turning on legend on a bar chart

Thank you Joe! That's probably and earlier version than the one I'm using... Thank you.

Luminary