How to calculate the percentage in a pie chart using vb.net

Number not in pie slices
For i As Integer = 1 To values.Length
  col = (100 + 10 * Math.Cos(angles(i)))
  If angles(i) > pi / 2 And angles(i) < 3 * pi / 2 Then col = col - 6
  row = (100 - 100 * Math.Sin(angles(i)))
  If angles(i) >= pi Then row = row - 100
  gr.DrawString(values(i - 1), Me.Font, Brushes.Black, (col + 200) / 2, (row + 300) / 2)
Next
PieFormerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mankowitzConnect With a Mentor Commented:
It looks as if you have already computed the angles for each pie wedge, so if you need to figure out the percentage, it should just be the angle/2pi,

percentage = angles(i)/(2*pi)*100
0
 
mankowitzCommented:
I think this answers the question.
0
All Courses

From novice to tech pro — start learning today.