how to use arraylist in dotnetcharting

guo84

Member
Joined
Feb 7, 2009
Messages
6
Programming Experience
1-3
Hi Everyone,

Currently I am having problems trying to display data from 2D array using .netcharting in visual studio. net.

I also hope to show the max,min and average score.:eek:

Please help.


Sub CreateChart(ByRef chart1 As Chart)

chart1.Type = ChartType.Combo 'Horizontal
chart1.Width = 500
chart1.Height = 350
chart1.TempDirectory = "temp"
chart1.Debug = True
chart1.Title = "Minority Game"

' This sample demonstrates how to quickly make element markers invisible.

chart1.DefaultSeries.Type = SeriesType.Line
chart1.DefaultElement.Marker.Visible = True

' *DYNAMIC DATA NOTE*
' This sample uses random data to populate the chart. To populate
' a chart with database data see the following resources:
' - Classic samples folder
' - Help File > Data Tutorials
' - Sample: features/DataEngine.aspx

' Add the random data.
chart1.SeriesCollection.Add(getRandomData())

' chart1.SeriesCollection.Add(Calculation.Maximum)
End Sub
Function getRandomData() As SeriesCollection

Dim SC As SeriesCollection = New SeriesCollection()
Dim myR As Random = New Random(1)
Dim a, b As Integer

For a = 0 To 3 Step 1

Dim s As Series = New Series()
s.Name = "Players " & (a + 1)
For b = 0 To 3 Step 1

Dim e As Element = New Element()
e.Name = "Players" & (b + 1)
'e.YValue = -25 + myR.Next(50)
'e.YValue = myR.Next(50)
e.YValue = resulttotal(rounds)
s.Elements.Add(e)
Next
SC.Add(s)
Next

' Set Different Colors for our Series
SC(0).DefaultElement.Color = Color.FromArgb(49, 255, 49)
SC(1).DefaultElement.Color = Color.FromArgb(255, 255, 0)
SC(2).DefaultElement.Color = Color.FromArgb(255, 99, 49)
SC(3).DefaultElement.Color = Color.FromArgb(0, 156, 255)

Return SC

For result = 0 To resulttotal.Length - 1
MessageBox.Show(resulttotal(result))
Next

End Function
 
Last edited:
Back
Top