BarPlotAPI
React BarPlot 組件的 API 參考文件。了解此匯出模組的屬性、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 size 的指南,以了解差異。
名稱 | 類型 | 預設值 | 描述 |
---|---|---|---|
barLabel | 'value' | 函式 | - | 如果提供,此函式將用於格式化長條圖的標籤。可以設定為 'value' 以顯示目前的值。 |
borderRadius | 數字 | - | 定義長條元素的邊框半徑。 |
onItemClick | 函式 | - | 當長條項目被點擊時觸發的回呼函數。 簽名: function(event: React.MouseEvent
|
skipAnimation | 布林值 | 未定義 | 如果為 |
slotProps | 物件 | {} | 用於每個組件插槽的屬性。 |
slots | 物件 | {} | 可覆寫的組件插槽。 請參閱下方的 Slots API 以了解更多詳細資訊。 |
此組件無法持有 ref。
插槽名稱 | 類別名稱 | 預設組件 | 描述 |
---|---|---|---|
bar | BarElementPath | 渲染長條的組件。 | |
barLabel | BarLabel | 渲染長條標籤的組件。 |
原始碼
如果您在此頁面中找不到資訊,請考慮查看組件的實作程式碼以取得更多詳細資訊。