0
this.PieSeries = new ObservableCollection<RevenueProperties>()
            {
                new RevenueProperties() { Items = "iTunes", Revenue = 6},
                new RevenueProperties() { Items = "Others", Revenue = 4},
                new RevenueProperties() { Items = "iPhone", Revenue = 48},
                new RevenueProperties() { Items = "iPad", Revenue = 21},
                new RevenueProperties() { Items = "Mac", Revenue = 18},
                new RevenueProperties() { Items = "iPod", Revenue = 2},
            };
        this.DataContext = this;

<Window.Resources>
        <DataTemplate x:Key="labelTemplate">
            <Grid>
                <TextBlock Text="{Binding Items}"/>
                <TextBlock Text="{Binding Revenue}"/>
            </Grid>
        </DataTemplate>
    </Window.Resources>

<Grid>
<Chart:PieSeries ExplodeIndex="0" ExplodeRadius="15" ExplodeAll="False" Palette="Custom" LabelPosition="Inside"
                                      ItemsSource="{Binding PieSeries}" XBindingPath="Items" YBindingPath="Revenue">

                    <Chart:PieSeries.AdornmentsInfo>
                        <Chart:ChartAdornmentInfo FontSize="9" ShowLabel="True" SegmentLabelContent="Percentage"
                                                       ShowConnectorLine="True" LabelTemplate="{StaticResource labelTemplate}"/>
                    </Syncfusion:PieSeries.AdornmentsInfo>
</Chart:PieSeries>

I try the above program textblock values doesn't bind anything, when i run this program get empty pie chart. Please help to resolve this binding problem

Shaminder Singh
  • 1,283
  • 2
  • 18
  • 31

1 Answers1

0

Have you implemented INotiFyProperty interface on your window code behind class? if not, implement Inotify... on your window and call the OnPropertyChanged method from the setter of PieSeries, Items and Revenue fields.

Check below link on detailed explanation of INotify... interface: http://www.codeproject.com/Articles/41817/Implementing-INotifyPropertyChanged

Priyanka
  • 368
  • 1
  • 3
  • 12