BarPlotAPI
React BarPlot 组件的 API 参考文档。了解此导出模块的 props、CSS 和其他 API。
演示
导入
import { BarPlot } from '@mui/x-charts/BarChart';
// or
import { BarPlot } from '@mui/x-charts';
// or
import { BarPlot } from '@mui/x-charts-pro';
阅读此关于最小化 bundle 大小的指南,了解两者之间的区别。
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
barLabel | 'value' | func | - | 如果提供,该函数将用于格式化柱状图的标签。可以设置为 'value' 来显示当前值。 |
borderRadius | 数字 | - | 定义柱状图元素的边框半径。 |
onItemClick | 函数 | - | 当柱状图项被点击时触发的回调。 签名: function(event: React.MouseEvent
|
skipAnimation | 布尔值 | 未定义 | 如果为 |
slotProps | 对象 | {} | 用于每个组件插槽的 props。 |
slots | 对象 | {} | 可覆盖的组件插槽。 有关更多详细信息,请参阅下面的 Slots API。 |
组件不能持有 ref。
插槽名称 | 类名 | 默认组件 | 描述 |
---|---|---|---|
bar | BarElementPath | 渲染柱状图的组件。 | |
barLabel | BarLabel | 渲染柱状图标签的组件。 |
源代码
如果您在此页面中找不到所需信息,请考虑查看组件的实现以获取更多详细信息。