图表VB.NET中的数据点 [英] Datapoint in chart VB.NET

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

问题描述

我使用数组(X,Y)制作样条图表

我需要在图表中找到X = 3.2时的Y值。

我用此代码但不起作用



 Dim x(6)As Double 
Dim y(6)As Double
x (0)= 1
x(1)= 1.7
x(2)= 2.8
x(3)= 4
x(4)= 2.4
x(5)= 1.5
y(0)= 16
y(1)= 20
y(2)= 40
y(3)= 60
y(4)= 30
y(4)= 5)= 20
Chart1.Series(Series1)。Points.DataBindXY(x,y)
Dim datapoint As DataPoint = Chart1.Series(Series1)。Points.FindByValue(3.2)
Label1.Text = datapoint.ToString()





我尝试了什么:



我需要在图表

解决方案

<中找到X = 3.2时的Y值blockquote>你不能从数据点不存在的图表中找到Y的值。



你必须使用ma th,如插值 [ ^ ],to找到价值。


I make spline chart by using array (X,Y)
I need to find the value of Y when X=3.2 from chart
I use this code but does not work

Dim x(6) As Double
      Dim y(6) As Double
      x(0) = 1
      x(1) = 1.7
      x(2) = 2.8
      x(3) = 4
      x(4) = 2.4
      x(5) = 1.5
      y(0) = 16
      y(1) = 20
      y(2) = 40
      y(3) = 60
      y(4) = 30
      y(5) = 20
      Chart1.Series("Series1").Points.DataBindXY(x, y)
      Dim datapoint As DataPoint = Chart1.Series("Series1").Points.FindByValue(3.2)
      Label1.Text = datapoint.ToString()



What I have tried:

I need to find the value of Y when X=3.2 from chart

解决方案

You can't find the value of a Y from a chart where the datapoint doesn't exist.

You have to use math, like interpolation[^], to find the value.


这篇关于图表VB.NET中的数据点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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