Skip to end of metadata
Go to start of metadata

Enabling Data Point Selection

Selection in UXChart can be enabled by setting the CanUserSelect property to True. You can also control the selection individually in each series, by setting the same property that available in each series types.CanUserSelect property in each series has higher precedence than CanUserSelect property in UXChart. If you do not set the property in each series, it will use the one specified in UXChart , on contrary in you set the CanUserSelect property in the series it will override the one specified in UXChart.

On this page:

XAML

There are six selection modes that you can choose from.

  • Single

    User can select only one data point at a time across all series

  • Extended

    User can select multiple data point across all series using Ctrl Modifier.

  • Multiple

    User can select multiple data point across all series.

  • Single Per Series

    User can select one data point at a time per each series. In other words you might see multiple items selected across all series, but each series will have only one item selected at a time.

  • Extended Per Same Series

    User can select multiple data point per same series by using Ctrl Modifier. Whenever user select a data point from other series, the selection on the previous series will be cleared.

  • Multiple Per Same Series

    User can select multiple data point per same series by using Ctrl Modifier. Whenever user select a data point from other series, the selection on the previous series will be cleared.

Understanding Selected Item and Selected Items

Depending on the selection mode you choose, all the selected data point will be stored in SelectedItem property and SelectedItems property. The SelectedItem property contains the last item that user select, while SelectedItems hold all item that user select in the order of user selection. Note that these properties are available in UXChart and all series type. In each series the properties will contain if and only if the data points belong to that series are selected, while the properties in UXChart will hold all selected data point across all series.

Furthermore you can also specify the SelectedItem and SelectedItems from view model; the UXChart will update the selected data point accordingly based on the specified value.

Understanding Data Point Selection Behavior

In general you can select the data point by clicking directly at the data point. However some series has rather small shape data point such as; LineSeries family, AreaSeries family, ScatterSeries, RadarSeries, PolarSeries, and BubbleSeries. For these series you can enable nearest data point tracker to highlight which data point is currently nearest to your mouse proximity. When the data point is highlighted you can directly click it and the data point will be selected.

To learn more about nearest data point tracker see the section below.

Understanding Data Point Selection State

When the data point is selected it will change the state from Unselected to Selected. You can control the look and feel when the data point selected from the visual state that available in each data point control template as follows.

XAML

Furthermore for some series such as PieSeries and DoughnutSeries, their states are also changed to Exploded when the data point is selected.

XAML

Enabling Data Drilling

To enable data drilling you need to create two or more UXChart in your page. The main chart should have Child property set to the UXChart instance of the next level in your drill down structure.

XAML

Note that it is advisable to set the Visibility property of other charts except main chart to Collapsed to improve the performance.

With the following configuration you can then handle the drill down gracefully through DrillDownCommand. To learn more about configuring data drill down, see How-to: Enable Data Drill Down.

Learn More

To learn more about the concepts and more advanced features of the charting control, please refer to the following topics.