This example demonstrates the Pie Chart that displays slices for data rows selected in the Grid, while unselected data comprises the Others slice.
The dashboard is designed as follows:
-
The Pie Chart does not take part in master filtering. It has the Ignore Master Filter option enabled. The Pie Chart gets data from the calculated fields whose expressions include dashboard parameters to filter data.
-
The dashboard's hidden ParamSalesPerson parameter is a list of Sales Person names. The hidden ParamRangeStart and ParamRangeEnd parameters contains the start and end values selected in the Range Filter.
-
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'))
-
The calculated field ChartRangeExtPrice provides data for the chart's Value and contains the following expression:
Iif(?ParamRangeStart Is Null, [Extended Price], Iif([OrderDate] Between(?ParamRangeStart, ?ParamRangeEnd), [Extended Price], 0))
When a user selects a row in the Grid, the MasterFilterSet event occurs. The code in the event handler obtains filter values and assigns them to the dashboard parameters. When the user executes the Clear Master Filter command, the MasterFilterCleared event occurs. The event is handled to clear parameters by assigning null to the parameter's SelectedValues.
Another approach to perform the same task involves a custom visual interactivity instead of Master Filtering. Review the Custom Visual Interactivity to Display the Others Slice in the Pie Chart example for more information.
- WinForms Dashboard Viewer
- Interactivity
- Pies
- Dashboard Parameters
- WinForms Viewer - Manage Dashboard Parameters
- How to: Pass a Dashboard Parameter to a Calculated Field's Expression in Code
- How to: Pass a Dashboard Parameter to a Custom SQL Query in Code
- How to: Pass a Hidden Dashboard Parameter to a Custom SQL Query in the WinForms Viewer
- How to: Specify Default Parameter Values in the WinForms Viewer
- How to: Use Dashboard Parameters with the Expression Format Condition
- How to: Manage Parameters in the WinForms Viewer
(you will be redirected to DevExpress.com to submit your response)