Print Page | Close Window

Creating a Pie Chart

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3234
Printed Date: 21 Aug 25 at 1:51AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Creating a Pie Chart
Posted By: bob
Subject: Creating a Pie Chart
Date Posted: 21 Dec 15 at 6:40PM
I've tried using the Search to find code to produce a pie chart. I'm a trial user trying to see if this is the right tool for me.

I've completed the Hello-World example in VB6 and PowerBasic without issues. Also, I've played with lines, loading graphics, bar codes and text (although TrueType fonts were ignored).

Thanks

Bob



Replies:
Posted By: bob
Date Posted: 24 Dec 15 at 12:33PM
I've tried the following code using DrawArc to create to slices of a pie chart.
  DIM iInstanceID AS LONG,  dXPos AS DOUBLE,  dYPos AS DOUBLE
  DIM dRadius AS DOUBLE,  dStartAngle AS DOUBLE
  DIM dEndAngle AS DOUBLE,  iPie AS LONG
  DIM iDrawOptions AS LONG, dRed AS DOUBLE, dgreen AS DOUBLE, dblue AS DOUBLE
  dXPos = 6
  dYPos = 6
  dRadius = 1
  dStartAngle = 0
  dEndAngle = 90
  iPie = 1
  iDrawOptions = 1
  dRed = 255
  dGreen = 0
  dBlue  = 128
  Result& = DPLSetFillColor(LibInstance&, BYVAL dRed, BYVAL dGreen, BYVAL dBlue)
  Result& = DPLDrawArc(LibInstance&,BYVAL dXPos,BYVAL dYPos,BYVAL dRadius,BYVAL dStartAngle,BYVAL dEndAngle,BYVAL iPie,BYVAL iDrawOptions)
  Result& = DPLClosePath(LibInstance&)
  dRed = 255
  dGreen = 0
  dBlue = 0
  Result& = DPLSetFillColor(LibInstance&,BYVAL dRed,BYVAL dGreen,BYVAL dBlue)
  Result& = DPLDrawArc(LibInstance&,BYVAL dXPos,BYVAL dYPos,BYVAL dRadius,BYVAL dStartAngle,BYVAL dEndAngle,BYVAL iPie,BYVAL iDrawOptions)
  Result& = DPLClosePath(LibInstance&)
  dStartAngle = 90
  dEndAngle = 270
  Result& = DPLDrawArc(LibInstance&,BYVAL dXPos,BYVAL dYPos,BYVAL dRadius,BYVAL dStartAngle,BYVAL dEndAngle,BYVAL iPie,BYVAL iDrawOptions)


The entire pie chart ends up red instead of purple and red.  Hope someone can help.

Bob



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk