← 全部模板

区间估计 <RangeBars />

每行一个点估计和它的误差区间,区间越窄越可靠;可以高亮推荐的一行,左栏可放一个“这样写结果”的示例块。

分组
方法 · 数字有多可靠
组件
RangeBars · #range-bars
交互
区间从中心向两侧展开。

适合

  • 讲抽样误差、置信区间、预测范围
  • 说明“样本量要多大才够”

不适合

  • 数据没有误差范围:用 MetricBars
  • 区间来自你自己的估算却没有标明:在 source 里写清计算方法

内容上限

1rows 3–6 行:label ≤ 8 个字符,note ≤ 8 个字符
2axis.ticks 3–5 个;focusLabel ≤ 8 字
3example.text ≤ 48 个字符(等宽两行)

字段

字段类型
kicker · 必填string标题上方的小节名,2–8 字
title · 必填string | string[]页面标题;传数组可手动断行,每项一行
leadstring一到两句导语,≤ 60 字
sourcestring事实出处;页面上有任何数据或事实时必填
hintReactNode页眉中间的操作提示,可用 <kbd>
rows · 必填{ label, value, low, high, note? }[]点估计与区间
axis · 必填{ from, to, ticks }坐标范围与刻度
unitstring刻度单位
focusnumber高亮行的下标
focusLabelstring高亮行的标签
example{ label, text }左栏示例块

示例代码

<RangeBars
  kicker="抽样"
  title={['只问几次,', '测到的多是噪声']}
  rows={[
    { label: 'N = 5', value: 50, low: 28, high: 72, note: '±22' },
    { label: 'N = 30', value: 50, low: 41, high: 59, note: '±9' },
    { label: 'N = 100', value: 50, low: 45, high: 55, note: '±5' },
  ]}
  axis={{ from: 0, to: 100, ticks: [0, 25, 50, 75, 100] }}
  unit="%"
  focus={1}
  focusLabel="最低要求"
  source="标准误按 √(p(1−p)/N) 计算"
/>