"Pie Chart" marker symbols

Steve Lime steve.lime at DNR.STATE.MN.US
Fri Dec 17 10:58:09 EST 2004


Hi all: I was updating mapgd.c today to make use of GD functions that
appeared in GD 2.0.x. I made a small modification to the marker drawing
code for ELLIPSE symbols, specifically circles. Now if you specify a
style angle it is interpreted as a "pie slice". You can do things like:

  http://maps.dnr.state.mn.us/testing/charts/test.gif
  http://maps.dnr.state.mn.us/testing/charts/test.map

Since you can load an angle from an attribute (via ANGLEITEM) you can
build simple pie charts pretty easy. Only problem is it's hard to do
more than 2 colors, and the origin is always 0.

Assuming folks are ok with the modification (it's only 5 lines of code)
what about adding a STARTANGLE parameter? We could probably do some auto
computation of starting angles between styles so that multiple element
charts would be possible/easy to construct.

Steve



More information about the mapserver-dev mailing list