Hallo,
ich lasse mir durch den unten angehängten Code einen Graphen mit ZedGraph zeichnen.
Wie lasse ich mit die Funktionsformel anzeigen, von dem gezeichneten Graphen?
Spoiler anzeigen
ich lasse mir durch den unten angehängten Code einen Graphen mit ZedGraph zeichnen.
Wie lasse ich mit die Funktionsformel anzeigen, von dem gezeichneten Graphen?
VB.NET-Quellcode
- Private Sub CreateGraph(ByVal zgc As ZedGraphControl)
- Dim myPane As GraphPane = zgc.GraphPane
- ' Set the titles and axis labels
- myPane.Title.Text = "Hermite-Polynom"
- myPane.XAxis.Title.Text = "X Werte"
- myPane.YAxis.Title.Text = "P(X)"
- ' Make up some data points from the Sine function
- Dim list As New PointPairList()
- Dim x As Double, y As Double
- For x = -30 To 30 Step 0.5
- Polynom = DivDiff(0, CountedRows - 1)
- For j = CountedRows - 2 To 0 Step -1
- Polynom = Polynom * (x - XWert(j)) + DivDiff(0, j)
- Next
- y = Polynom
- list.Add(x, y)
- Next x
- ' Generate a blue curve, and "Polynom" in the legend
- Dim myCurve As LineItem = myPane.AddCurve("Polynom", list, Color.Blue, SymbolType.None)
- ' Fill the axis background with a color gradient
- myPane.Chart.Fill = New Fill(Color.White, Color.LightGoldenrodYellow, 45.0F)
- ' Fill the pane background with a color gradient
- myPane.Fill = New Fill(Color.White, Color.FromArgb(220, 220, 255), 45.0F)
- 'Set the Y axis intersect the X axis at an X value of 0.0
- myPane.YAxis.Cross = 0.0
- 'Turn off the axis frame and all the opposite side tics
- myPane.Chart.Border.IsVisible = False
- myPane.XAxis.MajorTic.IsOpposite = False
- myPane.XAxis.MinorTic.IsOpposite = False
- myPane.YAxis.MajorTic.IsOpposite = False
- myPane.YAxis.MinorTic.IsOpposite = False
- myPane.XAxis.Scale.Min = -20
- myPane.XAxis.Scale.Max = 20
- myPane.YAxis.Scale.Min = -20
- myPane.YAxis.Scale.Max = 20
- ' Calculate the Axis Scale Ranges
- zgc.AxisChange()
- End Sub