I am drawing a graph through vb10 code. I add series in the chart and then create a legend. But graphs and legend do not correspond: graphs shows series from 1 to 10, legend from 2 to 11.
Here is my code (only relevant parts)
Dim ChartArea1 As ChartArea = New ChartArea()
Dim Legend1 As Legend = New Legend()
Dim DataSeries As New Series
Dim Chart1 = New Chart()
Dim arrayData(10, 10) As Double
For i = 1 To 10
DataSeries.Name = dept(i)
DataSeries = Chart1.Series.Add(i)
For j = 1 To 10
Chart1.Series(DataSeries.Name).Points.AddXY(j, arrayData(i, j))
Next
next
Chart1.Legends.Add(Legend1)
All the other features are perfect (axis, values ...) only the legend does not correspond
How can I control this ?
thanks in advance
David Remotti