Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Show/Hide values on line chart on button click

I have a line chart and what I am trying to do is to show/hide values for data points in the line chart when user check/uncheck a checkbox. How can I do this? Is it possible in QlikView 11?

1 Solution

Accepted Solutions

Re: Show/Hide values on line chart on button click

Try now

Capture.PNG

6 Replies
antoniotiman
Honored Contributor III

Re: Show/Hide values on line chart on button click

Hi Tony,

create Variable like vShowValue and

use Show Values option

Re: Show/Hide values on line chart on button click

Like this?

With check box not selected

Capture.PNG

With check box selected

Capture.PNG

Settings 1 -> Add a show value condition like this -> =If(GetSelectedCount(Dim) = 0, RowNo() = 0, 1=1)

Here Dim is a field created in the script like this

Dim:

LOAD * Inline [

Dim

Show Values

];

Capture.PNG

Settings 2 -> Uncheck 'Values on Data Points'

Capture.PNG

Not applicable

Re: Show/Hide values on line chart on button click

Your example is great! but I would like to do it using a variable and a text object, that is:

I have a variable, let's say, 'ShowValues', and I set this variable to 1 or 0 when user clicks on the text object, so when user click on it:

  • I set 'ShowValues' to 0 if current value of 'ShowValues' is 1 and I set background color for text box to white
  • I set 'ShowValues' to 1 if current value of 'ShowValues' is 0 and I set background color for text box to green

so in the text object properties, in actions tab, I have defined an action to set the variable "ShowValues" with value:

=If($(ShowValues)=1,0,1)

In order to check the value of 'ShowValues' variable I have created another text object and I set its text to:

=$(ShowValues)


but this shows: error in the expression. too complex,more than 100 levels nesting.


Finally in chart expression, I set definition for Show Value property as Antonio Mancini said to:

=ShowValues=1


but seems to not work.

antoniotiman
Honored Contributor III

Re: Show/Hide values on line chart on button click

Have You unchecked

Value on Data Point for Your Expression ?

Re: Show/Hide values on line chart on button click

Try now

Capture.PNG

Not applicable

Re: Show/Hide values on line chart on button click

At the same time you, Sunny, was answering and providing a new example, I was solving it using a combination of both explanations, that indicated for Antonio Mancini and you, Sunny.

I have done the following (as you, Sunny, in your great example):

  • In the text object properties, in actions tab, I have defined an action to set the variable "ShowValues" with value:

        =If(ShowValues=1,0,1)

        instead of:

        =If($(ShowValues)=1,0,1)

  • In order to check the value of 'ShowValues' variable I have created another text object and I set its text to:

        =ShowValues

        instead of:

        =$(ShowValues)


  • And finally, in chart expression, I set definition for Show Value property as Antonio Mancini said to:

        =ShowValues=1


     Value on Data Point for expression was already unchecked.

So both have helped me a lot. Antonio Mancini by pointing me in the right direction at the beginning and you, Sunny, for your great detailed explanation through your magnific examples So both answers are correct but I have to choose one as correct... So as Sunny example is more detailed and complet and last one is what I want, I have choose Sunny answer as the correct.

Once more, thanks both for you great and quickly support.