Template:Graph:Chart/doc

使用例[編集]

折れ線グラフ:

{{Graph:Chart|width=400|height=100|type=line|x=1,2,3,4,5,6,7,8|y=10, 12, 6, 14, 2, 10, 7, 9}}


補足:Y軸は|y=の最小値から始まるが、|yAxisMin=で強制指定できる。

面グラフ:

{{Graph:Chart|width=400|height=100|type=area|x=1,2,3,4,5,6,7,8|y=10, 12, 6, 14, 2, 10, 7, 9}}


補足: Y軸は0から始まる。

棒グラフ:

{{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Y|type=rect|x=1,2,3,4,5,6,7,8|y=10, 12, 6, 14, 2, 10, 7, 9}}

色を使った複数の折れ線グラフ:

{{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Y|legend=凡例|type=line|x=1,2,3,4,5,6,7,8|y1=10, 12, 6, 14, 2, 10, 7, 9 |y2=2,4,6,8,13,11,9,2|colors=#0000aa,#ff8000}}

重なった部分は混色になる複数の面グラフ:

{{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Y|legend=凡例|type=area|x=1,2,3,4,5,6,7,8|y1=10, 12, 6, 14, 2, 10, 7, 9 |y2=2,4,6,8,13,11,9,2|colors=#800000aa,#80ff8000}}

複数のデータに基づく棒グラフ:

{{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Y|legend=凡例|type=rect|x=1,2,3,4,5,6,7,8|y1=10, 12, 6, 14, 2, 10, 7, 9 |y2=2,4,6,8,13,11,9,2|colors=#800000aa,#80ff8000}}

曲線の面グラフ:

{{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Y|legend=凡例|type=stackedarea|x=1,2,3,4,5,6,7,8|y1=10, 12, 6, 14, 2, 10, 7, 9 |y2=2,4,6,8,13,11,9,2|interpolate=monotone|colors=seagreen, orchid}}

データ系列を積み重ねた棒グラフ:

{{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Y|legend=凡例|type=stackedrect|x=1,2,3,4,5,6,7,8|y1=10, 12, 6, 14, 2, 10, 7, 9 |y2=2,4,6,8,13,11,9,2|y1Title=データA|y2Title=データB|colors=seagreen, orchid}}

枠付き表示[編集]

{{Imageframe}}を使用した折れ線グラフ:

{{Image frame 
 | caption=折れ線グラフ
 | content = {{Graph:Chart
   | width=400
   | height=150
   | type=line
   | x=1,2,3,4,5,6,7,8|y=10,12,6,14,2,10,7,9
  }} 
}}
折れ線グラフ

{{Side box}}を使った棒グラフ:

{{Side box |metadata=No<!--This makes the box display on the mobile site-->
 | above = '''ほげほげのグラフ'''
 | abovestyle = text-align:center
 | text = {{Graph:Chart
  |height = 150
  |width = 200
  |xAxisTitle = 年
  |xAxisAngle = -40
  |yAxisTitle = ふがふがの単位
  |yAxisMin = 0
  |type = rect
  |showValues = offset:4
  |x = 2011, 2012, 2013, 2014, 2015, 2016
  |y1 = 1326, 145, 203, 377, 639, 306
  |y2 =   ,     ,     , 226, 208, 276
  |colors = blue,grey
  }}
 | below = ここに説明書きと出典
}}