Yesterday i spotted a question on QlikView Community forum regarding putting dimension labels inside the bars they represent. It was an interesting question because i never had in mind to do such a solution (different customers – different designs ). The “challenge” was from two parts – put labels inside bars and this label to be on the bottom.
1. Labels in bars (no matter the position)
Lets imagine that the data look like:
[table id=1 /]
And the bar chart will have as dimension “Fruit” and as expression
In “Presentation” tab in “Values on Data Points” section check “Vertical” and “Plot Values Inside Segments” and uncheck “Show Legend”. The result is shown bellow:
As you can see the labels are automated positioned in the middle of the bar but when the text is bigger than bar itself no text is shown. The second approach is a little different as realization but will show the text no matter the bar size.
2. Labels in bars (with calculated position)
The data is the same but the chart type is ”Combo Chart”. Dimension is still Fruit and there is two expressions:
sum(Qty) (set as Bar and unchecked “Values on Data Points”)
Dual(Fruit, sum(0.1))(set as “Invisible”, “Symbol” and checked ”Values on Data Points”)
The second expression is actually the displayed label. 0.1 in sum(0.1) is the position of the labels ( it is the offset from the 0 of the axis). The label can be extended with number of Qty and the expression will be:
Dual(Fruit & ' (' & sum(Qty) &')', sum(0.1))
And the result chart is:
As you can see all labels and quantity values are shown.