telerik / UI-For-UWP

This repo contains the source code for Telerik UI for Universal Windows Platform (UWP), which includes 20+ UI controls for developers building UWP applications.
http://www.telerik.com/uwp/
Other
1.16k stars 234 forks source link

RadPieChart glitches and loops its animation while resizing app window #246

Open Sergio0694 opened 6 years ago

Sergio0694 commented 6 years ago

Hello, I'm having an issue with the RadPieChart control (which has been present for a while actually): while resizing the app window the initial fade in animation for the control keeps repeating, resulting in the control glitching for the whole time the window is resized.

Here's a video of the actual behavior:

2018-02-24_15-59-39

You can see the control is repeatedly showing the initial animation, and without the GIF compression you can actually see it flashing in and out while you resize even more.

This is the code I'm using for the chart:

<charts:RadPieChart
    Margin="24,0,0,0"
    x:Name="CharactersChart"
    ClipToBounds="False"
    PaletteName="DefaultDark"
    MaxHeight="180">
    <charts:DoughnutSeries 
        ShowLabels="False"
        ItemsSource="{x:Bind ViewModel.PieSeries, Mode=OneWay}">
        <charts:DoughnutSeries.ValueBinding>
            <charts:PropertyNameDataPointBinding PropertyName="Value"/>
        </charts:DoughnutSeries.ValueBinding>
    </charts:DoughnutSeries>
</charts:RadPieChart>

Right now I'm using Windows 10 16299, and my UWP app is targeting build 16299 as well.

Hope this helps! πŸ˜„

APopatanasov commented 6 years ago

Hi @Sergio0694 ,

When the window changes its size the Pie and Doughnut charts are actually redrawn and because of that the blinking is observed - the InvalidateCore method of the control gets called. That redrawn is now strictly connected with the implementation and because of that I cannot point only one place of the code that needs to be improved in order to prevent that redrawing from happening.

If you are interested on working on that improvement for the Chart I suggest you to check the places from the series where that invalidation is invoked and try to improve them in order to prevent the flickering.

Hope the provided information will be helpful for you.

Sergio0694 commented 6 years ago

Hello @APopatanasov - thank you for your reply! πŸ˜„ Yeah I figured it was something related with the Invalidate method, and thank you for the hints about the actual implementation. I will see if there's an easy workaround for that, maybe a simple field indicating whether or not the animation has already been played before, so consecutive redraws will just skip it after the layout of the chart itself is updated. I'll update this issue if/when I make any progress!

Thanks again 😊

APopatanasov commented 6 years ago

@Sergio0694 I am glad to hear the information was helpful for you. If you have any concerns or questions while researching, please let me know and I will try to help you. 😊