Hello,

I've been trying to colour the sections in the pie-chart example (in =20
rebol.com/docs/draw.html ... code is below) but I only get white sections=
. =20
Can someone tell me how to do this?

Regards, Rosemary



rebol []

data: [
     18 red
     22 blue
     15 green
     20 yellow
     10 purple
]

sum: 0
foreach [val color] data [sum: sum + val]

plot: copy [
     pen black
     circle 100x100 90
     line 100x100 100x10
]

total: 0
foreach [val color] data [
     angle: 360 * val / sum
     total: total + angle
     xy: 100x100 + as-pair 90 * sine total -90 * cosine total
     repend plot ['line 100x100 xy]
     append plot reduce [
         'fill-pen color
         'flood 100x100 +
             100x100 + (as-pair
                 90 * sine total - (angle / 2)
                 -90 * cosine total - (angle / 2)
             ) / 2
     ]
]

view layout [
     box snow 200x200 effect reduce ['draw plot]
]

--=20

Formix Australia - www.formix.com.au

613 9354 9585
PO Box 261 Nth Carlton Vic 3054
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to