전체의 구성
링 차트
값마다 링을 하나씩 두고 각 값이 해당 최댓값에서 차지하는 비율만큼 채웁니다.
이 페이지의 내용
링 차트는 세 가지 목표의 달성량이나 요금제의 항목별 사용량처럼 각자 기준이 되는 전체량이 있는 여러 값을 보여 줍니다. 링은 바깥쪽에서 안쪽으로 차례로 배치하고, 각 링의 맨 위에서 시작해 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>값 하나가 한도에 얼마나 가까운지 표시하려면 Gauge를 사용합니다.
#옵션
| 옵션 | 기본값 | |
|---|---|---|
label | 없음 | 차트가 보여 주는 내용과 단위를 설명하는 플롯의 접근성 이름 |
series | [] | 각 계열에 name과 함께 values, 조각이나 링의 value, 또는 산점도의 points를 지정합니다. category, type, 링의 max도 지정할 수 있습니다. |
min, max, ticks | 데이터에 맞춤, 4 | 축의 양 끝값과 대략적인 눈금 수입니다. 산점도의 가로축에는 xMin, xMax, xTicks를 사용합니다. |
format, tickFormat | 로캘에 따름 | 값과 눈금 레이블의 표시 형식입니다. 산점도의 가로축에는 xFormat을 사용합니다. |
hole, center | .7, 없음 | 도넛 차트의 구멍 크기와 도넛 차트 또는 링 차트의 중앙에 표시할 내용 |
legend, toggle | 계열이 두 개일 때 표시, true | 범례를 표시할지, 범례 항목을 체크박스로 표시할지 지정합니다. |
값 표시, 키보드 조작, 범례, 색상, 척도는 모든 차트 유형에 공통으로 적용됩니다. 차트에서 공통 동작과 모든 옵션, 클래스, 사용자 지정 속성을 확인할 수 있습니다.