Qlik Community

Qlik Design Blog

All about product and Qlik solutions: scripting, data modeling, visual design, extensions, best practices, etc.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
Employee
Employee

When creating a chart in QlikView that has multiple expressions, a legend is created for each expression.  Sometimes, I find that the legend takes up too much space and I spend time trying to move it or adjust the wording in my expression labels so that they are not too long just so I can show my chart and gain as much real estate on my sheet as possible.  Now I have the option to turn the expression legends off but without them you will have no idea what the chart is showing.  So I explored other ways to show a legend without cluttering my sheet.  In the Social Media Data Analysis demo, I had several visualizations that compared six companies.  If I used the expression legend in the line chart and the bar chart (Tweets over time section), it would have taken up a lot of space and been a little redundant as seen in the image below.

Social Media 2.png

So instead, I added a silent legend to the Company List Box by adding Text Objects that corresponded to each company.  I set the style of the List Box to LED so that the companies were always listed in the same order and I added actions to the Text Objects so that users could make selections using either the company name or color.  This allowed me to remove the expression legends in my line and bar chart enabling me to show more of the data and it gave the charts a cleaner appearance.

Social Media.png

There are other examples of silent legends in the Asset Management and Help Desk Management demos.  In the Asset Management demo, the legend is defined in the asset class headings and coloring is reflected in the pie and bar charts.

Asset Management.png

The Help Desk Management demo uses the List Box as the legend and the respective colors in a straight table versus using the text.  This makes the various priorities easier to identify in the list.

Help Desk.png

I have written a technical brief on how a silent legend was created in these three demos.  Check it out.

17 Comments
Not applicable

Hi, i would ask if is possible , to limit or rename the legend in chart as below :

Company A = 1

Company B = 2

Company C = 3

0 Likes
1,998 Views
Employee
Employee

Yes, you can rename the Company field to something else if you like.  I recommend just being consistent in displaying this information in the app.

0 Likes
1,998 Views
Not applicable


Thanks Jennel for the answer, i just wanna know  if , having table, with

Train red

Train Blu

Train green

There would be the possibility to rename them in eg. TR , TB TG  only to reduce naming legend.

But i don't know how and i have not found anything around the community

From this link : http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/25/how-to-rename-fields

i found

FieldNameMap:
Mapping Load OldFieldName, NewFieldName From FieldNames ;
Rename Fields using FieldNameMap;

but i m not able to use it.

0 Likes
1,998 Views
Employee
Employee

You can use the Mapping Load statement and then use the ApplyMap function when loading the table. This will rename the contents on the table not the field names.

FieldNameMap:

Mapping Load

     OldFieldName,

     NewFieldName

From Table;

Load

     ApplyMap('FieldNameMap', Field) as Field

From Table;

Good luck!

0 Likes
1,998 Views
Creator III
Creator III

Hi all,

other method to use silent legend is Use Silent Legend with Cross Colors

0 Likes
1,998 Views