Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900