Click to See Complete Forum and Search --> : how to generate pie chart


stonezhang
May 9th, 2001, 04:24 AM
hi, I have a easy question need ur help.

I have a txt file which has two field, one is handset model (for example "Erisson T18"), another is test fault code(pure integer number- like 12-- which stands for different fault reason). I need read this file and then generate a pie chart for the fault codes in a certain handset.

Any suggestion how to do it?

BTW, I am a VB learner, please show me in detail.

Many thanks welcometo2000@hotmail.com

Iouri
May 9th, 2001, 07:15 AM
Option Explicit

Private Const PI As Double = 3.14159265359
Private Const CircleEnd As Double = -2 * PI

Public Sub DrawPiePiece(lColor As Long, fStart As Double, fEnd As Double)
Dim dStart As Double
Dim dEnd As Double

Picture1.FillColor = lColor
Picture1.FillStyle = 0
dStart = fStart * (CircleEnd / 100)
dEnd = fEnd * (CircleEnd / 100)
Picture1.Circle (100, 100), 60, , dStart, dEnd
End Sub

Private Sub Command1_Click()
Picture1.ScaleMode = vbPixels
Call DrawPiePiece(QBColor(1), 0.001, 36)
Call DrawPiePiece(QBColor(2), 36, 55)
Call DrawPiePiece(QBColor(3), 55, 75)
Call DrawPiePiece(QBColor(4), 75, 99.999)
End Sub


Iouri Boutchkine
iouri@hotsheet.com