Léim chuig an ábhar
Rannóga
Comhpháirteanna Rastrillo

Táblaí agus cairteacha

Tábla figiúirí agus trí chairt: cairt bharraí, cairt líne agus spréachlíne. Tarraingíonn an freastalaí iad gan JavaScript.

Tá gach sampla beo, ach ní théann a naisc áit ar bith. Taispeánann HTML an marcáil le cóipeáil.

data-table

Tábla figiúirí i gcárta. Ar scáileán cúng, scrollaigh an cárta ó thaobh go taobh chun gach colún a fheiceáil. Fanann ceanntásca na rónna le feiceáil.

Sórtáilte de réir uimhreach

Réamhamharc
<div rst-box-head>
  <h2 id="sales-h">Díolacháin de réir seachtaine</h2>
</div>
<div rst-card rst-table-scroll="" tabindex="0" role="region" aria-labelledby="sales-h">
  <table rst-table="" aria-labelledby="sales-h">
    <thead>
      <tr>
        <th scope="col">Seachtain</th>
        <th scope="col" rst-num aria-sort="descending">
          <a href="/sales?sort=sold&amp;dir=asc">Díolta<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></a>
        </th>
        <th scope="col" rst-num>
          <a href="/sales?sort=target&amp;dir=desc">Sprioc<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></a>
        </th>
        <th scope="col" rst-num>Aisíocaíochtaí</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">3</th>
        <td rst-num>260</td>
        <td rst-num>600</td>
        <td rst-num>5</td>
      </tr>
      <tr>
        <th scope="row">4</th>
        <td rst-num>240</td>
        <td rst-num>600</td>
        <td rst-num>1</td>
      </tr>
      <tr>
        <th scope="row">2</th>
        <td rst-num>180</td>
        <td rst-num>600</td>
        <td rst-num>0</td>
      </tr>
      <tr>
        <th scope="row">1</th>
        <td rst-num>120</td>
        <td rst-num>600</td>
        <td rst-num>2</td>
      </tr>
    </tbody>
    <tfoot>
      <tr>
        <th scope="row">Iomlán</th>
        <td rst-num>800</td>
        <td rst-num>2,400</td>
        <td rst-num>8</td>
      </tr>
    </tfoot>
  </table>
</div>
{{template "data-table" dict
    "Columns" (list
        (dict "Label" "Seachtain")
        (dict "Href" "/sales?sort=sold&dir=asc" "Label" "Díolta" "Num" true "Sort" "descending")
        (dict "Href" "/sales?sort=target&dir=desc" "Label" "Sprioc" "Num" true)
        (dict "Label" "Aisíocaíochtaí" "Num" true))
    "Foot" (list "Iomlán" 800 2400 8)
    "ID" "sales"
    "Rows" (list (list 3 260 600 5) (list 4 240 600 1) (list 2 180 600 0) (list 1 120 600 2))
    "Title" "Díolacháin de réir seachtaine"}}

Nasc ceannteideal colúin leis an liosta sórtáilte, ansin socraigh Sort ar an gcolún sin. Marcáil colúin uimhreacha le Num.

Dlúth, le ceanntásc socraithe

Réamhamharc
<div rst-box-head>
  <h2 id="sales-dense-h">Díolacháin de réir seachtaine</h2>
</div>
<div rst-card rst-table-scroll="bounded" tabindex="0" role="region" aria-labelledby="sales-dense-h">
  <table rst-table="dense" aria-labelledby="sales-dense-h">
    <thead>
      <tr>
        <th scope="col">Seachtain</th>
        <th scope="col" rst-num>Díolta</th>
        <th scope="col" rst-num>Sprioc</th>
        <th scope="col" rst-num>Aisíocaíochtaí</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">1</th>
        <td rst-num>120</td>
        <td rst-num>600</td>
        <td rst-num>2</td>
      </tr>
      <tr>
        <th scope="row">2</th>
        <td rst-num>180</td>
        <td rst-num>600</td>
        <td rst-num>0</td>
      </tr>
      <tr>
        <th scope="row">3</th>
        <td rst-num>260</td>
        <td rst-num>600</td>
        <td rst-num>5</td>
      </tr>
      <tr>
        <th scope="row">4</th>
        <td rst-num>240</td>
        <td rst-num>600</td>
        <td rst-num>1</td>
      </tr>
      <tr>
        <th scope="row">5</th>
        <td rst-num>390</td>
        <td rst-num>600</td>
        <td rst-num>3</td>
      </tr>
      <tr>
        <th scope="row">6</th>
        <td rst-num>610</td>
        <td rst-num>600</td>
        <td rst-num>4</td>
      </tr>
      <tr>
        <th scope="row">7</th>
        <td rst-num>650</td>
        <td rst-num>600</td>
        <td rst-num>0</td>
      </tr>
      <tr>
        <th scope="row">8</th>
        <td rst-num>690</td>
        <td rst-num>600</td>
        <td rst-num>2</td>
      </tr>
    </tbody>
  </table>
