Jump to content

Template:Graph:Pie2/doc

From mediawiki.org

Pie chart

[edit]

You can add a pie chart with a call to this template.

Examples

[edit]

Example usage:

{{Graph:Pie2
| table = Wikimedia/all sites by browser family and major percent.tab
| field1 = browserFamily
| field2 = browserMajorVer
| value = percent
| width = 300
}}

See or edit source data.

Template Data

[edit]

This template adds a pie chart to the page using Graph extension

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
tabletable

Data page name on Commons, without the Data: prefix. The table should contain at least three columns - major group, minor group, and numeric value

Example
Wikimedia/all sites by browser family and major percent.tab
Unknownrequired
field1field1

Id of the column shown as the inner circle

Example
browserFamily
Unknownrequired
field2field2

Id of the column shown as the outer circle

Example
browserMajorVer
Unknownrequired
valuevalue

Id of the column with the numeric value

Example
percent
Unknownrequired
widthwidth

Specify the width of the pie in number of pixels

Default
300
Numbersuggested
The colors of the slicescolors

The colors of the slices, specified as Vega defined rangeliteral. This can also be a list like [ "red", "green" ]

Default
"category10"
Example
"category10"
Stringoptional
innerportioninnerportion

Portion of the radius shown for the inner circle. Must be between 0 and 0.5

Default
0.35
Example
0.25
Numberoptional
debugdebug

no description

Unknownoptional