We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to achieve series drilldown behaviour in SfChart ?

Platform: WPF |
Control: SfChart |
Published Date: November 18, 2014 |
Last Revised Date: June 27, 2019 |
.NET Framework: 4.5 |
Product Version: 12.1.0.43

Drill-down functionality in chart is used to navigate from one chart to another. For example, in share analysis concept, initially all share names are displayed when you select a particular share to know more details about the share; it again generates a new chart that provides the further detailed information. This behavior is achieved in SfChart using the following code examples.

XAML

<syncfusion:SfChart x:Name="Chart" SelectionChanged="Chart_OnSelectionChanged">
    <syncfusion:SfChart.Behaviors>
        <local:ChartSelectionBehaviors/>
    </syncfusion:SfChart.Behaviors>
    <syncfusion:ColumnSeries Palette="Metro" SegmentSelectionBrush="Violet" XBindingPath="ShareDetails" YBindingPath="Count" ItemsSource="{Binding}"/>
</syncfusion:SfChart> 

C#

private void Chart_OnSelectionChanged(object sender, ChartSelectionChangedEventArgs e)
        {
            var d = e.SelectedSegment.Item as DataValues;
            switch (d.ShareDetails)
            {
                case "Royce":
                    this.GridParent.DataContext = new ViewModel();
                    break;
                case "Phantom":
                    this.GridParent.DataContext = new ViewModel();
                    break;
                case "Networks":
                    this.GridParent.DataContext = new ViewModel();
                    break;
                case "Infomak":
                    this.GridParent.DataContext = new ViewModel();
                    break;
                case "Reuiters":
                    this.GridParent.DataContext = new ViewModel();
                    break;
                default:
                    MessageBox.Show("No further drill down"); break;
            }
        }

Outputs

Chart series before drill down in WPF

Chart series after drill down in WPF

 

 

 

 

 

 

 

 

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon