本文へ移動
セクション
Fiesta

chart-bar

表示 画面を組み立てる小さな語彙です。状態、人物、進捗、データテーブルとグラフ、そしてただひとつのお知らせの形。

棒グラフは、名前の付いた区分を棒で表します。0以上の値からなる系列がひとつです。これは表なので、スクリーンリーダーには名前と数値が届き、棒は飾りです。

どの例も実際に動きますが、リンクはどこにも移動しません。 HTML にはコピーできるマークアップがあります。

経路別のチケット

プレビュー
<div rst-box-head>
  <h2 id="sources-h">経路別のチケット</h2>
</div>
<div rst-card>
  <figure rst-chart aria-labelledby="sources-h" aria-describedby="sources-d">
    <p rst-chart-desc id="sources-d">チケットの大半はオンラインで売れ、ニュースレター経由はまだありません。</p>
    <div rst-table-scroll tabindex="0" role="region" aria-labelledby="sources-h">
      <table rst-table="bars" aria-labelledby="sources-h" aria-describedby="sources-d">
        <thead>
          <tr>
            <th scope="col">経路</th>
            <th scope="col">
              <span class="rst-sr-only">棒</span>
            </th>
            <th scope="col" rst-num>チケット</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th scope="row">オンライン</th>
            <td rst-table-bar>
              <svg viewBox="0 0 1000 1" preserveAspectRatio="none" aria-hidden="true" focusable="false"><rect width="1000" height="1"/></svg>
            </td>
            <td rst-num>412</td>
          </tr>
          <tr>
            <th scope="row">窓口</th>
            <td rst-table-bar>
              <svg viewBox="0 0 1000 1" preserveAspectRatio="none" aria-hidden="true" focusable="false"><rect width="572.8" height="1"/></svg>
            </td>
            <td rst-num>236</td>
          </tr>
          <tr>
            <th scope="row">パートナー</th>
            <td rst-table-bar>
              <svg viewBox="0 0 1000 1" preserveAspectRatio="none" aria-hidden="true" focusable="false"><rect width="237.9" height="1"/></svg>
            </td>
            <td rst-num>98</td>
          </tr>
          <tr>
            <th scope="row">ニュースレター</th>
            <td rst-table-bar>
              <svg viewBox="0 0 1000 1" preserveAspectRatio="none" aria-hidden="true" focusable="false"><rect width="0" height="1"/></svg>
            </td>
            <td rst-num>0</td>
          </tr>
        </tbody>
      </table>
    </div>
  </figure>
</div>

データなし

描くものがないグラフは、一文でそう伝えます。

プレビュー
<div rst-box-head>
  <h2 id="sources-h">経路別のチケット</h2>
</div>
<div rst-card>
  <figure rst-chart aria-labelledby="sources-h">
    <p rst-chart-empty>まだチケットは売れていません。</p>
  </figure>
</div>