Solved

Pie Chart and VB

Posted on 2003-11-13
4
303 Views
Last Modified: 2010-05-01

Hi All,

Is anyone of you have any good example of drawing pie chart in VB? The pie chart would have different color for each category and hence the legend to describe the category.

Looking forward to your answer!

Sean
0
Comment
Question by:whsean
[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
4 Comments
 
LVL 11

Accepted Solution

by:
bingie earned 200 total points
ID: 9744676
Hi,

Here is an example on using the MS Chart Control.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q275649&ID=KB;EN-US;Q275649&sd=msdn&

*********************************************************

Here is a basic pie chart you can make using a picture box:


Just Load this code in to a new VB application, and make a new picture box that is a sqare.

Private Sub Form_Load()

Dim Total As Single
Dim ken As Single
Dim bill As Single
Dim fred As Single

bill = 6000
ken = 10000
fred = 7000

Total = bill + ken + fred

bill = bill / Total * 2 * 3.145926
ken = (ken + bill) / Total * 2 * 3.145926
fred = (ken + bill + fred) / Total * 2 * 3.145926


Picture1.Scale (-5, 5)-(5, -5)
Picture1.Circle (0, 0), 4
Picture1.Line (0, 0)-(4, 0)
Picture1.Line (0, 0)-(4 * Cos(bill), 4 * Sin(bill))
Picture1.Line (0, 0)-(4 * Cos(ken), 4 * Sin(ken))

End Sub

(thx to Jacamar for this)

***********************************************************

You can also see these links:

http:Q_20129610.html

http:Q_20372863.html
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10548262
Moderator, my recommended disposition is:

    Accept bingie's comment(s) as an answer.

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put text in a picture ASP.NET C# 2 73
VBA: Select SQL query based on a config Sheet v2 11 55
Advice in Xamarin 21 118
Win 10 Automation Error with .doCmd in Access 2 83
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 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