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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I display the ValueMemberPath without using the Tooltip?

Thread ID:

Created:

Updated:

Platform:

Replies:

147838 Sep 25,2019 12:48 PM UTC Sep 26,2019 11:35 AM UTC Xamarin.Forms 1
loading
Tags: SfSunburstChart
Matthew Bailey
Asked On September 25, 2019 12:48 PM UTC


Ultimately my ideal solution would be to show the ValueMemberPath in the Legend along with the Category name itself, but if that's not possible, then I would like to have a way to display the selected value (and hierarchical children below it if possible).

Can someone help me figure this out?

Bharathiraja K [Syncfusion]
Replied On September 26, 2019 11:35 AM UTC

Hi Matthew, 
 
Greetings from Syncfusion.  You can show the ValueMemberPath in label using the SelectionChanged event. This event occurs whenever you select the segment and get the SelectedSegment details (ValueMemberPath) as argument. Please find the code snippet below, 
 
[XAML]: 
<sunburst:SfSunburstChart x:Name="sunburstChart" ItemsSource="{Binding DataSource}" 
                                  ValueMemberPath="EmployeesCount" SelectionChanged="SunburstChart_SelectionChanged"> 
</sunburst:SfSunburstChart> 
 
 
[C#] 
private void SunburstChart_SelectionChanged(object sender, Syncfusion.SfSunburstChart.XForms.SelectionChangedEventArgs e) 
        { 
            if (e.SelectedSegment != null) 
            { 
                stackLayout.IsVisible = true; 
 
                if (!e.IsSelected) 
                { 
                    stackLayout.IsVisible = false; 
                } 
 
                if (e.SelectedSegment.CurrentLevel == 0) 
                { 
                    countryLabel.Text = "Continent: " + e.SelectedSegment.Category; 
                    populationLabel.Text = "Employee Count: " + e.SelectedSegment.Value; 
                } 
                else if (e.SelectedSegment.CurrentLevel == 1) 
                { 
                    countryLabel.Text = "Category: " + e.SelectedSegment.Category; 
                    populationLabel.Text = "Employee Count: " + e.SelectedSegment.Value; 
                } 
                else if (e.SelectedSegment.CurrentLevel == 2) 
                { 
                    countryLabel.Text = "Designation: " + e.SelectedSegment.Category; 
                    populationLabel.Text = "Employee Count: " + e.SelectedSegment.Value; 
                } 
                else  
                { 
                    countryLabel.Text = "Platform: " + e.SelectedSegment.Category; 
                    populationLabel.Text = "Employee Count: " + e.SelectedSegment.Value; 
                } 
            } 
        } 
 
 
Please download the sample from the below link.  
 
UG document link: 
 
Please find the attached sample. 
 
Regards, 
Bharathi.  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

Live Chat Icon For mobile
Live Chat Icon