PivotGrid & Pie integration

2 posts, 0 answers
  1. Stefania
    Stefania avatar
    154 posts
    Member since:
    May 2013

    Posted 23 Nov 2017 Link to this post

    Hi, is it possible to integrate the pivot with a pie chart?


    Something like this but with a pie


    Thank you

  2. Dilyan Traykov
    Dilyan Traykov avatar
    1070 posts

    Posted 28 Nov 2017 Link to this post

    Hello Stefania,

    Indeed, you can place any kind of chart inside your custom user control. You simply have to take the PivotChartViewModel's SeriesSource property which is of type ReadOnlyCollection<PivotChartItemsCollection> and decide how exactly you want to visualize the data. Please note that each series has an Items collection of type IEnumerable<PivotChartItem> holding the individual items.

    One approach would be to use an ItemsControl with the SeriesSource as its ItemsSource and a PieChart in its ItemTemplate. I'm attaching a small sample project based on the article you referenced to demonstrate what I have in mind. Here's the code of interest:

        <pivot:PivotChartViewModel DataProvider="{Binding DataProvider, RelativeSource={RelativeSource AncestorType=local:PivotChartUserControl}}"/>
        <ItemsControl ItemsSource="{Binding SeriesSource}">
                    <UniformGrid Columns="3" />
                    <telerik:RadPieChart Palette="Windows8">
                        <telerik:PieSeries ValueBinding="Value" ItemsSource="{Binding Items}" />

    Of course, you're free to modify this chart to suit your needs.

    Please let me know whether such an approach would work for you. If that is not the case, please provide more details on your exact requirements and I will gladly assist you further.

    Dilyan Traykov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top