コンテンツにスキップ

英文维基 | 中文维基 | 日文维基 | 草榴社区

利用者:Omotecho/sandbox/Template:Graph:円グラフ/doc

翻訳のため英語版 &oldid=854444763 から転写、特定版は2018年8月11日 (UTC) 11:49時点における The Rambling Man による版

Pie charts

[編集]

You can add a pie chart with a call to this template. This template uses the Vega version 2 JSON specification. An older template {{Pie chart}} is based on CSS rendering. The template GraphChart allows adding of map, line, bar and area charts, as well as stacked line, stacked bar and stacked area charts, but no pie charts. The template GraphChart also uses Vega version 2 and uses Module:Graph with Scribunto/Lua programming. This Template:Graph:PieChart doesn't use Lua.

Parameters

[編集]
  • radius specifies the radias of the pie chart in pixels, default is 100*legend specifies the title to be displayed above the legend, default is "Legend". To hide legend, set it to a "-" value without quotes.*values this is a list between square brackets of comma separated label value pairs between parentheses like [ {"x": "Peaches","y": 100}, {"x": "Plums","y": 32}]*rangeliteral this can be one of the Vega specified rangeliterals, default is "category10", but can also be a list like ["red", "green"]== Examples ==Example usage:
    {{Graph:PieChart|legend=Fruits|radius=125|values= [      {"x": "Peaches","y": 100},      {"x": "Plums","y": 32},      {"x": "Blueberries","y": 80},      {"x": "Strawberries","y": 46},      {"x": "Bananas","y": 41}    ] }}

TemplateData

[編集]
これはビジュアルエディターテンプレートウィザードにより使用されるテンプレートのためのTemplateData文書です。

Omotecho/sandbox/Template:Graph:円グラフ

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

テンプレートパラメーター

このテンプレートは、パラメーターを1行で記述することが推奨されています。

パラメーター説明状態
Radiusradius

Specify the radius of the pie in number of pixels

既定
100
100
数値推奨
Legend Titlelegend

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

既定
"Legend"
"Fruits"
文字列推奨
Inner Radiusinnerradius

To create a doughnut chart specify an inner radius

既定
0
0
数値省略可能
Valuesvalues data

Specify the label value pairs

[ {"x": "Peaches","y": 100}, {"x": "Plums","y": 32}, {"x": "Blueberries","y": 80}, {"x": "Strawberries","y": 46}, {"x": "Bananas","y": 41} ]
不明必須
The colors of the slicesrangeliteral colors

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

既定
"category10"
"category10"
文字列省略可能