One thing to note. I have a separate worker thread that does this:
Dispatcher.InvokeAsync(() => ChartControl.InvalidateVisual());
In a busy wait loop at 42ms intervals, so that I can improve the perceived frame rate at which the chart draws. Is it possible that this is causing a draw that somehow is using the time from the prior "frame" in some places and times from the new "frame" in others? That might explain the issue. I.e. GetXByTime() has the position from the previous frame, where the bar drawing has the positions from the next frame.
Cheers, Peter
P.S. As an aside, if there is a better way to get 30 or 60 fps out of the chart? I got this of the forums here, but it's kind of a brute force method, obvs that seems like it might be leaving me vulnerable to unexpected madness. I have to lock ChartControl both in my thread and in my main render to prevent a thread contention exception, which works -- but who knows what else wants to work with the ChartControl... Since we're on top of DirectX, I have a somewhat beastly video card, and the overall draw complexity is so trivial, it seems like we *should* be able to get truly ridiculous frame rates. While it might seem unnecessary, given that we only get new market data injected at 1 fps, it's definitely possible to get much cooler, more engaging indicators that draw the eye to the right place rendering like a video game.

Comment