Professional Documents
Culture Documents
Input Listbox Vs Plotting (X, Y)
Input Listbox Vs Plotting (X, Y)
+ TopMargin)
5)
PBLineChart.Wid
As System.Event
+ TopMargin)
g.RotateTransform(180)
g.ScaleTransform(-1, 1)
g.TranslateTransform(0, VertLineLength + 10, MatrixOrder.Append)
g.DrawPath(MyPen, MyPath)
g.ResetTransform()
End Sub
Private Sub FinalDisplay()
PBLineChart.Image = bmap
g.Dispose()
End Sub
Private Sub ShowMonths()
Dim TextStartX As Integer = CInt(LeftMargin + 18)
Dim TextBrsh As Brush = New SolidBrush(Color.Red)
Dim TextFont As New Font("Arial", 10, FontStyle.Regular)
Dim s1(ListBox1.Items.Count) As String
Dim a2 As New ArrayList
ListBox1.Items.CopyTo(s1, 0)
a2 = New ArrayList(s1)
Me.ListBox1.DataSource = a2
For i As Integer = 1 To s1.Length- 1
g.DrawString(s1(i - 1), TextFont, TextBrsh, TextStartX, _
CInt(PBLineChart.Height - (BaseMargin - 4)))
TextStartX += CInt(LineWidth)
Next
End Sub
Private Sub DrawVerticalGridLines()
Dim
Dim
Dim
Dim
Dim
Dim
ThinPen.Dispose()
End Sub
Private Sub DrawHorizontalLines()
Dim VertLineLength As Integer = PBLineChart.Height - (BaseMargin + TopMargin)
Dim VertGap As Integer = CInt(VertLineLength / 10)
Dim StartPoint As New Point(LeftMargin + 3, PBLineChart.Height - BaseMargin)
Dim EndPoint As New Point(PBLineChart.Width, PBLineChart.Height - BaseMargin)
Dim LineStart As New Point(StartPoint.X, StartPoint.Y - VertGap)
Dim LineEnd As New Point(EndPoint.X, StartPoint.Y - VertGap)
Dim ThinPen As New Pen(Color.LightGreen, 3)
For i As Integer = 1 To 10
g.DrawLine(ThinPen, LineStart, LineEnd)
LineStart.Y -= VertGap
LineEnd.Y -= VertGap
Next
ThinPen.Dispose()
End Sub
Private Sub PBLineChart_Paint(ByVal sender As Object, ByVal e As System.Windows.
Forms.PaintEventArgs) Handles PBLineChart.Paint
Dim ix As Integer = PBLineChart.Width
Dim iy As Integer = PBLineChart.Height
e.Graphics.DrawString("Coordinat-Y", New Font("Lucida Handwriting", 10, FontStyl
e.Regular), Brushes.Goldenrod, iy - 360, 6)
e.Graphics.DrawString("Coordinat-X", New Font("Lucida Handwriting", 10, FontStyl
e.Regular), Brushes.Goldenrod, iy + 20, 370)
e.Graphics.DrawString("V. HUTABALIAN'S Blog", New Font("Lucida Handwriting", 10,
FontStyle.Regular), Brushes.Goldenrod, iy - 40, 6)
e.Graphics.DrawString("7 Mei 2010", New Font("Lucida Handwriting", 10, FontStyle
.Regular), Brushes.Goldenrod, iy - 35, 20)
End Sub
End Class