We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Scrolling chart

Hi there,

I'm attempting to make an auto-scrolling chart in WPF, similar to your Auto Scrolling example.  I have accomplished this in several different ways, including using ActualRangeChanged event handlers, a custom ItemSource with self-updating ranges, and dynamically changing the DoubleRange of the x Axis.  Every one of these implementations causes the same behaviour:  the Legend often (but not always) flickers when the chart redraws.

This is part of a significantly larger app, so it's difficult to pare it down to a simple case (I shall work at it), but is there a way I can fix this?  It's quite distracting.

5 Replies

DA Devi Aruna Maharasi Murugan Syncfusion Team January 26, 2017 06:03 AM UTC

Hi Ryan, 
  
Thanks for contacting Syncfusion Support. 
  
We are unable to reproduce the reported problem at our end. We have prepared a demo sample based on your requirement and it can be downloaded from below link, 
  
  
If you are still able to reproduce the reported problem, please revert us by modifying the sample. It would be helpful for us to serve you better. 
  
Regards, 
Devi 





RD Ryan Downing January 26, 2017 06:12 PM UTC

Well, your sample did help, though probably not for the expected reasons.  Looks like FastLineBitmapSeries was the problem.  I changed mine to FastLineSeries, works great.  I changed yours to FastLineBitmapSeries, the flickering appears.

Not sure why it was using BitmapSeries in the first place, as I inherited this code, but I'm happy it's working now.


However, it still feels choppy...  since the graph data only updates once every 200ms or whatever, it seems to stutter forwards.  Is there a way I could have the transition smoother?  I can't find a place to alter ActualMinimum or VisibleMinimum outside of the ActualRangeChanged event, which is obviously only firing when I add data to the graph...


DA Devi Aruna Maharasi Murugan Syncfusion Team January 27, 2017 12:51 PM UTC

Hi Ryan, 
  
Thanks for your update. 
  
We can make the transition of chart series smoother by customizing the Interval property in the chart axis. We can alter the VisibleMinimum of axis only in its ActualRangeChanged event. 
  
We have prepared a demo sample based on your requirement and it can be downloaded from below link, 
Sample: RealTime128503 
  
Regards, 
Devi 



RD Ryan Downing January 31, 2017 11:06 PM UTC

Thanks for your response, but that seemed to have no effect at all, besides changing the distance between the gridlines on the Y axis.

Upon closer inspection, it's not just jerky movement, it's actually going backwards at times.  I've attached a video clip of the project you uploaded (RealTime128503), and you can see that the graph actually wiggles back and forth at irregular intervals (though they do often seem to occur when a grid line is about to hit the axis).  I changed the timer in the project to 100ms to make it slightly more obvious, but didn't change anything else.  This is similar behaviour to that I'm observing in our own application.



Attachment: GridJerks_cf419f45.7z


DA Devi Aruna Maharasi Murugan Syncfusion Team February 2, 2017 05:18 PM UTC

Hi Ryan, 
  
Thanks for your update. 
  
In auto scrolling sample (updated sample), the intervals of the axis are calculated from actual range. So, visible label intervals are differed in every data updates and the jerky movement of gridlines get occurred. It can be resolved by two ways 
  
1)By disabling the gridlines 
  
We can avoid the problem by disabling the ShowGridLines property of axis and it can be set as shown in the below code snippet, 
 
   <chart:SfChart.PrimaryAxis> 
        <chart:CategoryAxis ShowGridLines="False"> 
        </chart:CategoryAxis> 
   </chart:SfChart.PrimaryAxis> 
  
2) By maintaining actual and visible range as same. 
  
We have prepared a demo sample based on your requirement and it can be downloaded from below link, 
  
Sample: ScrollingSample 
  
Regards, 
Devi 





Loader.
Live Chat Icon For mobile
Up arrow icon