Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

mahendra6605
New Contributor II

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
Valued Contributor II

Re: Change the border color of bar chart on filtering

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

8 Replies
prma7799
Honored Contributor III

Re: Change the border color of bar chart on filtering

Could you please share some sample app?

qv_testing
Valued Contributor

Re: Change the border color of bar chart on filtering

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)))

mahendra6605
New Contributor II

Re: Change the border color of bar chart on filtering

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
Valued Contributor II

Re: Change the border color of bar chart on filtering

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

mahendra6605
New Contributor II

Re: Change the border color of bar chart on filtering

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
Valued Contributor II

Re: Change the border color of bar chart on filtering

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

mahendra6605
New Contributor II

Re: Change the border color of bar chart on filtering

Thank you Rahul.

It works great.

rahulpawarb
Valued Contributor II

Re: Change the border color of bar chart on filtering

Cheers!

Rahul Pawar

Community Browser