how to generate pie chart
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 [email protected]
Re: how to generate pie chart
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
[email protected]