?
Solved

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

Posted on 2014-12-09
4
Medium Priority
?
92 Views
Last Modified: 2016-07-18
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
0
Comment
Question by:PieFormer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 2000 total points
ID: 40490409
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
 
LVL 24

Expert Comment

by:mankowitz
ID: 41717663
I think this answers the question.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question