.AddBar with ZedGraph

Suriv

Active member
Joined
Jul 16, 2007
Messages
33
Programming Experience
1-3
I try to use a ZedGraph control with this code:
VB.NET:
Dim Graph As New ZedGraph.GraphPane
Graph = zgcNetwork.GraphPane

Dim PPList As New ZedGraph.PointPairList

Dim i As Integer
For i = 0 To 10
    PPList.Add(i, i + 1)
Next

Graph.AddBar("", PPList, Color.DarkGreen)

I suppose this should work, but it doesn't.
Does someone know how I can make this work? :)

~~~~EDIT~~~~
When I set a breakpoint at "Graph.AddBar", and run the code, and after the breakpoint I run the code again, then it works sometimes :s
 
Last edited:
This seems to get the display into view:
VB.NET:
zgcNetwork.RestoreScale(Graph)
So does this:
VB.NET:
zgcNetwork.AxisChange()
zgcNetwork.Refresh()
Just a question, why do you declare a Graph variable and assign it a new instance of GraphPane, only to assign the GraphPane of your control to it the next code line?
If you need that variable (to write faster or read easier later.. or your reasons), wouldn't it be better to do this:
VB.NET:
Dim Graph As ZedGraph.GraphPane = zgcNetwork.GraphPane
 

Latest posts

Back
Top