탐색

v2.1.0
관계

산점도

항목 하나를 점 하나로 표시해 두 측정값의 관계를 보여 줍니다.

이 페이지의 내용

산점도는 두 측정값의 관계를 보여 줍니다. 각 점은 하나의 항목을 나타내며, x와 y에 따라 위치가 정해집니다. 두 축의 범위는 모든 점을 포함하도록 깔끔한 숫자에서 시작하고 끝납니다. 0에 가까운 점이 있을 때만 0에서 시작합니다. 범위를 고정하려면 xMin, xMax, min, max를 설정합니다. 포인터를 점 주변에 올려도 해당 점이 반응합니다. 값 표시의 제목에는 해당 점의 label 값을 사용합니다.

산점도

<div class="card max-w(560) mx-auto">  <div class="card-header">    <h3 class="card-title">Responses</h3>    <p class="card-description">Time in milliseconds against size in kilobytes</p>  </div>  <figure class="chart" id="responses"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('responses'), {  type: 'scatter',  label: 'Response time in milliseconds against size in kilobytes',  series: [    { name: 'API', points: [[12, 38], [18, 52], [25, 61], [31, 70], [38, 96], [44, 88], [52, 120], [60, 131], [66, 150], [74, 142], [81, 171]].map(function (pair) { return { x: pair[0], y: pair[1] } }) },    { name: 'Pages', points: [[20, 160], [28, 150], [35, 175], [47, 190], [55, 168], [63, 210], [72, 224], [80, 205], [88, 240]].map(function (pair) { return { x: pair[0], y: pair[1] } }) }  ]})})</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">Responses</h3>    <p className="card-description">Time in milliseconds against size in kilobytes</p>  </div>  <Chart    id="responses"    type="scatter"    label="Response time in milliseconds against size in kilobytes"    series={[      { name: 'API', points: [[12, 38], [18, 52], [25, 61], [31, 70], [38, 96], [44, 88], [52, 120], [60, 131], [66, 150], [74, 142], [81, 171]].map(function (pair) { return { x: pair[0], y: pair[1] } }) },      { name: 'Pages', points: [[20, 160], [28, 150], [35, 175], [47, 190], [55, 168], [63, 210], [72, 224], [80, 205], [88, 240]].map(function (pair) { return { x: pair[0], y: pair[1] } }) }    ]}  /></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">Responses</h3>    <p class="card-description">Time in milliseconds against size in kilobytes</p>  </div>  <Chart    id="responses"    type="scatter"    label="Response time in milliseconds against size in kilobytes"    series={[      { name: 'API', points: [[12, 38], [18, 52], [25, 61], [31, 70], [38, 96], [44, 88], [52, 120], [60, 131], [66, 150], [74, 142], [81, 171]].map(function (pair) { return { x: pair[0], y: pair[1] } }) },      { name: 'Pages', points: [[20, 160], [28, 150], [35, 175], [47, 190], [55, 168], [63, 210], [72, 224], [80, 205], [88, 240]].map(function (pair) { return { x: pair[0], y: pair[1] } }) }    ]}  /></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">Responses</h3>      <p class="card-description">Time in milliseconds against size in kilobytes</p>    </div>    <Chart      id="responses"      type="scatter"      label="Response time in milliseconds against size in kilobytes"      :series="[        { name: 'API', points: [[12, 38], [18, 52], [25, 61], [31, 70], [38, 96], [44, 88], [52, 120], [60, 131], [66, 150], [74, 142], [81, 171]].map(function (pair) { return { x: pair[0], y: pair[1] } }) },        { name: 'Pages', points: [[20, 160], [28, 150], [35, 175], [47, 190], [55, 168], [63, 210], [72, 224], [80, 205], [88, 240]].map(function (pair) { return { x: pair[0], y: pair[1] } }) }      ]"    />  </div></template>

#버블

size가 있는 점은 버블이 되며, 세 번째 측정값을 점의 면적으로 나타냅니다. 반지름 대신 면적이 크기 값에 비례하므로, 크기 값이 4배이면 면적도 4배입니다. 버블은 같은 색의 테두리와 반투명 채우기로 표시되어 겹친 부분이 비쳐 보입니다. 큰 버블부터 그리므로 큰 버블 위에 겹친 작은 버블에도 포인터를 올릴 수 있습니다.

