Pie Chart - Mouse Tracking

7 posts, 1 answers
  1. Brent
    Brent avatar
    6 posts
    Member since:
    Oct 2011

    Posted 27 Dec 2012 Link to this post

    Hi guys... we are using 2012 Q2 PieChart control. We have it where the pie slices explode on mouse over - looks great. The problem is, if you move the mouse around the inside of the pie, the slices sometimes explode, flicker or do nothing. If we move the mouse off, then back on each slice, it works perfectly. Is this a known issue or something we need to set in code.

    Thx

    Brent
  2. Missing user
    Missing user avatar

    Posted 01 Jan 2013 Link to this post

    Hello Brent,

    We have trouble reproducing the problem. We'll need to know more about how exactly you make pie slices explode. Ideally, you could send a sample project that we can build and run and see the behavior you've described. Once we've got enough information to work with, we'll do our best at identifying and removing the issue.

    All the best,
    Ivan N.
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Brent
    Brent avatar
    6 posts
    Member since:
    Oct 2011

    Posted 05 Jan 2013 Link to this post

    Thanks Ivan... please take a look at this sample project: http://www.localligence.com/SampleRadChart.zip. After running the project, move your mouse around the inside of the pie, and while initially the slices explode correctly, they soon start to stutter as you move. Any help you can provide woulde be appreciated.

    Regards

    Brent
  5. Missing user
    Missing user avatar

    Posted 08 Jan 2013 Link to this post

    Hi Brent,

    Thank you for providing us with a sample project. We were able to identify the problem immediately. The pie slices flicker only when the mouse is positioned over a label, i.e. each pie slice detects the mouse cursor has left it. You can try one of the following workarounds:

    1. Change the labels' left margin to -1. This will position them outside the pie slice. In addition, you should set the ClipToBounds property of the pie chart to False, since otherwise labels may appear cut off when you hover over a slice.

    2. Add the following style to the label definition:
    <telerik:ChartSeriesLabelDefinition.DefaultVisualStyle>
        <Style TargetType="TextBlock">
            <Setter Property="IsHitTestVisible" Value="False"/>
        </Style>
    </telerik:ChartSeriesLabelDefinition.DefaultVisualStyle>

    Either one of the above should prevent any unwanted flickering when moving the mouse inside the pie slice area.

    Greetings,
    Ivan N.
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Brent
    Brent avatar
    6 posts
    Member since:
    Oct 2011

    Posted 09 Jan 2013 Link to this post

    Hi Ivan... thanks for the detail. We tried what you mentioned above, but I think the problem is something else. It looks like the issue is when the mouse moves over the 'gap' between the exploded pie slice. When in this space, the flickering is occurring. I've included an AVI of the problem here: http://www.localligence.com/pie_mouse-tracking.avi.
     
    Please take a look and give me your thoughts.

    Thx

    Brent
  7. Answer
    Missing user
    Missing user avatar

    Posted 10 Jan 2013 Link to this post

    Hi Brent,

    In this case the behavior you experience is completely expected, because you deselect a pie slice when the mouse cursor leaves the series. The gap you pointed out is not a part of the series when the slice is selected. That's why once the cursor is moved even a single pixel while in this gap, the slice will be deselected and, since the cursor is now directly positioned over the pie series again, the slice will be selected, causing a loop as long as the cursor is positioned within the gap area.

    As a workaround, you can try deselecting a slice when the cursor leaves the chart. Remove the line
    MouseLeave="PieSeries1_MouseLeave"
    from the PieSeries tag and put it in the RadPieChart tag. Note that, in your case, you'll also have to set the PieChart's width accordingly, otherwise it will stretch to fit the boundaries of its parent element. Thus, the cursor will always be considered inside the chart and pie slices will remain exploded until the cursor is moved away from the chart's vertical boundaries.

    Greetings,
    Ivan N.
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Brent
    Brent avatar
    6 posts
    Member since:
    Oct 2011

    Posted 11 Jan 2013 Link to this post

    Thx Ivan.. that did the trick.

    Regards

    Brent
Back to Top
DevCraft banner