How to refresh data resources in UI builder when click legend in pie chart data visualization ?

raajesh
ServiceNow Employee
ServiceNow Employee

Hi,

I am working on creating dashboard in UI builder and having multiple data visualizations. I want to make more interactive that if user clicks legend in pie chart it will affect all other charts based on data changing.

Can anyone help me with if there any options to handle events of data visualization when it changes?

Thank you

1 REPLY 1

JagjeetSingh
Kilo Sage
Kilo Sage

Hi,

 

This is how you can do this.

 

All data visualizations respond to parFilters state parameter on your page. This state parameter holds the filter queries for your reports.

 

Now, all you have to do is to add your filter query in this state parameter on click on your pie chart. The data visualization component emits an event on click. This event has the query parameter which you can use directly in your filter.

 

If you need more info on how you can add query in your filter, see this article.

Hope this helps. Happy coding.

 

 

 

 

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023