开发者

Real-time WPF chart .Net 4

I'm working on a diagnostic tool and receives data every 25 ms. I need this data to be drawn in my chart using a lineSeries. I'm using a a wpf chart with a lineSeries which I bind in xaml to an ObservebleCollection.

The problem is that I need the collection needs to contain atleast 1600 datapoints before starting to remove the开发者_如何学运维m at the front.

I understand that 25 ms is a short tiem then it comes to drawing in wpf. Dose anyone have any solution to my problem?

Regards


You should check out SciChart, which can handle data updates at 1ms. It renders like a game-loop, so only draws when new data is appended and the UI thread is free. Some more information at www.scichart.com/wpf-chart-features which shows the features and talks about performance.

Real-time WPF chart .Net 4

Disclosure: It's my own component, so ask any questions if you have them!


I'd suggest you use a custom made drawing routine utilizing WritebleBitmap instead of shapes and draw your lines in a fixed area one segment at a time without any scrolling. The, when you reach 1600 points at the right side of your plot area, start over. Maybe some visual indicator (like vertical line or something) would help perception.

I don't think there any charting libraries targeted at updating 1600 point line every 25ms.


I have a .NET application that charts many measurements on a 33ms interval. I tested a number of charting solutions to accomplish this task, but the only real viable option I found was Arction LightningChart (http://www.arction.com). Lightning Chart will do what you want pretty easily, and I think you can get the basic version for free. The downside will be a dependency on DirectX and the SlimDX library. The trial that you can download from the site will give you pretty good examples of how to use this control in WPF and Windows Forms.


Use Microsoft Chart for WinForms using the WindowsFormsHost control. MS-Chart can handle such data rates well. It internally uses the WritableBitmap method, so it is both fast and stable. Also, don't forget to set the series type to FastLine to avoid slowdown.

I've created a "Tip" article on codeproject which tries to highlight this type of high-data volume usage on MS-Chart. You can change the timer interval to even 1 ms. and see that there is no issue in showing the data.

The article is at http://www.codeproject.com/Tips/1006180/Using-Microsoft-Chart-in-WPF

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