Hi,
My chart has more than one series (the number always changes).
I want to add these series dynamically into my chart (sometimes 2 sometimes 5 series). I tried to use an array but it did not work. How can I add the (changing number) chart series dynamically? and what is the problem with the array? (Please see the code below)
Thanks,
Ervin
Dim rowNumber As Integer = ds.Tables(0).Rows.Count
Dim myChartSeries(rowNumber - 1) As ChartSeries
For index As Integer = 0 To rowNumber - 1
With myChartSeries(index)
.Name = s1
.Appearance.TextAppearance.TextProperties.Color = Color.Blue
.Type = ChartSeriesType.Line
.Appearance.LabelAppearance.Visible = True
.Appearance.PointMark.Dimensions.AutoSize = False
.Appearance.PointMark.Dimensions.Width = 7
.Appearance.PointMark.Dimensions.Height = 7
.Appearance.PointMark.FillStyle.MainColor = Color.Black
.Appearance.PointMark.Visible = True
For index2 As Integer = 0 To 5
Dim mychartSeriesItem As Integer = Int(ds.Tables(0).Rows(0).Item(index2 + 1))
myChartSeries(index2).AddItem(mychartSeriesItem)
Next
End With
chart.AddChartSeries(myChartSeries(index))
Next
chart.DataBind()