Pie Chart in MVVM

4 posts, 0 answers
  1. Muthukumar
    Muthukumar avatar
    15 posts
    Member since:
    Oct 2011

    Posted 16 Nov 2011 Link to this post

    hi team,
    i need to develop a simple pie chart. but i have only below code in my Xaml. i need to create and control series from my viewmodel not in the code behind. And also i need to control the series colors, number of legends and legend colors from my viewmodel. if u guys give the sample code would be the great help. 

    The idea is i need to have only one template and use that control as common control.
    need to show that more that one pie chart in the same page.

     <telerik:RadChart x:Name="RadChart1" ItemsSource="{Binding Data}">
                <telerik:RadChart.DefaultSeriesDefinition>
                    <telerik:PieSeriesDefinition>                
                    </telerik:PieSeriesDefinition>
                </telerik:RadChart.DefaultSeriesDefinition>
            </telerik:RadChart>
  2. Nikolay
    Admin
    Nikolay avatar
    397 posts

    Posted 21 Nov 2011 Link to this post

    Hello Muthukumar,

    You can find a similar example in our legend features demo - the Pie chart is created using MVVM, with different legend options. As for the series colors, please, refer to this example.

    Best wishes,
    Nikolay
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. Muthukumar
    Muthukumar avatar
    15 posts
    Member since:
    Oct 2011

    Posted 22 Nov 2011 Link to this post

    hi ,
    thanks for ur reply. In this above example i can bind the legends from viewmodel, but Color palettes are from code behind
    i need that too from view model and another thing if i create color palettes from codebehind it is very slow. Is there any way to do that in viewmodel.



    thanks, 
    Muthukumar N
  4. Nikolay
    Admin
    Nikolay avatar
    397 posts

    Posted 24 Nov 2011 Link to this post

    Hi Muthukumar,

    Yes, it is possible to bind the colors using MVVM as well - please, have a look at this thread for more information on the matter and sample code.

    Kind regards,
    Nikolay
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top