ナビゲーション

v2.1.0
比較

ウォーターフォールグラフ

最初の値から最後の値に至るまでの増減を、段差で示します。

このページの内容

ウォーターフォールグラフは、期首の現金残高が入出金を経て期末の残高になるまでのように、ある値がどのように変化したかを示します。最初の棒はベースラインから始まり、以降の棒は直前の棒の終点から増減します。棒の終点から次の棒へ細い線を引くため、累計値の推移を目で追えます。増加と減少は、ステータス色と値に付く符号で区別します。

ウォーターフォールグラフ

<div class="card max-w(560) mx-auto">  <div class="card-header">    <h3 class="card-title">Cash</h3>    <p class="card-description">Thousands of dollars, January to June</p>  </div>  <figure class="chart" id="cash" style="--chart-height: 13rem"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('cash'), {  type: 'waterfall',  total: 'June',  values: true,  label: 'Cash from January to June, in thousands of dollars',  labels: ['January', 'Sales', 'Refunds', 'Payroll', 'Grants', 'Rent'],  series: [{ name: 'Cash', values: [420, 310, -64, -280, 90, -110] }]})})</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">Cash</h3>    <p className="card-description">Thousands of dollars, January to June</p>  </div>  <Chart    id="cash"    style={{ '--chart-height': '13rem' } as React.CSSProperties}    type="waterfall"    total="June"    values    label="Cash from January to June, in thousands of dollars"    labels={['January', 'Sales', 'Refunds', 'Payroll', 'Grants', 'Rent']}    series={[{ name: 'Cash', values: [420, 310, -64, -280, 90, -110] }]}  /></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">Cash</h3>    <p class="card-description">Thousands of dollars, January to June</p>  </div>  <Chart    id="cash"    style="--chart-height: 13rem"    type="waterfall"    total="June"    values    label="Cash from January to June, in thousands of dollars"    labels={['January', 'Sales', 'Refunds', 'Payroll', 'Grants', 'Rent']}    series={[{ name: 'Cash', values: [420, 310, -64, -280, 90, -110] }]}  /></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">Cash</h3>      <p class="card-description">Thousands of dollars, January to June</p>    </div>    <Chart      id="cash"      style="--chart-height: 13rem"      type="waterfall"      total="June"      values      label="Cash from January to June, in thousands of dollars"      :labels="['January', 'Sales', 'Refunds', 'Payroll', 'Grants', 'Rent']"      :series="[{ name: 'Cash', values: [420, 310, -64, -280, 90, -110] }]"    />  </div></template>

total は、ベースラインから合計値まで伸びる最後の棒の名前を指定します。省略すると、グラフは最後の増減で終わります。最終値を示さずに変動だけを並べる場合に適しています。values: true を指定すると、各棒の上に増減量が符号付きで表示され、詳細表示には増減後の累計値も表示されます。

#増減とステータス色

ウォーターフォールグラフだけは、データの描画にステータス色を使います。Stat の変化量と同様に、増加には成功色、減少には危険色を使います。詳細表示と各データ点の名前では、すべての値に符号も付けます。コストのように増加が望ましくない指標では、そのことをグラフの label とタイトルに明記します。

#オプション

オプション既定
labelなしグラフの内容と単位を示す、プロット領域のアクセシブルな名前
labels[]軸に沿って、レーダーチャートの周囲に、またはヒートマップの各列の上に表示する名前
series[]各系列に name と、形式に応じて values、value、points、ranges、children のいずれかを指定。category、type、low と high、リングの max は任意
totalなしウォーターフォールグラフの最後に表示する合計の棒の名前
min, max, ticks自動調整, 4スケールの両端と目盛りの数の目安。散布図の横軸には xMin、xMax、xTicks を使用
format, tickFormatロケールに従う値と目盛りの表示形式。散布図の横軸には xFormat を使用
dots, valuesfalse折れ線の各データ点に印を付けるか、各棒の値を表示するか
currentなしaria-current で示すデータ点のインデックス

詳細表示、キーボード操作、凡例、色、スケールはすべてのグラフ形式で共通です。チャート では、これらの機能とすべてのオプション、CSS クラス、カスタムプロパティを説明しています。