Skip to main content
ArturoMuñoz
Employee
Employee

QlikView Standard Visualization objects have much more to offer than standard out of the box settings. This is why data centric apps developers love QlikView so much, because you can dig into every object properties expanding their usage case scenarios.

This is the case of the line chart; probably one of the oldest visualization methods available. It´s a pretty simple and straightforward way to represent data - often used to visualize a trend in data over intervals of time.


In-Chart Legend


This is a simple space saver trick; it will help you to replace QlikView standard legend with a customized in-chart legend.

Look at the chart below. It represent sales in two countries US and UK. As you can see, we don't have too much space to plot the chart and the legend. QlikView will automatically adjust the chart area to the real state in the object. In this case that will make my chart area to be really small.

1.png

One approach could be to move the legend to the bottom. This will make my chart area much bigger, specially true for long label scenarios. On the other side, by reducing the Y axis the lines look much flatter, and in some situations that could mean that some users wont perceive small variations in the chart.

2.png

Remember: To move or/and size chart components as legends, text in charts, and chart area, press the Shift and Ctrl keys and keep them depressed while a chart is active. You will enter the chart layout edit mode.

In edit mode, thin red rectangles will appear around those components of the chart that can be sized or moved. Use the mouse drag and drop technique to move things around.

What can we do to get the best of both worlds?

Another alternative could be something like the chart below, where legends appear right next to the each line.

3.png

To tune a line chart to look like the image above, you will need to follow the next steps:

    1. Create a standard line chart as in the picture.

    2. Use one expression per line, we cannot use this method when the lines are created based on dimensions.
      4.png
    3. Use Dual()

      Duplicate each expression and set the definition to

      if(Num= max(totalNum),dual('US',[United States of America]))

      Where, Num is the dimension name,'US' will be the text displayed in the chart and [United States of America] is the number I calculated with my first expression.

    4. To finish, remember to check Symbol and Values on Data Points for the expression.
      5.png

Pros:

  • This method will allow you to create mini sparkline using standard line charts.
  • The most obvious advantage will be to get more space for your chart area.
  • Due to in context information, in-Chart legend style will allow users to quickly consume the chart. Users doesn't need to apart their eyes from the chart to read the legend.

Cons:

  • Lack of dynamism: you have to create one expression per line displayed, rather than letting QlikView to include new elements as they came to the data model.
  • In situations where multiple lines have to be displayed this method may create confusion by overlapping the legends labels.
  • Hard-coding expression is required.

I will post a second part on this topic with another trick soon, stay tuned!

Enjoy Qliking!

AMZ

PS: if you have tricks you want to share with our Community left us a comment

35 Comments
Not applicable

good one

0 Likes
1,920 Views
Not applicable

Hi..

I am also facing the same issue.

need to display the legends only have data.

0 Likes
1,920 Views
Not applicable

Hi Arturo,

In the below chart, how would I change my Y-axis (Count) to Regions (AME, EMEA & APJ)

Regards,

Arun.

sample.jpg

0 Likes
1,920 Views
Not applicable

Hi Rebecca,

would you be so kind to explain me a little more in detail how you came to this very cool result?

Thanks in advance

best regards

Peter

0 Likes
1,920 Views
Not applicable

Hi Peter - send me your email address and I will send you a file that shows you what I did to create it.  I would upload it here, but it won't let me attach the file.

0 Likes
1,964 Views
Not applicable

Hi Rebecca,

My work email is email peter.kormos@tele2.com

Thanks for your efforts!

Bests

Peter

Beste Grüße / Best regards

Peter Kormos

Credit Risk and Fraud Analyst

Communication Services Tele2 GmbH

In der Steele 39

40599 Düsseldorf

phone +49 (0)211-74 004-659

fax +49 (0)211-74 004-906

email peter.kormos@tele2.com

www.tele2.de<http://www.tele2.de/>

Amtsgericht Düsseldorf - HRB 36232

Geschäftsführer - Oliver Rockstein, Niklas Sonkin

Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige

Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese

Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this email

in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution

of the material in this e-mail is strictly forbidden.

0 Likes
1,964 Views
Not applicable

Hi Rebecca,

My work email is peter.kormos@tele2.com

Thanks for your efforts!

Bests

Peter

0 Likes
1,964 Views
Not applicable

Hi Rob,

Great contribution! I have checked that this expression requires that the number format is set to "Expression default". However, I would like that the axis are in % and it does not work with this number format. Is it possible to combine the dual expression and the axis in %?

Thanks,

Josep Ma

0 Likes
1,964 Views
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not sure without testing a specific example. Worst case, you can duplicate the expression as Arturo did in the original post.

-Rob

0 Likes
1,964 Views
Not applicable

Thanks! I'd like my dimension to be a temporal variable and it doesn't work. Any idea of how to solve it?

Thanks,

Josep Ma

0 Likes
1,964 Views