lindberg00
lindberg00

Reputation: 31

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 them 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

Upvotes: 3

Views: 3987

Answers (4)

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.

enter image description here

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

Upvotes: 4

Bharat Mallapur
Bharat Mallapur

Reputation: 724

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

Upvotes: 0

rmc00
rmc00

Reputation: 887

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.

Upvotes: 2

Alan Mendelevich
Alan Mendelevich

Reputation: 3611

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.

Upvotes: 2

Related Questions