버블

<div class="card max-w(560) mx-auto">  <div class="card-header">    <h3 class="card-title">Markets</h3>    <p class="card-description">Growth against share; a bubble is as large as its revenue</p>  </div>  <figure class="chart" id="markets"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('markets'), {  type: 'scatter',  label: 'Markets: growth in percent against share in percent, sized by revenue in millions',  series: [{    name: 'Markets',    points: [      { x: 4, y: 12, size: 40, label: 'Japan' },      { x: 9, y: 20, size: 120, label: 'Germany' },      { x: 14, y: 8, size: 20, label: 'Brazil' },      { x: 18, y: 26, size: 260, label: 'United States' },      { x: 6, y: 30, size: 64, label: 'India' },      { x: 12, y: 16, size: 90, label: 'France' }    ]  }]})})</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">Markets</h3>    <p className="card-description">Growth against share; a bubble is as large as its revenue</p>  </div>  <Chart    id="markets"    type="scatter"    label="Markets: growth in percent against share in percent, sized by revenue in millions"    series={[{      name: 'Markets',      points: [        { x: 4, y: 12, size: 40, label: 'Japan' },        { x: 9, y: 20, size: 120, label: 'Germany' },        { x: 14, y: 8, size: 20, label: 'Brazil' },        { x: 18, y: 26, size: 260, label: 'United States' },        { x: 6, y: 30, size: 64, label: 'India' },        { x: 12, y: 16, size: 90, label: 'France' }      ]    }]}  /></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">Markets</h3>    <p class="card-description">Growth against share; a bubble is as large as its revenue</p>  </div>  <Chart    id="markets"    type="scatter"    label="Markets: growth in percent against share in percent, sized by revenue in millions"    series={[{      name: 'Markets',      points: [        { x: 4, y: 12, size: 40, label: 'Japan' },        { x: 9, y: 20, size: 120, label: 'Germany' },        { x: 14, y: 8, size: 20, label: 'Brazil' },        { x: 18, y: 26, size: 260, label: 'United States' },        { x: 6, y: 30, size: 64, label: 'India' },        { x: 12, y: 16, size: 90, label: 'France' }      ]    }]}  /></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">Markets</h3>      <p class="card-description">Growth against share; a bubble is as large as its revenue</p>    </div>    <Chart      id="markets"      type="scatter"      label="Markets: growth in percent against share in percent, sized by revenue in millions"      :series="[{        name: 'Markets',        points: [          { x: 4, y: 12, size: 40, label: 'Japan' },          { x: 9, y: 20, size: 120, label: 'Germany' },          { x: 14, y: 8, size: 20, label: 'Brazil' },          { x: 18, y: 26, size: 260, label: 'United States' },          { x: 6, y: 30, size: 64, label: 'India' },          { x: 12, y: 16, size: 90, label: 'France' }        ]      }]"    />  </div></template>

면적은 위치보다 정확히 비교하기 어렵습니다. 가장 중요한 측정값은 축에 배치하고, 크고 작음만 구분하면 되는 측정값은 버블 크기로 표시합니다.

#옵션

옵션기본값
label없음차트가 표시하는 내용과 단위를 설명하는 플롯 영역의 접근성 이름
series[]각 계열에 name을 지정하고, 차트 형태에 따라 values, 조각이나 링의 value, 산점도의 points 중 해당하는 항목을 사용합니다. category와 type, 링의 max는 선택 사항입니다.
min, max, ticks자동 맞춤, 4축의 양 끝값과 대략적인 눈금 수를 지정합니다. 산점도의 가로축에는 xMin, xMax, xTicks를 사용합니다.
format, tickFormat로캘 기준값과 눈금의 표시 형식을 지정합니다. 산점도의 가로축에는 xFormat을 사용합니다.
legend, toggle계열이 두 개일 때, true범례를 표시할지, 범례 항목을 체크박스로 표시할지 지정합니다.

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