Could I use this data format to generate a chart ?

5 posts, 0 answers
  1. Winson qiu
    Winson qiu avatar
    20 posts
    Member since:
    Aug 2009

    Posted 09 Aug 2009 Link to this post

    My data source table is :

    groupby | ServYr_below_1Yr | ServYr_1to2Yr | ServYr_2to5Yr |  ServYr_5to10Yr
    ----------------------------------------------------------------------------------------------------------
    Male      |         10                   |         20            |       30               |         5
    Female  |          5                    |        10             |        10              |         10


     I need to set the AxisX.Title is ServYr_below_1Yr | ServYr_1to2Yr... , and the AxisY's data is the record's number value, the Legend label is  Male and Female , I don't want to change the data format , can I do that ?


  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 12 Aug 2009 Link to this post

    Hi Winson,

    Unfortunately, RadChart would not handle such datasource directly in the way you need it. You can populate the chart manually, looping through the datasource.

    Greetings,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Winson qiu
    Winson qiu avatar
    20 posts
    Member since:
    Aug 2009

    Posted 12 Aug 2009 Link to this post

    ok , thanks! The problem I have solved.
  4. Vinod Sardar
    Vinod Sardar avatar
    33 posts
    Member since:
    Nov 2009

    Posted 17 Dec 2009 Link to this post

    Could you please let me know your solution. I am also have similar requirement.


    Thanks,
    Vinod Sa.
  5. Winson qiu
    Winson qiu avatar
    20 posts
    Member since:
    Aug 2009

    Posted 18 Dec 2009 Link to this post

    I change the data format after I gets. Example, my data source is a List object:

    List<EmpServiceLengthInfo> list;

    so I change to :

    List<double[]> itemsSource = new List<double[]>();

    follows are the code:

    List<double[]> itemsSource = new List<double[]>(); 
    int index = 0; 
    foreach (EmpServiceLengthInfo item in list) 
                { 
     
                    double[] value = { item.ServYr_below_1Yr,item.ServYr_1to2Yr,item.ServYr_2to5Yr,item.ServYr_5to10Yr, 
                                       item.ServYr_10to15Yr,item.ServYr_15to20Yr,item.ServYr_20to25Yr,item.ServYr_over_25Yr}; 
     
                    itemsSource.Add(value); 
                    SetSeriesMappingsEmpServ(index, item.GroupBy, settings); //set series mappings
                    index++; 
                } 
     
    chart.ItemsSource = itemsSource; 
     





Back to Top