Buenas Necesito adaptar este cogido que encontré aquí mismo el cual me sirve para realizar gráfico de torta el tema es que se realizo en ASP.NET, loge adapatar en parte el a codigo a mi proyecto pero tengo un error el response.outputstream no entiendo par que se usa y no se como adaptarlo a vb.net
aqui el codigo
Public Class Page
Private Sub Page_Load(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load Dim sql As New MySql
Dim ds As DataSet = New DataSet()
Dim Dt As System.Data.DataTable
Dt = sql.LEER("SELECT Nombre, SUM(Venta) FROM sucursales GROUP BY meses ")
Dim bc As gTorta = New gTorta()
bc.Render(ds, Response.OutputStream)
Public Class gTorta
Public Sub Render(ByVal chartData As
DataSet, ByVal target As Stream)
Dim dt As DataTable = chartData.Tables(0)
'Se crea un nuevo grafico y se configura
Dim bm As Bitmap = New Bitmap(400, 400)
Dim g As Graphics = Graphics.FromImage(bm)
Call g.Clear(Color.White) 'Pongo el fondo el blanco
Call g.DrawString("Texto", New Font("arial", 20), Brushes.Black, 5, 3) 'Aquí pueden ingresar un texto que quieran
Dim curAngle As Single = 0
Dim totalAngle As Single = 0
Dim i As Integer = 0
Dim sumData As Single = 0
Dim dr As DataRow
For Each dr In dt.Rows
sumData += Convert.ToSingle(dr(1))
Next dr
For i = 0 To dt.Rows.Count - 1
curAngle = Convert.ToSingle(dt.Rows(i)(1)) / sumData * 360
Call g.FillPie(New SolidBrush(ColorIm(i)), 100, 65, 200, 200, totalAngle,
curAngle)
Call g.DrawPie(Pens.Black, 100, 65, 200, 200, totalAngle, curAngle)
totalAngle += curAngle
Next i
Dim rectY As Integer = 300
Dim textY As Integer = 300
Dim percent As Single = 0
For i = 0 To dt.Rows.Count - 1
g.FillRectangle(New SolidBrush(ColorIm(i)), 100, rectY, 20, 10)
percent = Convert.ToSingle(dt.Rows(i)(1)) / sumData * 100
g.DrawString(dt.Rows(i)(0).ToString() + " (" +
percent.ToString("0") + "%)", New Font("Tahoma", 10), Brushes.Black, 130, textY)
rectY = rectY + 20
textY = textY + 20
Next i
bm.Save(target, ImageFormat.Gif)
g.Dispose()
bm.Dispose()
bueno espero su respuesta
aquí el enlace desde donde lo saque
http://www.elguille.info/colabora/puntoNET/adripulvi_graficotorta.htmgracias