Hi,
I am seeing intermittent charting issues when plotting real-time data. The issue seems to be related to programmatic ranging of the x-axis, as I am unable to replicate the behavior when setting AutoRange="Always"
, and removing the programmatic ranging code.
I captured the behavior in a screen recording that can be viewed in the OneDrive link below (the file was too large to upload in this post). The behavior is replicated at time 0:00:01
. To me, it seems like the x-axis was somehow stretched in a section of the chart as the temporal distance between two consecutive data points seems to increase temporarily. In the video you can see that this behavior is transient and seems to rectify quite quickly; scrolling back to the time at which the glitch occurs, there seems to be no abnormalities in the data. The link to the video is below:
Below is the programmatic ranging method I am using:
private void AutoScaleAxes(double latestXPosition)
{
try
{
// force task to run on UI thread if not already
if (Thread.CurrentThread != _dispatcher.Thread)
{
_dispatcher.Invoke(() => AutoScaleAxes(latestXPosition));
}
else
{
var lowerBound = Math.Max(0, latestXPosition – DisplaySeconds);
if (Plots?.FirstOrDefault()?.DataSeries?.ParentSurface?.XAxes.First() is IAxis xaxis) xaxis.VisibleRange = new DoubleRange(lowerBound, latestXPosition);
var blockFirstScaling = _data.First().Count < 100; // don’t auto-scale first time until we have at least 100 data points
var autoScaleY = (_firstScaling && !blockFirstScaling) ? (!AutoScaleYAxis.HasValue) : (AutoScaleYAxis.HasValue && AutoScaleYAxis.Value);
}
}
Any thoughts on what code be causing this? Thanks!
- Jared Weyer asked 2 months ago
- last edited 1 month ago
-
Hi Jared, Thank you fore reporting this. Please accept my apologies for the delayed response. I am going to discuss the provided information with our team and will get back to you as soon as I have an update. Kind regards, Lex, SciChart Technical Support Engineer
-
Hi Lex, Thanks for getting back to me. Apologies for the multiple post, I thought the original post was unsuccessful as I could not locate it after posting.
- You must login to post comments
Hi Jared,
Hope you are doing well.
We discussed your inquiry.
As we can see, you use a custom Axis scaling algorithm.
Unfortunately, due to our Support Policy, we do not provide technical support for custom implementations.
We can suggest trying different render plugins, though, as they feature different rendering algorithms under the hood. For example, if you experience the mentioned issue with hardware acceleration, you can avoid it by using a software renderer instead.
Here you can find more details regarding render plugins SciChart offers:
SciChart WPF Documentation – Renderer Plugins _ WPF Chart Documentation
You could also use the AutoRange property set to Always, as you’ve mentioned in your message.
Kind regards,
Lex,
SciChart Technical Support Engineer
- Lex answered 3 weeks ago
- last edited 3 weeks ago
- You must login to post comments
Please login first to submit.