Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
W2019
New Contributor

Color of labels on lines in line chart and data points

Hi there,

In below screenshot a part of a linechart with the labels at the end of the line, using a dual function in the expression.

Can anyone help me with below two questions?

1. Is there a way to change the color of the label? In the dual function itself? I'd like them to have the same color as the line it belongs to (2019 should be blue).

2. Is there a way to get rid of the datapoints? In the chart properties I have to check the "show datapoints" in order to show the datalabels (in this case only at the end), but I only need the two datalabels.

clipboard_image_0.png

Thanks for helping out!

 

3 Replies
Highlighted
Partner
Partner

Re: Color of labels on lines in line chart and data points


1.use master items-> measures->Create New then copy and paste the function used here and pick the color you needed 
Then replace the already created function with newly created measure

2. There is no default function  to showcase the way needed but you can uncheck show data points and use show legend under colors and legends option.

 

Highlighted
W2019
New Contributor

Re: Color of labels on lines in line chart and data points

Thank you for your reply.

1. I already use master items, measures. Here I can set the color of the line, but it does not effect the color of the datalabels, I'd like to color the datalabel "2019" in blue in correspondance to the line it belongs to.

In the masteritem I use a dual function, see below.

'2019' is the datalabel. Is there a way to give this label a color within the dual function itself, maybe?

DUAL(IF( Period=MAX(TOTAL(Period)), '2019',  ''),(<<expression>>))

2. In this case I don't want to use the legend but label the lines directly. But because I want a focus on overall trends in stead of details I like to get rid of the datapoints, but not the label. It appears to me that datapoints is a prerequisite for the appearance of datalabels. Is there a way to go round this?

Thanks for your help!

 

 

Highlighted
ststoian
New Contributor

Re: Color of labels on lines in line chart and data points

 How did you obtain that graph in the first place? I am struggling with labeling the end of the line with the year and not with the value of the last month.

 

This is the function that I am using:

Dual(
If([Date.autoCalendar.Month] = Max(total [Date.autoCalendar.Month]),TEXT(YEAR(Date)), ''),
Sum(Value)
)

and I get this.aaaaaaaa.PNG