SFChart3D with PieSeries3D XBindingPath not reading values

I am using an SFChart3D with a PieSeries3D in WPF and while I am getting a correct rendering of the chart the xBindingPath is not reading the values for the labels.

The XAML is as follows :-

<Page x:Class="DemoApp.Pages.AnalyticsPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:chart="clr-namespace:Syncfusion.UI.Xaml.Charts;assembly=Syncfusion.SfChart.WPF"
      mc:Ignorable="d"
      d:DesignHeight="530" d:DesignWidth="870"
      Title="Analytics">
    <Grid x:Name="BG">
        <Rectangle x:Name="BRec" HorizontalAlignment="Center" Height="530" VerticalAlignment="Center" Width="870"/>
        
<chart:SfChart3D Name="PieChart" HorizontalAlignment="Center" Margin="0,10,0,10" VerticalAlignment="Center" Visibility="Visible" >
            <chart:SfChart3D.Legend>
                <chart:ChartLegend ></chart:ChartLegend>
            </chart:SfChart3D.Legend>
            <chart:PieSeries3D Name="DisplayPie" ListenPropertyChange="True" ItemsSource="{Binding}" LabelPosition="OutsideExtended" XBindingPath="DataLabel" YBindingPath="DataValue" HorizontalAlignment="Center" VerticalAlignment="Center" ShowTooltip="True" chart:ChartTooltip.EnableAnimation="True">
                <chart:PieSeries3D.AdornmentsInfo>
                    <chart:ChartAdornmentInfo3D ShowConnectorLine="True" ConnectorHeight="15" ShowLabel="True" SegmentLabelContent="XValue" AdornmentsPosition="Top" ShowMarker="True" SymbolStroke="#D9D9D9" Symbol="Ellipse"></chart:ChartAdornmentInfo3D>
                </chart:PieSeries3D.AdornmentsInfo>
            </chart:PieSeries3D>
        </chart:SfChart3D>
    </Grid>
</Page>
The .cs file reads as follows :-


public class AnalyticsData
    {
        public string DataLabel { get; set; }
        public double DataValue { get; set; }
    }
    public class AnalyticsDisplay
    {
        public IList<AnalyticsData> NUThisMonthDataList { get; set; }
        public AnalyticsDisplay()
        {
            NUThisMonthDataList = new List<AnalyticsData>();
        }
    }
public partial class AnalyticsPage : Page
    {
        public AnalyticsDisplay uDisplay = new AnalyticsDisplay();
        public AnalyticsPage()
        {
            InitializeComponent();
            AsyncContext.Run(GetData);
            ChangeData("Start");
            this.DataContext = uDisplay;
          }
private async Task GetData()
        {
            uDisplay.NUThisMonthDataList.Clear();
            AnalyticsData temp = new AnalyticsData();
            temp.DataLabel = "Responded";
            temp.DataValue = 365;
            uDisplay.NUThisMonthDataList.Add(temp);
            AnalyticsData temp2 = new AnalyticsData();
            temp2.DataLabel = "Not Responded";
            temp2.DataValue = 10;
            uDisplay.NUThisMonthDataList.Add(temp2);
        }
public void ChangeData(string action)
        {
            if (action == "Start")
            {
                DisplayPie.ItemsSource = uDisplay.NUThisMonthDataList;
                PieChart.Header = "Personal Notifications For This Month";
                PieChart.Visibility = Visibility.Visible;
             }
}


What we see is the values on the pie chart are perfect, but the labels which should be the xValue are showing as 0 and 1 not the string values in the data set. This also flows into the Chart legend where it only shows 1 icon for the first value but no label and nothing is displayed for the second value?

Any help pointing me in the right direction?


1 Reply

YP Yuvaraj Palanisamy Syncfusion Team April 18, 2022 01:33 AM UTC

Hi Richard,


We have analyzed your query and we have prepared the sample based on your provided code example, it was working fine at our end. We have attached the sample for your reference. Please find the sample from the below attachment.


If still you are facing the problem, please revert us the modified sample with issue reproduced state which will be helpful to serve you better solution at the earliest.

Output:

Regards,

Yuvaraj.


Attachment: Sample_ec5b68e9.zip

Loader.
Up arrow icon