how can i draw a pie chart

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mmotta19
Posts: 3
Joined: 2015-04-24T07:30:23-07:00
Authentication code: 6789

how can i draw a pie chart

Post by mmotta19 »

Hello.

I'm trying to create a pie chart, but I don't understand 2 parameters of the sintaxe.
For exemple:
convert -size 280x280 xc:yellow -stroke black -fill blue -draw "path 'M 120,140 L 120.00,40.00 A 100,100 0 0,1 220,140 Z'" c:\temp\pie.jpg

After de parameter A 100,100 has a 0 and 0,1 ( A 100,100 0 0,1 ....)

If I use like this, it don't works:
convert -size 280x280 xc:yellow -stroke black -fill blue -draw "path 'M 120,140 L 120.00,40.00 A 100,100 0 0,1 20,140 Z'" c:\temp\pie.jpg
I have to change the 0,1 to 1,1.

I don't know to determinate wich number it have to be.

Could someone help me?
thanks.
Marcelo Motta
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: how can i draw a pie chart

Post by snibgo »

The path commands "A", "L" etc are defined in the SVG standard. See https://www.w3.org/TR/SVG/paths.html#Pa ... veCommands . This explains the seven parameters to "A", with examples.

Your two parameters "0,1" are large-arc-flag and sweep-flag.
snibgo's IM pages: im.snibgo.com
Post Reply