Issues with Pie Chart (refresh, exploding and resetting points)

4 posts, 0 answers
  1. Lee
    Lee avatar
    7 posts
    Member since:
    Aug 2012

    Posted 27 Nov 2012 Link to this post

    Let me start this with, I am using the Q2 2012 version and this is my first attempt at using this control...

    I am trying to use the pie chart to render data from database based on the dates entered by the user.  The user can reset these dates at any time and in which case I need to update the pie chart based on the new dates.  I have done this by setting up events and when the user enters the date, then I will refresh my pie chart data.

    Problem 1) So at first I figured the easiest way to do this would be clear the points and re-add them.  However, this would throw an error stating index out of range.  In debug this was looking for the PieSeries.cs file.  You can reproduce this by displaying some data and then on the click of a button call pieChart.Series[0].DataPoints.Clear().  I can provide a call stack if necessary.

    Problem 2) I then went back and added all the required datapoints in xaml and gave them a name.  I then changed it to use those named points and reset the values.  Now when I update the values and the labels, the chart itself is not updating.  Is there some call to tell the chart to re-evaluate the values?

    Problem 3) When the user selects a date range that does not contain any data to be displayed, I need to update the chart to reflect this.  I currently set the points value to 0, but it doesn't update to reflect 0 values.  What is the best way to accomplish this?

    Problem 4) When the user is hovering over a slice in the pie, I want to either be able to "explode" that slice or at least update the tooltip to reflect some other internal data.  I noticed in posts from the past that the "explode" event was ready, but is it ready now?  If so then what is the event?  If this event is not there then could you at least tell me how in the TooltipOpening even I can get the datapoint that the mouse is currently hovering over?

    Thanks in advance for your time and efforts.
    Lee Keel
  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 30 Nov 2012 Link to this post

    Hi Lee,

    As you are now starting with our chart controls, I would strongly recommend using RadPieChart, part of RadChartView. RadChartView is newer control (actually this is the name for a set of controls - RadPieChart, RaPolarChart and RadCartesianChart - serving different needs), designed to meet requirements, which could not be fulfilled with RadChart. You can find a detailed comparison here. In addition, I have attached a small example, which addresses the issues you have pointed, using RadPieChart.

    Best regards,
    Ves
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Lee
    Lee avatar
    7 posts
    Member since:
    Aug 2012

    Posted 03 Dec 2012 Link to this post

    So this shows my limited experience with these controls.  This topic should have been in the RadPieChart group but there was not such a group so I just put it in here.  I am using the RadPieChart and still experiencing these issues.  Your example shows this.  Maybe this is a bug that has been resolved since Q2 release, but when I click the change button from your sample, the value is updated but nothing changes in the grid.  The other items events do work in your sample though, so I need to compare to my code and understand why it throws an error.  Can someone please check to see if this was a bug that was resolved in the latest release?
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 06 Dec 2012 Link to this post

    Hi Lee,

    Indeed, there is a problem in Q2 2012 release, where update is not reflected correctly. It is fixed in Q2 2012 SP1 and later versions.

    Best regards,
    Ves
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top