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

Can I bind a PieChart to a single data row?

2 Answers 43 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Douglas
Top achievements
Rank 1
Douglas asked on 08 Mar 2012, 08:32 PM
I have a row from my database.  I want to bind some of the columns to a PieChart.  Is this possible or does each data item in a pie chart need to be a separate record from my database?

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Marchev
Telerik team
answered on 13 Mar 2012, 10:48 AM
Hi Douglas,

In general - the chart expects a list of objects to work. This means that passing it a single record - will not lead to any meaningful results.

I am not familiar with your scenario, but my general suggestion would be to manually gather all values (from that single row) that you need to show into a List<double> and pass that list to the ItemsSource of the chart.

Regards,
Petar Marchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Douglas
Top achievements
Rank 1
answered on 13 Mar 2012, 06:05 PM
Thank you for the clarification.  Yes, I changed my row into a list and it worked out okay.

Tags
Chart
Asked by
Douglas
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Douglas
Top achievements
Rank 1
Share this question
or