탐색

v2.1.0
비교

범위 차트

두 값 사이의 구간을 시작점부터 끝점까지 표시합니다.

이 페이지의 내용

범위 차트는 월별 최저·최고 기온, 매장 영업시간, 급여 범위처럼 시작값과 끝값 사이를 막대로 표시합니다. 계열의 ranges에 들어가는 각 항목은 값의 쌍입니다. 막대는 두 값 사이에 떠 있고 양 끝이 둥글게 처리됩니다. 막대 길이는 양 끝값의 차이를 나타냅니다. 축은 0을 기준으로 시작할 필요 없이 표시할 구간에 맞춰 설정됩니다.

범위 차트

<div class="card max-w(560) mx-auto">  <div class="card-header">    <h3 class="card-title">Temperature</h3>    <p class="card-description">Lowest and highest by month, in degrees Celsius</p>  </div>  <figure class="chart" id="temperature"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('temperature'), {  type: 'range',  label: 'Lowest and highest temperature by month, in degrees Celsius',  labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],  series: [{ name: 'Tokyo', ranges: [[2, 10], [3, 11], [5, 14], [10, 19], [15, 23], [19, 26], [23, 30], [24, 31], [21, 27], [15, 22], [9, 17], [4, 12]] }],  format: function (value) { return value + '°' }})})</script><script type="module">  import { attach } from '@master/ui/behaviors'  attach()</script>
import { Chart } from './ui/chart'<div className="card max-w(560) mx-auto">  <div className="card-header">    <h3 className="card-title">Temperature</h3>    <p className="card-description">Lowest and highest by month, in degrees Celsius</p>  </div>  <Chart    id="temperature"    type="range"    label="Lowest and highest temperature by month, in degrees Celsius"    labels={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}    series={[{ name: 'Tokyo', ranges: [[2, 10], [3, 11], [5, 14], [10, 19], [15, 23], [19, 26], [23, 30], [24, 31], [21, 27], [15, 22], [9, 17], [4, 12]] }]}    format={function (value) { return value + '°' }}  /></div>
<script>  import Chart from './ui/Chart.svelte'</script><div class="card max-w(560) mx-auto">  <div class="card-header">    <h3 class="card-title">Temperature</h3>    <p class="card-description">Lowest and highest by month, in degrees Celsius</p>  </div>  <Chart    id="temperature"    type="range"    label="Lowest and highest temperature by month, in degrees Celsius"    labels={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}    series={[{ name: 'Tokyo', ranges: [[2, 10], [3, 11], [5, 14], [10, 19], [15, 23], [19, 26], [23, 30], [24, 31], [21, 27], [15, 22], [9, 17], [4, 12]] }]}    format={function (value) { return value + '°' }}  /></div>
<script setup>import Chart from './ui/Chart.vue'</script><template>  <div class="card max-w(560) mx-auto">    <div class="card-header">      <h3 class="card-title">Temperature</h3>      <p class="card-description">Lowest and highest by month, in degrees Celsius</p>    </div>    <Chart      id="temperature"      type="range"      label="Lowest and highest temperature by month, in degrees Celsius"      :labels="['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']"      :series="[{ name: 'Tokyo', ranges: [[2, 10], [3, 11], [5, 14], [10, 19], [15, 23], [19, 26], [23, 30], [24, 31], [21, 27], [15, 22], [9, 17], [4, 12]] }]"      :format="function (value) { return value + '°' }"    />  </div></template>

막대 차트와 마찬가지로 레이블마다 여러 계열을 나란히 배치합니다. horizontal을 설정하면 레이블을 세로로 나열하고 척도를 가로축에 표시하므로, 시간 구간이나 세로 막대 아래에 넣기 어려울 만큼 긴 이름을 표시하기에 적합합니다. 사용자가 일정 구간을 옮기거나 길이를 조절할 수 있게 하려면 Gantt를 사용합니다.

#옵션

옵션기본값
label없음차트가 보여 주는 내용과 단위를 설명하는 플롯의 접근성 이름
labels[]축을 따라, 레이더 차트 둘레에, 또는 히트맵의 열 위에 표시하는 이름
series[]각 계열의 name과 차트 유형에 따라 사용하는 values, value, points, ranges 또는 children입니다. category, type, low와 high, 링의 max도 지정할 수 있습니다.
horizontalfalse막대, 범위, 덤벨, 상자 수염 그림을 가로로 표시합니다.
min, max, ticks데이터에 맞춤, 4축의 양 끝값과 대략적인 눈금 수입니다. 산점도의 가로축에는 xMin, xMax, xTicks를 사용합니다.
format, tickFormat로캘에 따름값과 눈금 레이블의 표시 형식입니다. 산점도의 가로축에는 xFormat을 사용합니다.
current없음aria-current로 표시할 점의 인덱스
legend, toggle계열이 두 개일 때 표시, true범례를 표시할지, 범례 항목을 체크박스로 표시할지 지정합니다.

값 표시, 키보드 조작, 범례, 색상, 척도는 모든 차트 유형에 공통으로 적용됩니다. 차트에서 공통 동작과 모든 옵션, 클래스, 사용자 지정 속성을 확인할 수 있습니다.