如何将图表y值获取到数组中 [英] How to get chart y values into an array

查看:98
本文介绍了如何将图表y值获取到数组中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有很多y值的图表.如何仅将y值从序列复制到数组?

我可以通过它获得y和x值,但这不是我所需要的,似乎无法弄清楚如何获得y值.

I have a chart with a lot of y values. How do I copy just the y values from a series to an array?

I can get the y and x values with this, but it''s not what I need, can''t seem to figure out how to get to the y values.

 For i = 0 To Chart_Manual_Instantaneous.Series(0).Points.Count - 1
     Debug.Print(Chart_Manual_Instantaneous.Series(0).Points(i).ToString)
Next

推荐答案

类似于

Something along the lines of

Dim yArray(Chart_Manual_Instantaneous.Series(0).Points.Count) As Double

For i = 0 To Chart_Manual_Instantaneous.Series(0).Points.Count - 1
   yArray(i)=Chart_Manual_Instantaneous.Series(0).Points(i).Y

Next



可能会解决问题.
我尚未编译此文件,因此其中可能存在一些语法错误.

/Fredrik



might do the trick.
I haven''t compiled this so there might be some syntax errors in it.

/Fredrik


谢谢,我尝试了一些非常类似的尝试,并不断陷入困境

Thank you, I''ve tried something very simular and keep getting stuck

Dim yArray(Chart_Manual_Instantaneous.Series(0).Points.Count) As Double

      For i = 0 To Chart_Manual_Instantaneous.Series(0).Points.Count - 1
          yArray(i) = Chart_Manual_Instantaneous.Series(0).Points(i).YValues

      Next




我不断收到不能将double的一维数组的值转换为double"的信息,即"




I keep getting "Value of 1-dimensional array of double cannot be converted to double", the "

Chart_Manual_Instantaneous.Series(0).Points(i).YValues

是引发错误的原因.


我已经了解了一下,xvalue在上面的代码中工作正常,有不是yvalue,而是yvalueS,我怀疑那里的代码有错误.但是无论如何,这是可行的



I got it in a round about way, the xvalue works fine with the code above, there is not a yvalue, it''s yvalueS, I suspect there is a bug in there code. But anyways this works



Dim yArray(Chart_Manual_Instantaneous.Series(0).Points.Count) As Double
Dim temp() As Double
For i = 0 To Chart_Manual_Instantaneous.Series(0).Points.Count - 1
    temp = Chart_Manual_Instantaneous.Series(0).Points(i).YValues
    yArray(i) = temp(0)
Next


这篇关于如何将图表y值获取到数组中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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