散点图卡

相关视图 - 每条记录一个点,由两个度量放置,当数据携带一个时,大小增加三分之一。点按系列分组,因此每个组都保持自己的颜色;将标题悬停在该记录上会将标题交换为该记录并使其他系列变暗,并且轴标题位于图下方。

Revenue per account

742

+6.8%
收入会议
Starter · 平均
270
Growth · 平均
783
Scale · 平均
1,388

安装

散点图卡是 BoardUI Pro 的一部分。

已支持深色模式,此 组件 会自动使用 BoardUI 的语义设计变量。 设置主题切换.

专业版访问

散点图卡 是专业人士 组件.

您的 BoardUI Pro 许可证可以解锁此功能 组件 及其所有源文件。激活您的许可证一次,然后使用 CLI 将其直接安装到您的项目中。

01

激活您的许可证

使用 Lemon Squeezy 购买电子邮件中的密钥。每台机器只需执行一次此操作。

npx boardui@latest login YOUR_LICENSE_KEY
02

安装 组件

CLI 会复制源代码并为您解决每个 BoardUI 和 npm 依赖项。

npx boardui@latest add scatter-chart-card

这个 组件 包含在 BoardUI Pro 中

立即获取 BoardUI Pro 并立即安装。

使用共享 UI 包或自定义导入别名? 配置您的安装路径 在运行 CLI 之前。复制粘贴示例使用默认导入。

无气泡

当任何点带有一个时,气泡会自动打开 z;通过 bubble={false} 当第三个度量不值得编码时,对于偶数点。

Revenue per account

742

+6.8%
收入会议
入门版270
成长783
规模1,388

数据

series 是 { label, points, color? }[] 每个点都是 { x, y, z?, label? }。重点是 label 是标题在悬停时显示的内容;得出平均值、图例和图块。当您通过时,经期药会出现在下拉列表中 ranges.

// Points are grouped into series - each gets a colour, a legend row and a tile.// Any point carrying `z` turns the card into a bubble chart.<ScatterChartCard title="Revenue per account" series={[ { label: "Starter", points: [ { x: 12, y: 180, z: 40, label: "Acme" }, { x: 18, y: 240, z: 60, label: "Bolt" }, ], }, { label: "Growth", points: growthPoints, color: "var(--color-chart-6)" }, ]} axisLabels={["Sessions", "Revenue"]} // captions under the plot format={(n) => `$${n.toLocaleString()}`} // y measure formatX={(n) => `${n}k`} // x measure bubble={false} // force plain dots even when the data carries z tiles // average y per series below the chart/>