</div>
{{template "data-table" dict
    "Bounded" true
    "Columns" (list
        (dict "Label" "Seachtain")
        (dict "Label" "Díolta" "Num" true)
        (dict "Label" "Sprioc" "Num" true)
        (dict "Label" "Aisíocaíochtaí" "Num" true))
    "Dense" true
    "ID" "sales-dense"
    "Rows" (list (list 1 120 600 2) (list 2 180 600 0) (list 3 260 600 5) (list 4 240 600 1) (list 5 390 600 3) (list 6 610 600 4) (list 7 650 600 0) (list 8 690 600 2))
    "Title" "Díolacháin de réir seachtaine"}}

Teannann Dense na rónna. Cuireann Bounded teorainn leis an airde agus coinníonn sé an ceanntásc le feiceáil agus na rónna ag scrollú.

Níl aon ró ag teacht leis

Réamhamharc
<div rst-box-head>
  <h2 id="sales-none-h">Díolacháin de réir seachtaine</h2>
</div>
<div rst-card rst-table-scroll="" tabindex="0" role="region" aria-labelledby="sales-none-h">
  <table rst-table="" aria-labelledby="sales-none-h">
    <thead>
      <tr>
        <th scope="col">Seachtain</th>
        <th scope="col" rst-num>Díolta</th>
        <th scope="col" rst-num>Sprioc</th>
        <th scope="col" rst-num>Aisíocaíochtaí</th>
      </tr>
    </thead>
    <tbody>
      <tr rst-table-empty>
        <td colspan="4">Níl seachtain ar bith ag teacht leis.</td>
      </tr>
    </tbody>
  </table>
</div>
{{template "data-table" dict
    "Columns" (list
        (dict "Label" "Seachtain")
        (dict "Label" "Díolta" "Num" true)
        (dict "Label" "Sprioc" "Num" true)
        (dict "Label" "Aisíocaíochtaí" "Num" true))
    "Empty" "Níl seachtain ar bith ag teacht leis."
    "ID" "sales-none"
    "Title" "Díolacháin de réir seachtaine"}}

Gan aon ró, fanann an ceanntásc agus insíonn Empty cén fáth.

chart-bar

Cairt bharraí arna tarraingt mar thábla: ainm, barra agus luach i ngach ró. Caithfidh na luachanna a bheith nialas nó níos mó.

Ceithre fhoinse ar scála amháin

Réamhamharc
<div rst-box-head>
  <h2 id="sources-h">Ticéid de réir foinse</h2>
</div>
<div rst-card>
  <figure rst-chart aria-labelledby="sources-h" aria-describedby="sources-d">
    <p rst-chart-desc id="sources-d">Díoladh an chuid is mó de na ticéid ar líne, agus níor díoladh aon cheann tríd an nuachtlitir fós.</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">Foinse</th>
            <th scope="col">
              <span class="rst-sr-only">Barra</span>
            </th>
            <th scope="col" rst-num>Ticéid</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th scope="row">Ar líne</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">Oifig ticéad</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">Comhpháirtithe</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">Nuachtlitir</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>
{{template "chart-bar" dict
    "Category" "Foinse"
    "Desc" "Díoladh an chuid is mó de na ticéid ar líne, agus níor díoladh aon cheann tríd an nuachtlitir fós."
    "ID" "sources"
    "Measure" "Ticéid"
    "Points" (list
        (dict "Label" "Ar líne" "Value" 412)
        (dict "Label" "Oifig ticéad" "Value" 236)
        (dict "Label" "Comhpháirtithe" "Value" 98)
        (dict "Label" "Nuachtlitir" "Value" 0))
    "Title" "Ticéid de réir foinse"}}

Roinneann gach barra scála amháin. Chun dhá chairt a chur i gcomparáid, tabhair an Max céanna don dá cheann.

Níor díoladh faic fós

Réamhamharc
<div rst-box-head>
  <h2 id="sources-none-h">Ticéid de réir foinse</h2>
</div>
<div rst-card>
  <figure rst-chart aria-labelledby="sources-none-h">
    <p rst-chart-empty>Níor díoladh aon ticéad fós.</p>
  </figure>
</div>
{{template "chart-bar" dict
    "Category" "Foinse"
    "Empty" "Níor díoladh aon ticéad fós."
    "ID" "sources-none"
    "Measure" "Ticéid"
    "Title" "Ticéid de réir foinse"}}

Gan aon phointe, tógann Empty áit na cairte.

chart-line

Sraith amháin mar líne thar phointí atá spásáilte go cothrom, le gach luach i dtábla faoina bun.

