문제

Hy,

I need a line chart but I know the number of charts only during the runtime and the graph should change dynamicly so if I get new data the graph should update. Additional if I get higher values than the current size of the graph should change to show the higher values. I want to update the graph every second. How can I accomplish this in WPF and what would be the best solution?

Best regards

도움이 되었습니까?

해결책

you can use OxyPlot . it is very usefull library find it in the link below OxyPlot codePlex

다른 팁

It can be done by using default WPF Toolkit charts. Though they are very slow and maybe the OxyPlot library from another answer would be a better idea.

As to your questions,

the graph should change dynamicly so if I get new data the graph should update

You can achieve this by using data binding and the ObservableCollection class. I answered how to do this here: WPF Chart Series Dynamic Databinding

if I get higher values than the current size of the graph should change to show the higher values.

It will work by default in WPF Toolkit charts if your don't set the Maximum property of your Y-axis.

I know the number of charts only during the runtime

It is the most complex part, because you will need to extend the Chart class. I have written an article how to do this for Silverlight and WPF Toolkit charts, also you can download an example directly from here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top