从双()阵列现有VB.NET图表系列添加的数据点 [英] Add data points from Double() array to existing VB.NET chart series

查看:414
本文介绍了从双()阵列现有VB.NET图表系列添加的数据点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有类型的数组双()(1×的 N 的),我想在我有一个图形绘制迅速已经成立。我唯一​​想/需要做的就是把我的数组并将其存储在该系列我已经有个数据点(Y轴值)。什么是做到这一点的最好方法是什么?此外,将被绘制变化作为我的数组的变化,如果没有,我怎么会重新绘制这些新点,摆脱旧点?数据点

I have an array of type Double() (1 x n) that I am trying to quickly plot on a graph I've already set up. The only thing I want/need to do is take my array and store it as data points (y-axis values) in the series I already have. What's the best way to do this? Also, will the data points that are plotted change as my array changes, and if not, how would I replot those new points and get rid of the old points?

推荐答案

添加点应为

Chart1.Series("Default").Points.Add(arrayName)

至于它是自动更新,当您更改阵列,我相信,如果你只需要添加的点,你将不得不想尿尿的问题在游泳池(一旦他们在那里,你不能让出来)。所以,你增加一个阵列3项,然后添加一个双到数组,然后重新添加到图表,你现在有错误的7分。但是,您可以将数据绑定到阵列系列,像这样。

As for it being auto-updated when you change the array, I believe if you just add the points, you are going to have an issue like pee in a swimming pool (once they are in there, you can't get them out). So, you add an array with 3 items, then add a double to the array, then the add to the chart again, you now incorrectly have 7 points. However, you can databind the array to the series, like so.

Chart1.Series("Default").Points.DataBindXY(xStrings, xDoubles)

在这种情况下,如果阵列的变化,图表应该改变。

In this case, if the array changes, the chart should change as well.

这篇关于从双()阵列现有VB.NET图表系列添加的数据点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