Template:Graph:Pie from row/doc

Pie chart edit

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

Examples edit

Example usage:

{{Graph:Pie from row
| table = Bea.gov/GDP by state.tab
| rowtest = year==2015
| series = "TX","CA","NY"
| show = label
| legend = Relative GDP
| radius = 125
}}
{{Graph:Pie from row
| table = Bea.gov/GDP by state.tab
| rowtest = year==2015
| series = "AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"
| legend = -
| radius = 125
}}

See or edit source data.

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 series columns to plot, and the rowtest to select which row to use

Example
bea.gov/GDP by state.tab
Unknownrequired
seriesseries

Data page name on Commons, without the Data: prefix. The table should contain xField column, like year or date, and one or more series columns to plot

Stringrequired
rowtestrowtest

a condition to select just one row of the data for the display

Example
year==2015
Stringrequired
Radiusradius

Specify the radius of the pie in number of pixels

Default
100
Example
100
Numbersuggested
Legend Titlelegend

The title that will appear above the legend, or '-' to hide it

Default
"Legend"
Example
"Fruits"
Stringsuggested
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
showshow

Show "label", "value" or "both" inside the pie chart

Stringoptional
titletitle

Optional title for the graph

Stringoptional
debugdebug

no description

Unknownoptional