Díolacháin sheachtainiúla i gcomparáid le sprioc

Réamhamharc
<div rst-box-head>
  <h2 id="weekly-h">Díolacháin sheachtainiúla</h2>
</div>
<div rst-card>
  <figure rst-chart aria-labelledby="weekly-h" aria-describedby="weekly-d">
    <p rst-chart-desc id="weekly-d">D&#39;ardaigh na díolacháin beagnach gach seachtain agus sháraigh siad an sprioc de 600 i seachtain 6.</p>
    <div rst-chart-plot aria-hidden="true">
      <div rst-chart-y>
        <span>800</span><span>600</span><span>400</span><span>200</span><span>0</span>
      </div>
      <svg viewBox="0 0 1000 1000" preserveAspectRatio="none" focusable="false"><path rst-chart-grid d="M0 0H1000M0 250H1000M0 500H1000M0 750H1000"/><path rst-chart-base d="M0 1000H1000"/><path rst-chart-goal d="M0 250H1000"/><polyline rst-chart-line points="0,850 142.9,775 285.7,675 428.6,700 571.4,512.5 714.3,237.5 857.1,187.5 1000,137.5"/><path rst-chart-ring d="M1000 137.5h0"/><path rst-chart-dot d="M1000 137.5h0"/></svg>
      <div rst-chart-hits>
        <span title="1: 120"></span><span title="2: 180"></span><span title="3: 260"></span><span title="4: 240"></span><span title="5: 390"></span><span title="6: 610"></span><span title="7: 650"></span><span title="8: 690"></span>
      </div>
      <div rst-chart-x>
        <span rst-chart-keep>1</span><span>2</span><span rst-chart-keep>3</span><span>4</span><span rst-chart-keep>5</span><span>6</span><span>7</span><span rst-chart-keep>8</span>
      </div>
    </div>
    <p rst-chart-key>Sprioc: 600</p>
    <details rst-chart-data>
      <summary>Taispeáin na huimhreacha</summary>
      <div rst-table-scroll tabindex="0" role="region" aria-labelledby="weekly-h">
        <table rst-table="dense" aria-labelledby="weekly-h">
          <thead>
            <tr>
              <th scope="col">Seachtain</th>
              <th scope="col" rst-num>Díolta</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th scope="row">1</th>
              <td rst-num>120</td>
            </tr>
            <tr>
              <th scope="row">2</th>
              <td rst-num>180</td>
            </tr>
            <tr>
              <th scope="row">3</th>
              <td rst-num>260</td>
            </tr>
            <tr>
              <th scope="row">4</th>
              <td rst-num>240</td>
            </tr>
            <tr>
              <th scope="row">5</th>
              <td rst-num>390</td>
            </tr>
            <tr>
              <th scope="row">6</th>
              <td rst-num>610</td>
            </tr>
            <tr>
              <th scope="row">7</th>
              <td rst-num>650</td>
            </tr>
            <tr>
              <th scope="row">8</th>
              <td rst-num>690</td>
            </tr>
          </tbody>
          <tfoot>
            <tr>
              <th scope="row">Sprioc</th>
              <td rst-num>600</td>
            </tr>
          </tfoot>
        </table>
      </div>
    </details>
  </figure>
</div>
{{template "chart-line" dict
    "Category" "Seachtain"
    "Desc" "D'ardaigh na díolacháin beagnach gach seachtain agus sháraigh siad an sprioc de 600 i seachtain 6."
    "Goal" 600
    "GoalLabel" "Sprioc"
    "Hover" true
    "ID" "weekly"
    "Measure" "Díolta"
    "Points" (list
        (dict "Label" 1 "Value" 120)
        (dict "Label" 2 "Value" 180)
        (dict "Label" 3 "Value" 260)
        (dict "Label" 4 "Value" 240)
        (dict "Label" 5 "Value" 390)
        (dict "Label" 6 "Value" 610)
        (dict "Label" 7 "Value" 650)
        (dict "Label" 8 "Value" 690))
    "Title" "Díolacháin sheachtainiúla"}}

Scríobh Desc thú féin. Abair cad a dhéanann an líne, ní hamháin cá gcríochnaíonn sí. Socraigh Hover chun leid uirlise a chur le gach pointe.

Seachtain gan sonraí

Réamhamharc
<div rst-box-head>
  <h2 id="weekly-gap-h">Díolacháin sheachtainiúla</h2>
