跳到內容
欄目
Fiesta

chart-bar

展示 砌成一個畫面嘅嗰啲細塊講法:狀態、身分、進度、資料表格同圖表,同唯一嗰種提示形狀。

條形圖用條形顯示有名嘅類別:一個系列,數值係零或者以上。佢係一個表格,所以螢幕閱讀器讀到嘅係名稱同數字;啲條形只係裝飾。

每個例子都真係用得,不過入面啲連結唔會帶你去邊度。 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>