MSDN图表改变点值的实时?

编程入门 行业动态 更新时间:2024-10-28 04:20:34
本文介绍了MSDN图表改变点值的实时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想用MSDN图表来表示的实时数据。我现在是远程登录应用程序获得。出于测试目的,我添加了一个按钮,手动更改图表。我手工制作图表,它与上X.该系列产品是由它命名的值不同的值X轴0到5分的默认系列1。

I want to use MSDN charts to represent realtime data i'm getting from a telnet application. For testing purpose i have added a button to alter the chart manually. I manually made the chart and it has 0 to 5 points on the X axis with values different values on the X. The series is named by it's default "Series1".

我试过如下:

chart1.Series [系列1] Points.ElementAt(0).SetValueY(40); //什么也没有发生。

chart1.Series["Series1"].Points.ElementAt(0).SetValueY(40); //Nothing happens

chart1.Series [系列1] Points.ElementAt(1).SetValueXY(1,20); //什么也没有发生。

chart1.Series["Series1"].Points.ElementAt(1).SetValueXY(1, 20); //Nothing happens

chart1.Series [系列1]点[0] .SetValueY(40)。 //什么也没有发生。

chart1.Series["Series1"].Points[0].SetValueY(40); //Nothing happens

chart1.Series [系列1] Points.ElementAt(1).YValues​​.SetValue(10,0); //什么也没有发生。

chart1.Series["Series1"].Points.ElementAt(1).YValues.SetValue(10, 0); //Nothing happens

chart1.Series [系列1] Points.Clear()。 //删除所有点像它应该。

chart1.Series["Series1"].Points.Clear(); //Removes all points like it should.

让我怎么改变运行数据点条目?

So how do i change datapoint entries on runtime?

-EDIT- 。如果我使用 chart1.Series [系列1]修改点Points.ElementAt(0).SetValueY(40); 并在此之后添加点与 chart1.Series [系列1] Points.AddXY(1,40); 修改后的点也扣入它的修改地点。结论是,改性不改变它的点的Y值,但图中没有得到刷新。该功能AddXY()似乎自动刷新。我似乎无法找到一个方法来手动调用刷新()。

-EDIT- If i modify a point using chart1.Series["Series1"].Points.ElementAt(0).SetValueY(40); and add a point after this with chart1.Series["Series1"].Points.AddXY(1, 40); the modified point does snap into it's modified place. The conclusion is that modifying does change the points Y value but the graph does not get refreshed. The function AddXY() seems to autorefresh. I cannot seem to find a way to call Refresh() manually.

推荐答案

呼叫 chart1.Refresh( )修改完毕;这将迫使图表重绘,拿起新的值。

Call chart1.Refresh() after changing the value; it will force a redraw of the chart, picking up the new values.

更多推荐

MSDN图表改变点值的实时?

本文发布于:2023-11-10 10:28:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575102.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图表   实时   MSDN

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!