</div>
<div rst-card>
  <figure rst-chart aria-labelledby="weekly-gap-h" aria-describedby="weekly-gap-d">
    <p rst-chart-desc id="weekly-gap-d">Níor taifeadadh aon díolacháin i seachtain 5; briseann an líne ansin.</p>
    <div rst-chart-plot aria-hidden="true">
      <div rst-chart-y>
        <span>800</span><span>600</span><span>400</span><span>200</span><span>0</span>
      </div>
      <svg viewBox="0 0 1000 1000" preserveAspectRatio="none" focusable="false"><path rst-chart-grid d="M0 0H1000M0 250H1000M0 500H1000M0 750H1000"/><path rst-chart-base d="M0 1000H1000"/><path rst-chart-goal d="M0 250H1000"/><polyline rst-chart-line points="0,850 142.9,775 285.7,675 428.6,700"/><polyline rst-chart-line points="714.3,237.5 857.1,187.5 1000,137.5"/><path rst-chart-ring d="M1000 137.5h0"/><path rst-chart-dot d="M1000 137.5h0"/></svg>
      <div rst-chart-x>
        <span rst-chart-keep>1</span><span>2</span><span rst-chart-keep>3</span><span>4</span><span rst-chart-keep>5</span><span>6</span><span>7</span><span rst-chart-keep>8</span>
      </div>
    </div>
    <p rst-chart-key>Sprioc: 600</p>
    <details rst-chart-data>
      <summary>Taispeáin na huimhreacha</summary>
      <div rst-table-scroll tabindex="0" role="region" aria-labelledby="weekly-gap-h">
        <table rst-table="dense" aria-labelledby="weekly-gap-h">
          <thead>
            <tr>
              <th scope="col">Seachtain</th>
              <th scope="col" rst-num>Díolta</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th scope="row">1</th>
              <td rst-num>120</td>
            </tr>
            <tr>
              <th scope="row">2</th>
              <td rst-num>180</td>
            </tr>
            <tr>
              <th scope="row">3</th>
              <td rst-num>260</td>
            </tr>
            <tr>
              <th scope="row">4</th>
              <td rst-num>240</td>
            </tr>
            <tr>
              <th scope="row">5</th>
              <td rst-num>Gan sonraí</td>
            </tr>
            <tr>
              <th scope="row">6</th>
              <td rst-num>610</td>
            </tr>
            <tr>
              <th scope="row">7</th>
              <td rst-num>650</td>
            </tr>
            <tr>
              <th scope="row">8</th>
              <td rst-num>690</td>
            </tr>
          </tbody>
          <tfoot>
            <tr>
              <th scope="row">Sprioc</th>
              <td rst-num>600</td>
            </tr>
          </tfoot>
        </table>
      </div>
    </details>
  </figure>
</div>
{{template "chart-line" dict
    "Category" "Seachtain"
    "Desc" "Níor taifeadadh aon díolacháin i seachtain 5; briseann an líne ansin."
    "Goal" 600
    "GoalLabel" "Sprioc"
    "Hover" false
    "ID" "weekly-gap"
    "Measure" "Díolta"
    "Points" (list
        (dict "Label" 1 "Value" 120)
        (dict "Label" 2 "Value" 180)
        (dict "Label" 3 "Value" 260)
        (dict "Label" 4 "Value" 240)
        (dict "Label" 5 "Missing" true "Value" 390)
        (dict "Label" 6 "Value" 610)
        (dict "Label" 7 "Value" 650)
        (dict "Label" 8 "Value" 690))
    "Title" "Díolacháin sheachtainiúla"}}

Briseann luach atá in easnamh an líne, agus léann sé Gan sonraí sa tábla. Ní tharraingítear riamh é mar 0.

sparkline

Líne bheag in aice lena fotheideal, le treocht a thaispeáint in aice le huimhir.

Ag ardú, le titim

Réamhamharc
<figure rst-spark>
  <svg viewBox="0 0 100 24" preserveAspectRatio="none" aria-hidden="true" focusable="false"><polyline rst-chart-line points="0,24 14.3,21.5 28.6,18.1 42.9,18.9 57.1,12.6 71.4,3.4 85.7,1.7 100,0"/><path rst-chart-ring d="M100 0h0"/><path rst-chart-dot d="M100 0h0"/></svg>
  <figcaption>
    <strong>Na 8 seachtaine is déanaí</strong> D&#39;ardaigh na díolacháin ó 120 go 690, le titim i seachtain 4.</figcaption>
</figure>
{{template "sparkline" dict
    "Desc" "D'ardaigh na díolacháin ó 120 go 690, le titim i seachtain 4."
    "Period" "Na 8 seachtaine is déanaí"
    "Points" (list
        (dict "Label" 1 "Value" 120)
        (dict "Label" 2 "Value" 180)
        (dict "Label" 3 "Value" 260)
        (dict "Label" 4 "Value" 240)
        (dict "Label" 5 "Value" 390)
        (dict "Label" 6 "Value" 610)
        (dict "Label" 7 "Value" 650)
        (dict "Label" 8 "Value" 690))}}

Níl ag léitheoir scáileáin ach an fotheideal. Tabhair an tréimhse, agus déan cur síos ar aon titim nó aon bhuaic.