且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

图表有几个问题

更新时间:2023-12-03 14:37:46

我不太确定,但我有你是逐个添加积分的印象。



也许你可以尝试一次添加它们,包含之间的添加操作chart1.Series.SuspendUpdates(); chart1.Series.ResumeUpdates();
I'm not really sure, but I have the impression that you are adding the points one by one.

Maybe you could try to add them all at a time, enclosing the add operation between chart1.Series.SuspendUpdates(); and chart1.Series.ResumeUpdates();.


问题是datareceived事件和this.Invoke(其他事件),块I因为读取操作和绘制操作(在图表中),填充所有任务队列和UIthread之间永远不会保持活着,导致GUI不刷新直到datareceiver正在工作。



我需要用生产者 - 消费者模式和异步方法重构代码,以确保我调用刷新GUI并通知UItreahd io am这样做。



谢谢。
The problem was that the datareceived event and this.Invoke("other event"), block I because the read operation and paint operation (in chart), fill all the task queue and the UIthread never keep alive between that, result the GUI dont refresh until datareceiver is working.

I need to reestructure the code with producer-consumer pattern and async methods, to ensure that i call refresh the GUI and notify the UItreahd io am doing that.

Thanks.