전체의 구성
선버스트 차트
전체를 이루는 항목과 각 항목의 하위 구성을 두 겹의 링으로 보여 줍니다.
이 페이지의 내용
선버스트 차트는 전체의 구성을 두 단계로 보여 줍니다. 각 계열은 전체에서 차지하는 비율만큼 안쪽 링의 조각이 되고, 해당 계열의 children에 속한 각 항목은 그 안쪽 조각 바로 바깥에 놓이는 바깥쪽 링의 조각이 됩니다. 중심에서 바깥으로 읽으면 전체를 이루는 항목과 각 항목의 하위 구성을 파악할 수 있습니다. 하위 조각에는 상위 항목의 색을 단계적으로 밝게 적용하고, 가운데는 값을 표시할 공간으로 남겨 둡니다.
선버스트 차트
<div class="card max-w(480) mx-auto"> <div class="card-header"> <h3 class="card-title">Sessions</h3> <p class="card-description">By device and system</p> </div> <figure class="chart chart-split" id="devices" style="--chart-size: 11rem"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('devices'), { type: 'sunburst', label: 'Sessions by device and operating system, in percent', format: function (value) { return value + '%' }, series: [ { name: 'Mobile', children: [{ name: 'iOS', value: 34 }, { name: 'Android', value: 27 }] }, { name: 'Desktop', children: [{ name: 'Windows', value: 18 }, { name: 'macOS', value: 12 }, { name: 'Linux', value: 3 }] }, { name: 'Tablet', children: [{ name: 'iPadOS', value: 5 }, { name: 'Android', value: 1 }] } ]})})</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">Sessions</h3> <p className="card-description">By device and system</p> </div> <Chart className="chart-split" id="devices" style={{ '--chart-size': '11rem' } as React.CSSProperties} type="sunburst" label="Sessions by device and operating system, in percent" format={function (value) { return value + '%' }} series={[ { name: 'Mobile', children: [{ name: 'iOS', value: 34 }, { name: 'Android', value: 27 }] }, { name: 'Desktop', children: [{ name: 'Windows', value: 18 }, { name: 'macOS', value: 12 }, { name: 'Linux', value: 3 }] }, { name: 'Tablet', children: [{ name: 'iPadOS', value: 5 }, { name: 'Android', value: 1 }] } ]} /></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">Sessions</h3> <p class="card-description">By device and system</p> </div> <Chart class="chart-split" id="devices" style="--chart-size: 11rem" type="sunburst" label="Sessions by device and operating system, in percent" format={function (value) { return value + '%' }} series={[ { name: 'Mobile', children: [{ name: 'iOS', value: 34 }, { name: 'Android', value: 27 }] }, { name: 'Desktop', children: [{ name: 'Windows', value: 18 }, { name: 'macOS', value: 12 }, { name: 'Linux', value: 3 }] }, { name: 'Tablet', children: [{ name: 'iPadOS', value: 5 }, { name: 'Android', value: 1 }] } ]} /></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">Sessions</h3> <p class="card-description">By device and system</p> </div> <Chart class="chart-split" id="devices" style="--chart-size: 11rem" type="sunburst" label="Sessions by device and operating system, in percent" :format="function (value) { return value + '%' }" :series="[ { name: 'Mobile', children: [{ name: 'iOS', value: 34 }, { name: 'Android', value: 27 }] }, { name: 'Desktop', children: [{ name: 'Windows', value: 18 }, { name: 'macOS', value: 12 }, { name: 'Linux', value: 3 }] }, { name: 'Tablet', children: [{ name: 'iPadOS', value: 5 }, { name: 'Android', value: 1 }] } ]" /> </div></template>항목에 자체 value를 지정하면 그 값을 사용하고, 지정하지 않으면 하위 항목의 합계를 사용합니다. 하위 항목이 없는 항목은 안쪽 링에만 조각이 생깁니다. 범례에는 상위 항목의 이름이 나오고, 하위 항목의 이름은 값 표시와 각 데이터 포인트의 이름에 포함됩니다. 이 차트는 세 번째 링을 표시하지 않으므로 두 단계로 구성하고 항목별 하위 항목 수를 적게 유지합니다. 더 많은 항목을 보여 주려면 트리맵을 사용합니다.
#옵션
| 옵션 | 기본값 | |
|---|---|---|
label | 없음 | 차트가 보여 주는 내용과 단위를 설명하는 접근성 이름 |
series | [] | 각 계열에 name과 차트 유형에 맞는 values, value, points, ranges 또는 children을 지정합니다. category, type, low와 high, 링의 max는 선택 사항입니다. |
format, tickFormat | 로캘 기본 형식 | 값과 눈금의 표시 형식입니다. 산점도의 가로축에는 xFormat을 사용합니다. |
legend, toggle | 계열이 두 개일 때 표시, true | 범례를 표시할지, 범례 항목을 체크박스로 표시할지 설정합니다. |
값 표시, 키보드 조작, 범례, 색상, 눈금은 모든 차트 유형에 공통입니다. 차트에서 전체 옵션, 클래스, 사용자 지정 속성을 확인할 수 있습니다.