Can I bind a PieChart to a single data row?

3 posts, 1 answers
  1. Douglas
    Douglas avatar
    15 posts
    Member since:
    Feb 2012

    Posted 08 Mar 2012 Link to this post

    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. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 13 Mar 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Douglas
    Douglas avatar
    15 posts
    Member since:
    Feb 2012

    Posted 13 Mar 2012 Link to this post

    Thank you for the clarification.  Yes, I changed my row into a list and it worked out okay.

Back to Top