テンプレート:PieChartTSV

出典: 謎の百科事典もどき『エンペディア(Enpedia)』
ナビゲーションに移動 検索に移動

Lua エラー モジュール:PieChartTSV 内、49 行目: attempt to perform arithmetic on field '?' (a nil value)

この説明文は 『 テンプレート:PieChartTSV/doc 』 から呼び出されています。


Googleスプレッドシート や Excel から素早く円グラフを作れます。

  田中 (57.14%)
  鈴木 (28.57%)
  佐藤 (14.29%)

使い方[編集]

1 円グラフを挿入したいEnpediaのページに↓を貼り付け。

{{PieChartTSV|tsv=

}}

2 Googleスプレッドシート や Excel で以下の表を作成(おかか:鮭:青のり=5:3:1で円グラフを表示したいとする)。

おかか 5
3
青のり 1

3 表を選択し、Ctrl+Cでコピー(表全体が破線で囲われたらOK)

4 先ほどの文字列の中央空行に、Ctrl+Vで貼り付け↓こんな風に

{{PieChartTSV|tsv=
おかか	5
鮭	3
青のり	1
}}

5「ページを保存」したら完了!(今回の場合は色指定無しなので、自動で彩色されます)

  おかか (55.56%)
  鮭 (33.33%)
  青のり (11.11%)


引数[編集]

引数名 形式 既定値 説明
tsv TSV文字列 なし 円グラフの元となる縦持ちデータをここに指定します。
inputPer 文字列 なし 「Yes」の場合、データを%として直接入力します。
その他の場合、データの総和を100%とみなします。
caption 文字列 なし 円グラフの下に表示する説明文。
other 文字列 なし 「Yes」の場合、凡例「その他」(円グラフの余ってる部分)を表示します。

subst展開[編集]

また、PieChartTSVsubst:#invoke:PieChartTSV|mainに置き換えてページを保存すると、元の{{Pie chart}}テンプレートの書式を得られます。

{{subst:#invoke:PieChartTSV|main|tsv=
おかか	5
鮭	3
青のり	1
}}
↓↓↓
{{Pie chart
|label1=おかか|value1=55.56|color1=hsl(240deg 100% 50%)
|label2=鮭|value2=33.33|color2=hsl(0deg 100% 75%)
|label3=青のり|value3=11.11|color3=hsl(120deg 100% 35%)
}}
  おかか (55.56%)
  鮭 (33.33%)
  青のり (11.11%)


使用例[編集]

{{PieChartTSV|tsv=
田中	20	yellowgreen
鈴木	10	rgb(255, 194, 250)
佐藤	5	#8f4fc4
}}
  田中 (57.14%)
  鈴木 (28.57%)
  佐藤 (14.29%)


{{PieChartTSV|caption=キャプション|other=y|inputPer=y|tsv=
test1	4
test2	4
test3	4
test4	4
test5	4
test6	4
test7	4
test8	4
test9	4
test10	4
test11	4
test12	4
test13	4
test14	4
test15	4
test16	4
test17	4
test18	4
test19	4
test20	4
test21	4
}}

キャプション

  test1 (4%)
  test2 (4%)
  test3 (4%)
  test4 (4%)
  test5 (4%)
  test6 (4%)
  test7 (4%)
  test8 (4%)
  test9 (4%)
  test10 (4%)
  test11 (4%)
  test12 (4%)
  test13 (4%)
  test14 (4%)
  test15 (4%)
  test16 (4%)
  test17 (4%)
  test18 (4%)
  test19 (4%)
  test20 (4%)
  test21 (4%)
  その他 (16%)