Pre loader

Donut Chart with binding, without MVVM

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

Hi
Here’s my XAML:

                <s:SciChartDonutSurface ChartTitle="Times Distribution" ItemsSource="{Binding TimeGroups}">
                    <s:SciChartDonutSurface.ItemTemplate>
                        <DataTemplate DataType="s">
                            <s:DonutSegment SegmentValue="{Binding Path=Duration}" Text="{Binding Path=Name}"/>
                        </DataTemplate>
                    </s:SciChartDonutSurface.ItemTemplate>
                </s:SciChartDonutSurface>

And I have correctly created ObservableItems named TimeGroups, with properties Duration and Name.

I’m not seeing a thing…

What am I doing wrong?

Thnanks

Version
4.2
  • You must to post comments
1
0

Hi there,

Your ItemsSource collection should be of IPieSegmentViewModel type:

public ObservableCollection<IPieSegmentViewModel> TimeGroups { get; set; }

Also I see in your xaml code that you wrote your DataTemplate of DataType”s” maybe it can be the reason of the issue.

We have the documentation for SciChartDonutSurface here https://www.scichart.com/documentation/v4.x/webframe.html#The%20Donut%20Chart%20Type.html

And example of how to use it here https://www.scichart.com/example/wpf-chart-donut-chart-example/

Best regards,
Taras B.
SciChart Developer

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies