Статья: ASP.NET пример построения круговой диаграммы
Dim fnt As New Font("Arial", 8)
Dim sb As New SolidBrush(Color.Blue)
g.Clear(Color.White)
g.SmoothingMode = SmoothingMode.HighQuality
' суммазначенийвмассиве
For i = 0 To arrData.GetUpperBound(0)
total = total + arrData(i)
Next
' проценты
For i = 0 To arrData.GetUpperBound(0)
arrProcent(i) = Math.Round((arrData(i)/total)*100)
Next
For i = 0 To arrProcent.GetUpperBound(0)
sub_total = sub_total + arrProcent(i)
pie_size = sub_total*360 / 100 - start_angle
g.FillPie(New SolidBrush(arrColor(i)), offset, offset, diameter, diameter, start_angle, pie_size)
start_angle = start_angle + pie_size
rect = New Rectangle(offset + diameter + 10, offset + i*20, 15, 15)
g.FillRectangle(New SolidBrush(arrColor(i)), rect)
g.DrawString(arrTitle(i) & " - [" & arrProcent(i) & "%]", fnt, sb, offset + diameter + 10 + 20, offset + i*20)
Next
bmp.Save(Response.OutputStream, ImageFormat.Jpeg)
g.Dispose()
bmp.Dispose()
Response.End()
%>
Результат работы скрипта: