Jump to content
IGNORED

ANOTHER PIE CHART PROBLEM


ac.tomo

Recommended Posts

I'm sorry for bringing up a 2nd topic on the same post, its just that I thought if I put this into the 1st post it wouldnt get noticed. What it is is I have a problem: I've attached 2 programs, 1 shows 9 different colours on Graphics 15 and the 2nd draws a pie-chart, the problem I got is that I would like to create the pie chart with up to the 9 possible colours (depending on the amount of segments in the piechart), but to do this the colours have to be drawn in a specific way and guess what? It's too complicated for me to do, aka its above me.

The piechart program segments are derived from the numbers in the DATA as percentages; 25 is 25% of the entire circle, 50 is 50% etc. and the colour program achieves its colours by altering the colours vertically. I would be most appreciative if someone could do this program for me and then I can reverse engineer it in order to try to understand it. As I say, there's no point trying to explain how to do it because its too complicated for me.

 

Thanks. Again, if someone can do this I would be most appreciative.

 

NB* If I use the program for anything credit will be acknowledged ofcourse.

 

colours.lst pchart.lst

Edited by ac.tomo
Link to comment
Share on other sites

I think this is going to be very difficult to resolve, even if you manage to simulate the different colours,

the closer you get to a horizontal line the less pixels you have to interlace the second colour with the first

and the calculation to find the insert point on each line would depend on the angle of the line, this could probably

be pre-determined and values placed in DATA statements, but again, you would need a set of lookup DATA

for each of the 360 degrees.

 

Link to comment
Share on other sites

I think you won't be able to accommodate for all different sizes of pie pieces and have the right colors. You might consider graphics 10 if you really want more colors, but at a loss of resolution. In graphics 15, I would just round-robin through the three non-background colors, so each piece has a different color in regard to its adjacent piece.

Link to comment
Share on other sites

Or use Graphics 11

 

10 REM PIE CHART IN GR.15
12 REM USING %'S
14 REM
100 GRAPHICS 11
103 POKE 708,148:POKE 709,54:POKE 710,
254
104 DEG
108 X=40:Y=60:S=30:C=1
110 V=0:Q=360/100
114 FOR D=0 TO 359
120 RX=(COS(D)*S)+X
130 RY=(SIN(D)*(S*2))+Y
139 COLOR C
140 PLOT X,Y:DRAWTO RX,RY
150 IF V=0 THEN READ B:V=1
160 Z=INT(Q*B)
170 IF D=Z THEN C=C+1:V=0
190 NEXT D
200 DATA 0,25,50,60,81,90,100
300 GOTO 300

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...