Custom Visual Interactivity to Display the Others Slice in the Pie Chart

This example demonstrates the Pie Chart that displays slices for data rows selected in the Grid, while unselected data comprises the Others slice.

screenshot

The dashboard is designed as follows:

  • The Grid does not act as master filter item.

  • The Pie Chart Argument data is bound to the calculated field whose expression include dashboard parameter.

  • The dashboard's hidden ParamSalesPerson parameter is a list of Sales Person names.

  • The calculated field OthersChartSalesPerson provides data for the chart's Argument and contains the following expression: Iif(?ParamSalesPerson Is Null, [Sales Person], Iif([Sales Person] In (?ParamSalesPerson), [Sales Person], 'Others'))

When the Dashboard Viewer loads the dashboard, DashboardViewer.DashboardItemVisualInteractivity event occurs.The code in the event handler specifies the selection mode.

When a user selects a row in the Grid, the DashboardViewer.DashboardItemSelectionChanged event occurs. The code in the event handler obtains filter values, assigns them to the dashboard parameters and stores the selection in the local variable.

Dashboard parameter values modification fires the DashboardViewer.DashboardItemVisualInteractivity event. The saved selection state is used to restore selected rows in the Grid.

Another approach to perform the same task involves Master Filtering. Review the How to Display the Others Slice in the Pie Chart example for more information.

Documentation