Solved

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

Posted on 2014-12-09
4
63 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
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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