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 >