Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change the border color of bar chart on filtering

Hi,

I am having 2 filters and 3 bar charts.

For Suppose,if i select any one of the filter 2 of my bar charts get effected.

Here, I want to highlight the border color of the bar charts which get effected on selection of the filter.

Can anyone help with this?

Thanks in advance.

1 Solution

Accepted Solutions
rahulpawarb
Specialist III
Specialist III

As a workaround follow below steps:

1. Create a variable vFilterSelection and set 0 as value

2. Document Properties (Alt + Ctrl + D) -> Triggers tab -> Field Event Triggers

    Add action on Select for the filter fields (Set Variable - vFilterSelection to 1)

3. Open Chart Properties and locate Layout tab click on Colors under Use Borders

    Add If(vFilterSelection, Green(), Black()) as an expression for Calculated field under Base Color section

4. Add a Button to clear the selection as well as add an action to reset the variable vFilterSelection (set to 0)

Hope this will help.

Regards!

Rahul Pawar

View solution in original post

8 Replies
prma7799
Master III
Master III

Could you please share some sample app?

qv_testing
Specialist II
Specialist II

use this Background color in expression.

X = Your Dimension

Expression should be full set like

Sum({1} Measure)  or Count({1} Measure)

BackGround  Expression:

=if(GetPossibleCount(X)<>count({1}distinct Total X),

if(match(X,concat(distinct X,',')),

RGB(160,205,120),RGB(239,238,210)))

Anonymous
Not applicable
Author

Hi Raju,

Thanks for the reply.

But,this is not the solution i need.I want to change the border color of my object i.e., bar chart but here, it is changing the color of the bars in the bar chart.

rahulpawarb
Specialist III
Specialist III

As a workaround follow below steps:

1. Create a variable vFilterSelection and set 0 as value

2. Document Properties (Alt + Ctrl + D) -> Triggers tab -> Field Event Triggers

    Add action on Select for the filter fields (Set Variable - vFilterSelection to 1)

3. Open Chart Properties and locate Layout tab click on Colors under Use Borders

    Add If(vFilterSelection, Green(), Black()) as an expression for Calculated field under Base Color section

4. Add a Button to clear the selection as well as add an action to reset the variable vFilterSelection (set to 0)

Hope this will help.

Regards!

Rahul Pawar

Anonymous
Not applicable
Author

Hi Rahul,

Thanks for the help.

It works fine but i don't want to create a button to clear the selection.

Is there any other alternative for that?

Thanks in advance.

rahulpawarb
Specialist III
Specialist III

Thank you for your response.

If you don't want the button functionality then use below expression for Calculated field under Base Color section.

=If(GetSelectedCount(Category) > 0 OR GetSelectedCount(Product) > 0, Green(), Black())

Hope this will help.

Regards!

Rahul Pawar

Anonymous
Not applicable
Author

Thank you Rahul.

It works great.

rahulpawarb
Specialist III
Specialist III

Cheers!

Rahul Pawar