/how-to-display-pie-chart-others-slice

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

Primary LanguageVisual Basic .NETOtherNOASSERTION

Dashboard for WinForms - How 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 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.

Files to Review

Form1.cs / Form1.vb

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)