데이터 바인딩과는 별도로 전체 범위를 추가하는 방법은 없습니다. 당신은 다차원의 데이터가있는 경우 (
'Add data from Array1 to the first series of the chart
Chart.Series(0).Points.Clear() 'Clear all points
For i = 0 to Array1.Count - 1
Chart.Series(0).Points.AddXY(i, Array1(i)) 'Adds the data from the array to the first series
Next
: 당신이 말한대로 당신은 AddXY
Points
재산의 방법 (또는 유형 DataPointCollection
의 관련 방법 중 하나) 시리즈의,과 같이, 호출 할 수 있습니다 1) 당신이 더 이상 정보를 제공하지 않기 때문에 - 예를 들면 Dim Data()() As Long
)는
For a = 0 to Data.Count - 1
Chart.Series(a).Points.Clear() 'Clear all points from the ath series
For i = 0 to Data(a).Count - 1
Chart.Series(a).Points.AddXY(i, Data(a)(i)) 'Adds the data from the ath array to the ath series
Next
Next
참고 X 값이 될 것입니다 배열의 수를 그냥 인덱스 (0 같은 일을 할 수 있습니다.
또는 당신은 이제 당신은 그냥 시리즈의 Points
속성에 대한 AddRange
메소드를 호출 할 수있는 새로운 Module
Public Module Extensions
<System.Runtime.CompilerServices.Extension>
Public Sub AddRange(d As System.Windows.Forms.DataVisualization.Charting.DataPointCollection, data() As Long)
Dim meCount As Integer = d.Count
For i = 0 To data.Count - 1
d.AddXY(meCount + i, data(i))
Next
End Sub
End Module
에서 확장 메서드를 작성할 수
Chart.Series(0).Points.AddRange(Array1)