Create a dinamically chart

2 posts, 0 answers
  1. Thiago
    Thiago avatar
    16 posts
    Member since:
    May 2012

    Posted 17 May 2012 Link to this post

    I need to create a dinamically chart, by the code-behind. 
    I´ll receive a DataSet, and it´ll be plotted based on these informations.
    I´m creating a bar chart , so it´s necessary to set the data template from each item.
    My doubt is: How can I do this? A option is use predefined data template at page´s resource.
    I´ve read about the PointTemplateSelector, but I don´t know how can I manipulate it.

    Best wishes,


  2. Victor
    Victor avatar
    1349 posts

    Posted 18 May 2012 Link to this post

    Hi Thiago,

     Thanks for the question.
    Please have a look at our online help for RadChart. It contains a lot of information about basic chart usage.
    This particular article should be interesting since it contains an example of how to use a template selector. The template selector here is used to select label templates however, the usage pattern is very similar for the point template selector.

    In short, the point template selector should be a class that inherits from DataTemplateSelector and overrides the SelectTemplate method. Since the point template selector is a class that you need to develop, you can put any properties that your like on it and you can give it references to any DataTemplate that you need. Then, when the SelectTemplate method is called by RadChart, you will return the correct data template based on the information that the chart provides in SelectTemplate's method arguments.

    Please write again if you have other questions.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top