So putting that all together:
Public Class BasicTrendChartEx
Inherits BasicTrendChart
Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
'* Fill in the background color
e.Graphics.FillRectangle(New SolidBrush(Color.White), 0, 0, Me.Width, Me.Height)
Dim x1,y1 as Integer
Dim x2, y2 as integer
'* Draw the line connecting the points
If Points.Count > 1 Then
Dim index As Integer = 0
While index < (Points.Count - 2)
Try
'* calculate the x and y coordinates based on the Points collection
x1=convert.ToInt32((Me.width/Points.Count) * index)
y1=Convert.ToInt32(Me.Height/m_YaxisMaximum)*Points(index))
x2=convert.ToInt32((Me.width/Points.Count) * index+1)
y1=Convert.ToInt32(Me.Height/m_YaxisMaximum)*Points(index+1))
Dim StartPixel As New Point(x1, y1)
Dim EndPixel As New Point(x2, y2)
e.Graphics.DrawLine(System.Drawing.Pens.Blue, StartPixel, EndPixel)
Catch ex As Exception
Dim dbg = 0
End Try
index += 1
End While
End If
'* Draw the Axis
e.Graphics.DrawLine(System.Drawing.Pens.White, 0, 0, 0, Me.Height)
e.Graphics.DrawLine(System.Drawing.Pens.White, 0, Me.Height - 1, Me.Width, Me.Height - 1)
e.Graphics.DrawString(MaxValue.ToString, New Drawing.Font("Arial", 10.0!), System.Drawing.Brushes.White, 0.0!, 0.0!)
e.Graphics.DrawString(YMinimum.ToString, New Drawing.Font("Arial", 10), System.Drawing.Brushes.White, 0, Me.Height - 16)
End Sub
End Class