0

I want to make a graphic of certain data in my program. The problem is that the zedgraph doesn't zoom out to see the dots or lines in the graphic. This is my code:

Sub llenar_graph(ByVal zgc As ZedGraphControl)
        Dim myPane As GraphPane = zgc.GraphPane

        myPane.Title.Text = "Algoritmo Genético"
        myPane.XAxis.Title.Text = "Generación"
        myPane.YAxis.Title.Text = "Fx"

        Dim list1 As New PointPairList()
        For i = 0 To ngen
            list1.Add(i, promediofx(i))
        Next i

        Dim myCurve As LineItem = myPane.AddCurve("Mejor individuo", _
           list1, Color.Red, SymbolType.Default)
        myCurve.Line.IsVisible = True

        zgc.AxisChange()
    End Sub

I've tested the codes that Zedgraph provides in his homepage, but that code only work if you call this subroutine in the form load. Instead of that, I want to make the graphic when I clic a button. I don't have experience with VBNet, so please help.

2
Contributors
1
Reply
5
Views
6 Years
Discussion Span
Last Post by TCESeregon
0

Hi,

Try setting:

myPane.YAxis.Scale.MinAuto = True
myPane.YAxis.Scale.MaxAuto = True

before calling AxisChange()

Hope this helps.

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.