ContinuousColorLegendAPI
React ContinuousColorLegend 元件的 API 參考文件。了解此匯出模組的屬性、CSS 和其他 API。
範例
導入
import { ContinuousColorLegend } from '@mui/x-charts/ChartsLegend';
// or
import { ContinuousColorLegend } from '@mui/x-charts';
// or
import { ContinuousColorLegend } from '@mui/x-charts-pro';
閱讀這份關於最小化 bundle 大小的指南,以了解差異。reading this guide on minimizing bundle size。
名稱 | 類型 | 預設 | 描述 |
---|---|---|---|
align | 'end' | 'middle' | 'start' | 'middle' | 文字與漸層條的對齊方式。 |
axisDirection | 'x' | 'y' | 'z' | 'z' | 包含要表示的顏色配置的軸向。 |
axisId | number | string | 第一個軸項目。 | 具有要表示的顏色配置的軸項目的 ID。 |
direction | 'column' | 'row' | - | 圖例版面配置的方向。預設值取決於圖表。 |
id | string | 自動產生的 ID | 漸層的唯一識別符。 |
labelStyle | object | theme.typography.subtitle1 | 應用於標籤的樣式。 |
length | number | string | '50%' | 漸層條的長度。可以是數字(以 px 為單位)或帶有百分比的字串,例如 '50%'。'100%' 是 svg 的長度。 |
maxLabel | func | string | ({ formattedValue }) => formattedValue | 要在漸層最大側顯示的標籤。可以是字串或函式。如果未定義,則顯示格式化的最大值。 |
minLabel | func | string | ({ formattedValue }) => formattedValue | 要在漸層最小側顯示的標籤。可以是字串或函式。 |
position | { horizontal: 'left' | 'middle' | 'right', vertical: 'bottom' | 'middle' | 'top' } | - | 圖例的位置。 |
scaleType | 'linear' | 'log' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' | 用於顯示漸層顏色的縮放。 |
spacing | number | 4 | 漸層條和標籤之間的間距。 |
thickness | number | 5 | 漸層條的粗細。 |
元件無法持有 ref。
原始碼
如果您在此頁面中找不到資訊,請考慮查看元件的實作以獲取更多詳細資訊。