https://github.com/syncfusionexamples/how-to-use-the-drill-down-functionality-in-uwp-charts
This sample describes us to know the drill down functionality to get the another chart series from select segment
https://github.com/syncfusionexamples/how-to-use-the-drill-down-functionality-in-uwp-charts
chart charts drill-down drill-down-chart uwp-chart
Last synced: about 2 months ago
JSON representation
This sample describes us to know the drill down functionality to get the another chart series from select segment
- Host: GitHub
- URL: https://github.com/syncfusionexamples/how-to-use-the-drill-down-functionality-in-uwp-charts
- Owner: SyncfusionExamples
- Created: 2020-11-03T12:58:12.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-08T09:59:45.000Z (10 months ago)
- Last Synced: 2025-02-12T20:43:24.950Z (4 months ago)
- Topics: chart, charts, drill-down, drill-down-chart, uwp-chart
- Language: C#
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How-to-use-the-drill-down-functionality-in-UWP-Charts
The drill-down is a capability that takes the user from a more general view of the data to a more specific one at the click of a mouse. It also gives the user the ability to see data and information in more detail with different styles.
[Syncfusion SfChart in UWP platform](https://help.syncfusion.com/uwp/charts/getting-started) has achieved this drill down functionality with help of its [SelectionChangedEvent](https://help.syncfusion.com/uwp/charts/interactive-features#events-3) and its way populating the data to the chart with considering the below use case.
In automobile sales concept, initial chart representation is about the list of automobiles (Pie chart representation) and each segment tap, leads to have a variety of its brands list (Column chart representation).The following steps will guide you how to achieve this expected functionality,
**Step 1: Define the chart with list of automobiles collection.**
```
```
*Here Data represents the collection of models which has name of automobile variety and its count values.***Step 2: Drill-down functionality observed concepts.**
```
private void chart_SelectionChanged(object sender, ChartSelectionChangedEventArgs e)
{
IList items = e.SelectedSeries.ItemsSource as IList;
if (e.SelectedIndex != -1)
{
//Set the current window content from navigated page which is representing the chart with detailed
Window.Current.Content = new SecondPage(items[e.SelectedIndex] as Model);//To get back to initial page, enable the back button with the help of SystemNavigationManager's AppViewBackButtonVisibility.
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;//Once back button click to view the entire automobile list then, it will keep the content of window as main page
SystemNavigationManager.GetForCurrentView().BackRequested += (s, r) =>
{
Window.Current.Content = new MainPage();
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
};
}
}
```
**Step 3: Declaration of navigated page and its data populated ways.**```
```
```
public sealed partial class SecondPage : Page
{
//SelectedModel represents the collection of automobile variety list
public Model SelectedModel { get; set; }
public SecondPage(Model selectedDatapoint)
{
InitializeComponent();SelectedModel = selectedDatapoint;
}
}
```
## Output
## See also
[How to add multiple legend items in scroll viewer in UWP Chart](https://www.syncfusion.com/kb/11671/how-to-add-multiple-legend-items-in-scroll-viewer-in-uwp-chart)
[How to get a notification when the legend items are clicked in UWP Chart](https://www.syncfusion.com/kb/11673/how-to-get-a-notification-when-the-legend-items-are-clicked-in-uwp-chart)
[How to bind the SQL Database in UWP Chart](https://www.syncfusion.com/kb/11664/how-to-bind-the-sql-database-in-uwp-chart)
[How to bind the JSON data in UWP Chart](https://www.syncfusion.com/kb/11628/how-to-bind-the-json-data-in-uwp-chart)