Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Filter Box selected value as parameter in chart metric #11345

Closed
fedecere94 opened this issue Oct 20, 2020 · 2 comments
Closed

Use Filter Box selected value as parameter in chart metric #11345

fedecere94 opened this issue Oct 20, 2020 · 2 comments
Labels
enhancement:request Enhancement request submitted by anyone from the community

Comments

@fedecere94
Copy link

I have the following environment (a dashboard with a Table Chart):

Database Table (the one the chart refers to):

  name     A     B     C     D
 --------------------------------
    x      1     0     0     1
    y      1     1     1     1  
    x      0     0     0     1
    y      1     1     0     1   

Table Chart:

name     SUM(A)
-----------------
  x         1
  y         2

What I want to do is:

add a FilterBox with the Column A, B, C, D of the table like choices and when the choice X (a generic one between the four choices previously cited) is selected, the second column of the chart should show SUM(X)

In few words: I want to change the metric of a chart based on a filter Box value

Is this possible?

@issue-label-bot issue-label-bot bot added the enhancement:request Enhancement request submitted by anyone from the community label Oct 20, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label #enhancement to this issue, with a confidence of 0.76. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@fedecere94
Copy link
Author

I finally found the solution by myself. I used filter_values macro that can read the filter values through the analysis of the url parameter form_data (in which all of your filter are stored).
See #5547 to better understand how the filter_values macro work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement:request Enhancement request submitted by anyone from the community
Projects
None yet
Development

No branches or pull requests

1 participant