Dynamic and multiple LineSeries creation (xaml)

Thread is closed for posting
2 posts, 0 answers
  1. FARE
    FARE avatar
    1 posts
    Member since:
    Oct 2012

    Posted 27 Sep 2012 Link to this post

    Hello all !

    (I warn you immediately, my native language is French, so sorry for any mistake)

    I started develop a WindowsPhone application which use Telerik chart controls. I see how easy it is to create graphs (in xaml) but it's  limited in a case where I don't know the number of series to construct.

    For example :

    I have two entities :

    public class Indicateur
    public virtual long IdProjet {get;set;}
    public virtual Guid? IdIndicateur {get;set;}
    public virtual string Nom {get;set;}
    public virtual string TypeUnite {get;set;}
    public virtual long? Limite1 {get;set;}
    public virtual long? Limite2 {get;set;}
    public virtual DateTime DateCreation {get;set;}
    public virtual IList<Information> Valeurs {get;set;}
    public class Information
    public virtual long? IdInformation {get;set;}
    public virtual Guid IdIndicateur {get;set;}
    public virtual decimal Valeur {get;set;}
    public virtual DateTime DateCreation {get;set;}
    (I don't show it but there is PropertyChanged notification system)

    In my viewmodel, I do db request that returns a List of "Indicateur".

    Here is my problem :

    There is a complex tree :

    An "Indicateur" has a list of "Information". Each Information has a "Valeur" (value).
    Is there a way to dynamically build the LineSeries points?

    Infact, I am quite familiar with this kind of data manipulation:
    <ListBox ItemsSource="{Binding Indicateurs, Source={StaticResource vueModeleIndicateur}}">
                            <ListBox ItemsSource="{Binding Valeurs}">
                                        <TextBlock Text="{Binding Valeur}"/>

    Thank you in advance for your help!
  2. Victor
    Victor avatar
    1358 posts

    Posted 28 Sep 2012 Link to this post

    Hello Fare,

    Thank you for the question.
    Currently you can progammatically manipulate the series and their points. On your RadChart object, you have a Series property. This is a collection of all series in the chart. Then each series object in this collection has a DataPoints property data you can manipulate manually. Also each series has an ItemsSource property that you can use for data binding instead of manually populating the DataPoints collection.

    I hope this is helpful.

    Kind regards,
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Back to Top