This is a migrated thread and some comments may be shown as answers.

Could I use this data format to generate a chart ?

4 Answers 76 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Winson qiu
Top achievements
Rank 1
Winson qiu asked on 10 Aug 2009, 04:21 AM
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 ?


4 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 12 Aug 2009, 07:09 AM
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.
0
Winson qiu
Top achievements
Rank 1
answered on 12 Aug 2009, 10:02 AM
ok , thanks! The problem I have solved.
0
Vinod Sardar
Top achievements
Rank 1
answered on 18 Dec 2009, 05:34 AM
Could you please let me know your solution. I am also have similar requirement.


Thanks,
Vinod Sa.
0
Winson qiu
Top achievements
Rank 1
answered on 19 Dec 2009, 01:33 AM
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; 
 





Tags
Chart
Asked by
Winson qiu
Top achievements
Rank 1
Answers by
Ves
Telerik team
Winson qiu
Top achievements
Rank 1
Vinod Sardar
Top achievements
Rank 1
Share this question
or