Visualization: Reflect group-by selection via legend in callback query

Bernd Kallweit
Mega Expert

In visualizations like 'donut' I can show a legend, which users can use to temporarily hide group-by segments. Doing this would also adjust the 'totals' shown. However, when the user clicks on the 'total', the 'Visualization Clicked' event does not properly reflect the situation, which is confusing. E. g.

BerndKallweit_0-1699894339892.png

In this case, the payload would be 

{"params":{"listTitle":"My CIs","dataSourceType":"table","table":"cmdb_ci","query":"support_groupDYNAMICd6435e965f510100a9ad2572f2b47744"},"title":"My CIs","data":{"value":54,"elements":[null],"groupBy":["Class"]},"nativeEvent":{"isTrusted":false}}

 

Is there a way to have the query reflect that some (in this case) classes have been deselected?
E. g., by adding something like "^sys_class_name!=cmdb_ci_printer^ORsys_class_name!=cmdb_ci_server ..." to the query.

 

When the user selects a single segment in the donut, this gets reflected in the query properly, e. g., 

{"params":{"listTitle":"My CIs","dataSourceType":"table","table":"cmdb_ci","query":"support_groupDYNAMICd6435e965f510100a9ad2572f2b47744^sys_class_name=cmdb_ci_printer"},"title":"My CIs","data":{"value":28,"elements":["Printer"],"groupBy":["Class"]}}

 

This is on Utah.

 

1 REPLY 1

Dibyaratnam
Tera Sage

When you click on those legends, they don't call any events OOB. so those values/properties are not stored anywhere. So can't be used while opening the count in list as you can't set that selections in the query.