Template:Graph:Pie from row/doc

From RobotX
Jump to navigation Jump to search

Pie chart

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

Examples

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

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