Metodo createChart (VB.NET)

'Creazione Grafico
Private Sub createChart(ByVal dt As DataTable)
  'Area di lavoro 500x400
  Dim w As Int32 = 500
  Dim h As Int32 = 400
  Dim base As New Bitmap(w, h)
  Dim area As Graphics = Graphics.FromImage(base)

  'Sfondo bianco
  Dim rect As New Rectangle(0, 0, 500, 400)
  area.FillRectangle(Brushes.White, rect)

  'Lettura dei dati
  Dim x As Int32 = 0
  Dim y As Int32 = 400
  For Each row As DataRow In dt.Rows
    Dim qta As Int32 = row("qta") / 10
    y = 400 - qta
    Dim colonna As New Rectangle(x, y, 5, qta)
    'alternanza colori
    If x Mod 2 = 0 Then
      area.FillRectangle(Brushes.Red, colonna)
    Else
      area.FillRectangle(Brushes.Blue, colonna)
    End If
    x = x + 7
  Next

  base.Save(Response.OutputStream, Imaging.ImageFormat.Gif)
  base.Dispose()
End Sub