Template:Pie chart/doc
円グラフを作成するテンプレートです。30個までの切片(要素)のグラフに対応します。
| これはTemplate:Pie chartの解説サブページです。 使用方法、カテゴリ、およびその他テンプレート自体に含まれない情報を収容しています。 |
円グラフを作成するテンプレートです。30個までの切片(要素)のグラフに対応します。
使用方法
- 上側(アナログ時計の12時の位置)から右回り(時計回り)、指定された順(並び替えはされない)に表示されます。
- 色名は自動的には表示されないので、必要なら別途指定してください。
- 「この項目では色を扱っています。…」と表示されるTemplate:色テンプレートは含まれていないので、別途指定してください。
{{Pie chart
| thumb = (left|right)グラフの位置(任意入力、デフォルトはright:右側)
| style = cssデータ
| caption = グラフの表題(任意入力)
| other = yesの場合、凡例に「その他」を加える(任意入力)
| label1 =切片1の凡例の表記
| value1 =切片1の百分率(数値のみ)
| color1 =切片1の表示色
| label2 =切片2の凡例の表記
| value2 =切片2の百分率(数値のみ)
| color2 =切片2の表示色
| label3 =切片2の凡例の表記
| value3 =切片3の百分率(数値のみ)
| color3 =切片3の表示色
}}
colorNの値を省略した場合は次の色になります。15以上に色分けする場合は、無指定だと14と同じ#A9A9A9になってしまうので、必ず自分で指定する必要があります。
- #1F78B4
- #33A02C
- #E31A1C
- #FF7F00
- #6A3D9A
- #B15928
- #A6CEE3
- #B2DF8A
- #FB9A99
- #FDBF6F
- #CAB2D6
- #FFFF99
- #FEEBE2
- #A9A9A9
colorNの値は、CSSカラーコードまたは色名を指定します:
合計が100%に満たない場合は、白色■の「その他」が表示されます。
表示例
One (32%)
Two (22%)
Three (12%)
Four (5%)
Five (4%)
Six (3%)
Seven (2%)
Eight (1%)
その他 (19%)
{{Pie chart
|other = yes
|value1 = 32
|label1 = One
|value2 = 22
|label2 = Two
|value3 = 12
|label3 = Three
|value4 = 5
|label4 = Four
|value5 = 4
|label5 = Five
|value6 = 3
|label6 = Six
|value7 = 2
|label7 = Seven
|value8 = 1
|label8 = Eight
}}
- thumb、caption、colorNは、省略している。
{{Pie chart
| caption=ある国の宗教別信者の割合
| other = yes
| label1 = [[無神論|無宗教]]および[[不可知論|不可知論者]]
| value1 = 59
| color1 = silver
| label2 = [[カトリック教会|カトリック]]
| value2 = 26.8
| color2 = #060
| label3 = [[プロテスタント]]
| value3 = 2.5
| color3 = #0af
}}
2022年の日本におけるプラスチックのリサイクル方法
マテリアルリサイクル:180万トン (25%)
ケミカルリサイクル:28万トン (4%)
サーマルリサイクル:510万トン (71%)
{{Pie chart
| caption=2022年の日本におけるプラスチックのリサイクル方法
| value1={{formatnum:{{#expr:180/(180+28+510)*100 round 0}}}}
| value2={{formatnum:{{#expr:28/(180+28+510)*100 round 0}}}}
| value3={{formatnum:{{#expr:510/(180+28+510)*100 round 0}}}}
| label1=マテリアルリサイクル:{{0}}180万トン
| label2=ケミカルリサイクル:{{0}}28万トン
| label3=サーマルリサイクル:{{0}}510万トン
| color1=dodgerblue
| color3=light-dark(coral,maroon)
}}
数値にパーセントではなく実数値を使えるようにした例。
関連テンプレート
- Template:Graph:Chart(円グラフも表示可能)
脚注
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.