How to programmically update chart inside HubSection?

2 posts, 0 answers
  1. Melicaster
    Melicaster avatar
    3 posts
    Member since:
    Jun 2014

    Posted 17 Jan 2015 Link to this post

    I has been reading and has successfully created the scenario based on the tutorial.

    However, I need the chart to work inside HubSection. The snippet of the my XAML as below:
    <HubSection Header="HubSection 2">
                            <telerik:RadPieChart  x:Name="mychart" Width="300" Height="300" ClipToBounds="False" PaletteName="DefaultDark">
                                <telerik:DoughnutSeries ShowLabels="True">
                                        <telerik:PropertyNameDataPointBinding PropertyName="Value"/>

    I need to periodically update the chart. So I couldn't use loaded. I only can search the control manually using VisualTreeHelper. How do I create the Donut Chart control manually? I know that we can create an control using below snippet:
    private TextBlock NoArticlesTextBlock;

    I search the child using snippet like below:
    static DependencyObject FindChildByName(DependencyObject from, string name)
                int count = VisualTreeHelper.GetChildrenCount(from);
                for (int i = 0; i < count; i++)
                    var child = VisualTreeHelper.GetChild(from, i);
                    if (child is FrameworkElement && ((FrameworkElement)child).Name == name)
                        return child;
                    var result = FindChildByName(child, name);
                    if (result != null)
                        return result;
                return null;

    Please advise. Thank you.
  2. Ves
    Ves avatar
    2870 posts

    Posted 21 Jan 2015 Link to this post


    This question is valid for any control and it is not specific for our chart. You already have one solution and an alternative would be to wrap the chart within a user control, where you will have access to the chart.

    Best regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top