全体の内訳
リンググラフ
複数の値を、それぞれの上限に対する割合で塗りつぶしたリングで示します。
このページの内容
リンググラフは、3つの目標や、あるプランの複数の割り当て枠など、それぞれに上限がある複数の値を示します。リングは外側から内側へ同心円状に並び、それぞれ上端から max に対する割合まで塗りつぶされます。グラフや系列で別の値を指定しない場合、上限は100です。リングのトラックにはそれぞれの色を淡く使い、目標までの残りを示します。
リンググラフ
<div class="card max-w(480) mx-auto"> <div class="card-header"> <h3 class="card-title">Today</h3> <p class="card-description">Three goals</p> </div> <figure class="chart chart-split" id="goals" style="--chart-size: 10rem"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('goals'), { type: 'rings', label: 'Progress of three goals today, in percent', center: { value: '72%', label: 'Move' }, format: function (value) { return value + '%' }, series: [ { name: 'Move', value: 72 }, { name: 'Exercise', value: 45 }, { name: 'Stand', value: 90 } ]})})</script><script type="module"> import { attach } from '@master/ui/behaviors' attach()</script>import { Chart } from './ui/chart'<div className="card max-w(480) mx-auto"> <div className="card-header"> <h3 className="card-title">Today</h3> <p className="card-description">Three goals</p> </div> <Chart className="chart-split" id="goals" style={{ '--chart-size': '10rem' } as React.CSSProperties} type="rings" label="Progress of three goals today, in percent" center={{ value: '72%', label: 'Move' }} format={function (value) { return value + '%' }} series={[ { name: 'Move', value: 72 }, { name: 'Exercise', value: 45 }, { name: 'Stand', value: 90 } ]} /></div><script> import Chart from './ui/Chart.svelte'</script><div class="card max-w(480) mx-auto"> <div class="card-header"> <h3 class="card-title">Today</h3> <p class="card-description">Three goals</p> </div> <Chart class="chart-split" id="goals" style="--chart-size: 10rem" type="rings" label="Progress of three goals today, in percent" center={{ value: '72%', label: 'Move' }} format={function (value) { return value + '%' }} series={[ { name: 'Move', value: 72 }, { name: 'Exercise', value: 45 }, { name: 'Stand', value: 90 } ]} /></div><script setup>import Chart from './ui/Chart.vue'</script><template> <div class="card max-w(480) mx-auto"> <div class="card-header"> <h3 class="card-title">Today</h3> <p class="card-description">Three goals</p> </div> <Chart class="chart-split" id="goals" style="--chart-size: 10rem" type="rings" label="Progress of three goals today, in percent" :center="{ value: '72%', label: 'Move' }" :format="function (value) { return value + '%' }" :series="[ { name: 'Move', value: 72 }, { name: 'Exercise', value: 45 }, { name: 'Stand', value: 90 } ]" /> </div></template>1つの値が上限にどれだけ近いかを単独で示すには、ゲージを使います。
#オプション
| オプション | 既定値 | |
|---|---|---|
label | なし | グラフが何をどの単位で示すかを伝える、プロットのアクセシブルな名前 |
series | [] | 各系列に name と、values、扇形1つまたはリング1本に対応する value、散布図の points のいずれかを指定。category、type、リングの max は任意 |
min, max, ticks | データに合わせる、4 | 目盛りの下限と上限、およその目盛り数。散布図の横軸には xMin、xMax、xTicks を使用 |
format, tickFormat | ロケールに従う | 値と目盛りの表示形式。散布図の横軸には xFormat を使用 |
hole, center | .7、なし | ドーナツグラフの穴の大きさと、ドーナツグラフやリンググラフの中央に表示する内容 |
legend, toggle | 2系列の場合、true | 凡例を表示するか、凡例の各項目をチェックボックスにするか |
値表示、キー操作、凡例、色、目盛りはすべてのグラフ形式で共通です。チャートに、すべてのオプション、クラス、カスタムプロパティとあわせて記載しています。