Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Wnt/Plotter/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===function "piechart"=== This uses the miter joining of border elements in HTML/CSS to draw pie-shaped slices. I still don't fully understand the code taken from [[Template:Pie chart]] but have made it a bit more comprehensible. The main improvement so far is that it is resizable and not limited to 10 slices. New parameters are * ''Radius'' (default 100) - radius of the pie chart * ''nowiki'' - include a nonblank value to read rather than graph the output To quote the piechart template * option "thumb" specifies which side of the page the chart is floated to and defaults to <code>right</code>, as with image files. To make the chart appear on the ''left'' side of the page, specify <code>thumb=left</code>. * "caption" is a string of text that appears on a line just before the legend. * option "<code>other</code>", if specified, will cause an "Other" item to appear in the legend. ''(don't know if I implemented that)'' * each "label''N"'' is a string of text that appears in the legend entry for a slice. Omitting it will cause a legend entry to not be shown for that slice. * each "value''N"'' is the percentage that the slice represents. Do ''not'' include the percent sign. ''(Need to fix that)'' Also note that it is shown in the legend as written (just after the label), without any rounding or other reformatting. * each "color''N"'' is a [[Web colors|CSS color code or name]]. See [[Module:Plotter/DefaultColors]] for the default values. This can be overridden with: * "colorset" - specifies a Module: space file to get a list of color names and values Note that the nowiki example given at the beginning of Template:Pie chart's documentation doesn't work, but it doesn't work for that template either. If there was ever some way to specify colors with numbers like 2 or 8, I think it's been forgotten. {{#invoke:Sandbox/Wnt/Plotter|piechart |radius=150 |other = yes |value1 = 1 |label1 = One |value2 = 32 |label2 = Two |value3 = 12 |label3 = Three |value4 = 3 |label4 = Four |value5 = 2 |label5 = Five |value6 = 1 |label6 = Six |value7 = 3 |value8 = 7 |value9 = 2 |value10 = 3 |value11 = 1 |value12 = 4 |value13 = 7 |value14 = 1 |value15 = 1 |value16 = 3 |value17 = 3 |value18 = 3 |value19 = 2 }} {{#invoke:Sandbox/Wnt/Plotter|piechart | caption=[[Religion in the Czech Republic]] as of 2001. | other = yes | label1 = [[Atheist]]s and [[Agnosticism|agnostics]] | value1 = 59 | color1 = silver | label2 = [[Catholic Church|Catholics]] | value2 = 26.8 | color2 = #008 | label3 = [[Protestantism|Protestants]] | value3 = 2.5 | color3 = #08f }}
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)