diff --git a/docs/next.config.ts b/docs/next.config.ts index 7a5ccb7bd699a..3c950e03d2c17 100644 --- a/docs/next.config.ts +++ b/docs/next.config.ts @@ -5,6 +5,7 @@ import * as semver from 'semver'; import { createRequire } from 'module'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import { withDeploymentConfig } from '@mui/internal-docs-infra/withDocsInfra'; +import type { LoaderOptions as PrecomputedTypesLoaderOptions } from '@mui/internal-docs-infra/pipeline/loadPrecomputedTypes'; import { findPages } from './src/modules/utils/find'; import { LANGUAGES, LANGUAGES_SSR, LANGUAGES_IGNORE_PAGES, LANGUAGES_IN_PROGRESS } from './config'; import { SOURCE_CODE_REPO, SOURCE_GITHUB_BRANCH } from './constants'; @@ -78,6 +79,7 @@ export default withDeploymentConfig({ // TODO, those shouldn't be needed in the first place '@mui/monorepo', // Migrate everything to @mui/internal-core-docs until the @mui/monorepo dependency becomes obsolete '@mui/internal-core-docs', // needed to fix slashes in the generated links (https://github.com/mui/mui-x/pull/13713#issuecomment-2205591461, ) + '@mui/internal-docs-infra', // TEMP: local link points at ../mui-public/packages/docs-infra source tree ], // Avoid conflicts with the other Next.js apps hosted under https://mui.com/ assetPrefix: process.env.DEPLOY_ENV === 'development' ? undefined : '/x', @@ -132,6 +134,11 @@ export default withDeploymentConfig({ ), docs: path.resolve(MONOREPO_PATH, './docs'), docsx: path.resolve(currentDirectory, '../docs'), + // TEMP: force React dedupe so linked @mui/internal-docs-infra doesn't + // load its own React copy (breaks hooks with "Cannot read properties + // of null (reading 'useMemo')"). + react: path.resolve(currentDirectory, 'node_modules/react'), + 'react-dom': path.resolve(currentDirectory, 'node_modules/react-dom'), }, }, module: { @@ -166,6 +173,20 @@ export default withDeploymentConfig({ include: [/(@mui[\\/]monorepo)$/, /(@mui[\\/]monorepo)[\\/](?!.*node_modules)/], use: options.defaultLoaders.babel, }, + // New types pipeline (POC) — intercept `types.*.ts` next to API pages and + // precompute props metadata at build time via the docs-infra loader. + { + test: /[/\\]docs[/\\]pages[/\\]x[/\\]api[/\\].+[/\\]types\..*\.ts$/, + use: [ + options.defaultLoaders.babel, + { + loader: '@mui/internal-docs-infra/pipeline/loadPrecomputedTypes', + options: { + socketDir: '.next/docs-infra', + } satisfies PrecomputedTypesLoaderOptions, + }, + ], + }, { test: /\.(ts|tsx)$/, loader: 'string-replace-loader', diff --git a/docs/package.json b/docs/package.json index 6cb487b7c2e29..63ee0e1e56ec3 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,6 +9,7 @@ "dev": "cross-env-shell 'next dev --webpack --port ${PORT:-3001}'", "deploy": "git fetch upstream master && git push -f upstream FETCH_HEAD:docs-v9", "icons": "rimraf public/static/icons/* && node ./scripts/buildIcons.js", + "internal-validate": "docs-infra validate", "serve": "serve ./export -l 3010", "create-playground": "node ./scripts/createPlayground.js", "typescript": "tsc -p tsconfig.json", diff --git a/docs/pages/x/api/charts/animated-area.js b/docs/pages/x/api/charts/animated-area.js index 630180fbcf0dd..c01b6cf24fb02 100644 --- a/docs/pages/x/api/charts/animated-area.js +++ b/docs/pages/x/api/charts/animated-area.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './animated-area.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesAnimatedArea } from './types.animated-area'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['skipAnimation']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/animated-area', - false, - /\.\/animated-area.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/animated-line.js b/docs/pages/x/api/charts/animated-line.js index bab3d4034566e..1b4eef3d57aa2 100644 --- a/docs/pages/x/api/charts/animated-line.js +++ b/docs/pages/x/api/charts/animated-line.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './animated-line.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesAnimatedLine } from './types.animated-line'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['skipAnimation']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/animated-line', - false, - /\.\/animated-line.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/area-element.js b/docs/pages/x/api/charts/area-element.js index 98c0a96736901..05ffc6314e35f 100644 --- a/docs/pages/x/api/charts/area-element.js +++ b/docs/pages/x/api/charts/area-element.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './area-element.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesAreaElement } from './types.area-element'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/area-element', - false, - /\.\/area-element.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/area-plot.js b/docs/pages/x/api/charts/area-plot.js index da51c70f88bd0..4b2d3f0ab6158 100644 --- a/docs/pages/x/api/charts/area-plot.js +++ b/docs/pages/x/api/charts/area-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './area-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesAreaPlot } from './types.area-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['onItemClick', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/area-plot', - false, - /\.\/area-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/axis-config.js b/docs/pages/x/api/charts/axis-config.js index e23b725c73e87..fe1b90232d10b 100644 --- a/docs/pages/x/api/charts/axis-config.js +++ b/docs/pages/x/api/charts/axis-config.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './axis-config.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesAxisConfig } from './types.axis-config'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/axis-config.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/bar-chart-premium.js b/docs/pages/x/api/charts/bar-chart-premium.js index e2a82bfa5b1c1..2fe11fd890338 100644 --- a/docs/pages/x/api/charts/bar-chart-premium.js +++ b/docs/pages/x/api/charts/bar-chart-premium.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './bar-chart-premium.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesBarChartPremium } from './types.bar-chart-premium'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'initialZoom', 'layout', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/bar-chart-premium', - false, - /\.\/bar-chart-premium.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/bar-chart-pro.js b/docs/pages/x/api/charts/bar-chart-pro.js index 233b46a4e6a98..e6fc8ecfa3cdb 100644 --- a/docs/pages/x/api/charts/bar-chart-pro.js +++ b/docs/pages/x/api/charts/bar-chart-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './bar-chart-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesBarChartPro } from './types.bar-chart-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'initialZoom', 'layout', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/bar-chart-pro', - false, - /\.\/bar-chart-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/bar-chart.js b/docs/pages/x/api/charts/bar-chart.js index 96b2679b10cc5..0e25ee1588174 100644 --- a/docs/pages/x/api/charts/bar-chart.js +++ b/docs/pages/x/api/charts/bar-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './bar-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesBarChart } from './types.bar-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'layout', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/bar-chart', - false, - /\.\/bar-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/bar-element.js b/docs/pages/x/api/charts/bar-element.js index 8850e8d79d961..9e1f116dae2c4 100644 --- a/docs/pages/x/api/charts/bar-element.js +++ b/docs/pages/x/api/charts/bar-element.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './bar-element.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesBarElement } from './types.bar-element'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/bar-element', - false, - /\.\/bar-element.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/bar-label.js b/docs/pages/x/api/charts/bar-label.js index 062f1476b9b26..0d73ab30e465b 100644 --- a/docs/pages/x/api/charts/bar-label.js +++ b/docs/pages/x/api/charts/bar-label.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './bar-label.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesBarLabel } from './types.bar-label'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['height', 'hidden', 'placement', 'width', 'x', 'xOrigin', 'y', 'yOrigin']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/bar-label', - false, - /\.\/bar-label.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/bar-plot.js b/docs/pages/x/api/charts/bar-plot.js index 89b6ecb68ef15..a0208db2af5fb 100644 --- a/docs/pages/x/api/charts/bar-plot.js +++ b/docs/pages/x/api/charts/bar-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './bar-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesBarPlot } from './types.bar-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['borderRadius', 'className', 'onItemClick', 'renderer', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/bar-plot', - false, - /\.\/bar-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/bar-series.js b/docs/pages/x/api/charts/bar-series.js index 904280a5f800e..e90f145ac737f 100644 --- a/docs/pages/x/api/charts/bar-series.js +++ b/docs/pages/x/api/charts/bar-series.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './bar-series.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesBarSeries } from './types.bar-series'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/bar-series.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/candlestick-chart.js b/docs/pages/x/api/charts/candlestick-chart.js index 26abc37bbd4e0..4c5d5d97d97d2 100644 --- a/docs/pages/x/api/charts/candlestick-chart.js +++ b/docs/pages/x/api/charts/candlestick-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './candlestick-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesCandlestickChart } from './types.candlestick-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'colors', 'dataset', 'desc', 'disableAxisListener', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'initialZoom', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zoomData', 'zoomInteractionConfig']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/candlestick-chart', - false, - /\.\/candlestick-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/candlestick-plot.js b/docs/pages/x/api/charts/candlestick-plot.js index 08b06c5447965..c18f0c4315844 100644 --- a/docs/pages/x/api/charts/candlestick-plot.js +++ b/docs/pages/x/api/charts/candlestick-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './candlestick-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesCandlestickPlot } from './types.candlestick-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/candlestick-plot', - false, - /\.\/candlestick-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/chart-image-export-options.js b/docs/pages/x/api/charts/chart-image-export-options.js index c2d92749451fc..14ec42ad5bc22 100644 --- a/docs/pages/x/api/charts/chart-image-export-options.js +++ b/docs/pages/x/api/charts/chart-image-export-options.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chart-image-export-options.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartImageExportOptions } from './types.chart-image-export-options'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/chart-image-export-options.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/chart-print-export-options.js b/docs/pages/x/api/charts/chart-print-export-options.js index 5fcbd2fc48570..415fe973526e2 100644 --- a/docs/pages/x/api/charts/chart-print-export-options.js +++ b/docs/pages/x/api/charts/chart-print-export-options.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chart-print-export-options.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartPrintExportOptions } from './types.chart-print-export-options'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/chart-print-export-options.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-axis-highlight.js b/docs/pages/x/api/charts/charts-axis-highlight.js index e5adae243673c..beb00f309e5a7 100644 --- a/docs/pages/x/api/charts/charts-axis-highlight.js +++ b/docs/pages/x/api/charts/charts-axis-highlight.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-axis-highlight.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsAxisHighlight } from './types.charts-axis-highlight'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-axis-highlight', - false, - /\.\/charts-axis-highlight.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-axis-tooltip-content.js b/docs/pages/x/api/charts/charts-axis-tooltip-content.js index 847c27787cb58..72de58bcd9192 100644 --- a/docs/pages/x/api/charts/charts-axis-tooltip-content.js +++ b/docs/pages/x/api/charts/charts-axis-tooltip-content.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-axis-tooltip-content.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsAxisTooltipContent } from './types.charts-axis-tooltip-content'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'sort']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-axis-tooltip-content', - false, - /\.\/charts-axis-tooltip-content.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-axis.js b/docs/pages/x/api/charts/charts-axis.js index b3247a82b3618..156b609cbf488 100644 --- a/docs/pages/x/api/charts/charts-axis.js +++ b/docs/pages/x/api/charts/charts-axis.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-axis.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsAxis } from './types.charts-axis'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-axis', - false, - /\.\/charts-axis.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-brush-overlay.js b/docs/pages/x/api/charts/charts-brush-overlay.js index 07a8ec37e348c..3ef251c4397f2 100644 --- a/docs/pages/x/api/charts/charts-brush-overlay.js +++ b/docs/pages/x/api/charts/charts-brush-overlay.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-brush-overlay.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsBrushOverlay } from './types.charts-brush-overlay'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-brush-overlay', - false, - /\.\/charts-brush-overlay.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-clip-path.js b/docs/pages/x/api/charts/charts-clip-path.js index 566fc52ebcd24..cb6d13615bd82 100644 --- a/docs/pages/x/api/charts/charts-clip-path.js +++ b/docs/pages/x/api/charts/charts-clip-path.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-clip-path.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsClipPath } from './types.charts-clip-path'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['id', 'offset']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-clip-path', - false, - /\.\/charts-clip-path.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-container-premium.js b/docs/pages/x/api/charts/charts-container-premium.js index 655fd9617fd4a..aa912b1416be1 100644 --- a/docs/pages/x/api/charts/charts-container-premium.js +++ b/docs/pages/x/api/charts/charts-container-premium.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-container-premium.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsContainerPremium } from './types.charts-container-premium'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-container-premium', - false, - /\.\/charts-container-premium.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-container-pro.js b/docs/pages/x/api/charts/charts-container-pro.js index d3fd760dc4918..90bd3d7c23407 100644 --- a/docs/pages/x/api/charts/charts-container-pro.js +++ b/docs/pages/x/api/charts/charts-container-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-container-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsContainerPro } from './types.charts-container-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['colors', 'dataset', 'disableAxisListener', 'height', 'highlightedItem', 'id', 'initialZoom', 'margin', 'onHighlightChange', 'onZoomChange', 'series', 'skipAnimation', 'width', 'xAxis', 'yAxis', 'zAxis']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-container-pro', - false, - /\.\/charts-container-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-container.js b/docs/pages/x/api/charts/charts-container.js index 6fd8e673f74e1..8a2419f704ce2 100644 --- a/docs/pages/x/api/charts/charts-container.js +++ b/docs/pages/x/api/charts/charts-container.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-container.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsContainer } from './types.charts-container'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableHitArea', 'disableKeyboardNavigation', 'experimentalFeatures', 'height', 'hiddenItems', 'highlightedAxis', 'highlightedItem', 'hitAreaRadius', 'id', 'initialHiddenItems', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'radiusAxis', 'rotationAxis', 'series', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-container', - false, - /\.\/charts-container.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-data-provider-premium.js b/docs/pages/x/api/charts/charts-data-provider-premium.js index 932bddf7ef978..12c42ded7d038 100644 --- a/docs/pages/x/api/charts/charts-data-provider-premium.js +++ b/docs/pages/x/api/charts/charts-data-provider-premium.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-data-provider-premium.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsDataProviderPremium } from './types.charts-data-provider-premium'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['colors', 'dataset', 'height', 'id', 'localeText', 'margin', 'series', 'skipAnimation', 'slotProps', 'slots', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-data-provider-premium', - false, - /\.\/charts-data-provider-premium.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-data-provider-pro.js b/docs/pages/x/api/charts/charts-data-provider-pro.js index 247b7f4c2d801..2155d418c4016 100644 --- a/docs/pages/x/api/charts/charts-data-provider-pro.js +++ b/docs/pages/x/api/charts/charts-data-provider-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-data-provider-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsDataProviderPro } from './types.charts-data-provider-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['colors', 'dataset', 'height', 'id', 'localeText', 'margin', 'series', 'skipAnimation', 'slotProps', 'slots', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-data-provider-pro', - false, - /\.\/charts-data-provider-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-data-provider.js b/docs/pages/x/api/charts/charts-data-provider.js index c4bf4e50dbb5e..cf23cd92e60e0 100644 --- a/docs/pages/x/api/charts/charts-data-provider.js +++ b/docs/pages/x/api/charts/charts-data-provider.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-data-provider.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsDataProvider } from './types.charts-data-provider'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['colors', 'dataset', 'height', 'id', 'localeText', 'margin', 'series', 'skipAnimation', 'slotProps', 'slots', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-data-provider', - false, - /\.\/charts-data-provider.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-grid.js b/docs/pages/x/api/charts/charts-grid.js index a7ec105b0ce79..a5c39719dd1cb 100644 --- a/docs/pages/x/api/charts/charts-grid.js +++ b/docs/pages/x/api/charts/charts-grid.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-grid.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsGrid } from './types.charts-grid'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'horizontal', 'vertical']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-grid', - false, - /\.\/charts-grid.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-item-tooltip-content.js b/docs/pages/x/api/charts/charts-item-tooltip-content.js index f8143c0e574e2..24a9c41c87817 100644 --- a/docs/pages/x/api/charts/charts-item-tooltip-content.js +++ b/docs/pages/x/api/charts/charts-item-tooltip-content.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-item-tooltip-content.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsItemTooltipContent } from './types.charts-item-tooltip-content'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-item-tooltip-content', - false, - /\.\/charts-item-tooltip-content.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-legend.js b/docs/pages/x/api/charts/charts-legend.js index 6441b2214c7ae..00819030c571b 100644 --- a/docs/pages/x/api/charts/charts-legend.js +++ b/docs/pages/x/api/charts/charts-legend.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-legend.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsLegend } from './types.charts-legend'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'direction', 'onItemClick', 'slotProps', 'slots', 'toggleVisibilityOnClick']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-legend', - false, - /\.\/charts-legend.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-localization-provider.js b/docs/pages/x/api/charts/charts-localization-provider.js index a7697d44da743..07de4f703ddf7 100644 --- a/docs/pages/x/api/charts/charts-localization-provider.js +++ b/docs/pages/x/api/charts/charts-localization-provider.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-localization-provider.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsLocalizationProvider } from './types.charts-localization-provider'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['localeText']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-localization-provider', - false, - /\.\/charts-localization-provider.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-reference-line.js b/docs/pages/x/api/charts/charts-reference-line.js index 604b689fb73cb..6e42e910b5de1 100644 --- a/docs/pages/x/api/charts/charts-reference-line.js +++ b/docs/pages/x/api/charts/charts-reference-line.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-reference-line.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsReferenceLine } from './types.charts-reference-line'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axisId', 'classes', 'label', 'labelAlign', 'labelStyle', 'lineStyle', 'spacing', 'x', 'y']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-reference-line', - false, - /\.\/charts-reference-line.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-surface.js b/docs/pages/x/api/charts/charts-surface.js index a0f15d7d3dbdd..04f9c6d0a2ba6 100644 --- a/docs/pages/x/api/charts/charts-surface.js +++ b/docs/pages/x/api/charts/charts-surface.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-surface.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsSurface } from './types.charts-surface'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['desc', 'title']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-surface', - false, - /\.\/charts-surface.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-text.js b/docs/pages/x/api/charts/charts-text.js index b4fd56b367a5a..a03cd05fe2e23 100644 --- a/docs/pages/x/api/charts/charts-text.js +++ b/docs/pages/x/api/charts/charts-text.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-text.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsText } from './types.charts-text'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['lineHeight', 'needsComputation', 'style', 'text']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-text', - false, - /\.\/charts-text.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-toolbar-image-export-trigger.js b/docs/pages/x/api/charts/charts-toolbar-image-export-trigger.js index 2406a15f6c90c..7eee91f0b0333 100644 --- a/docs/pages/x/api/charts/charts-toolbar-image-export-trigger.js +++ b/docs/pages/x/api/charts/charts-toolbar-image-export-trigger.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-toolbar-image-export-trigger.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsToolbarImageExportTrigger } from './types.charts-toolbar-image-export-trigger'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['options', 'render']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-toolbar-image-export-trigger', - false, - /\.\/charts-toolbar-image-export-trigger.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-toolbar-print-export-trigger.js b/docs/pages/x/api/charts/charts-toolbar-print-export-trigger.js index 6152129bc96af..748c68540f273 100644 --- a/docs/pages/x/api/charts/charts-toolbar-print-export-trigger.js +++ b/docs/pages/x/api/charts/charts-toolbar-print-export-trigger.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-toolbar-print-export-trigger.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsToolbarPrintExportTrigger } from './types.charts-toolbar-print-export-trigger'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['options', 'render']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-toolbar-print-export-trigger', - false, - /\.\/charts-toolbar-print-export-trigger.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-toolbar-pro.js b/docs/pages/x/api/charts/charts-toolbar-pro.js index 03203e17f2da8..c4859f7c425fc 100644 --- a/docs/pages/x/api/charts/charts-toolbar-pro.js +++ b/docs/pages/x/api/charts/charts-toolbar-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-toolbar-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsToolbarPro } from './types.charts-toolbar-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-toolbar-pro', - false, - /\.\/charts-toolbar-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-toolbar-zoom-in-trigger.js b/docs/pages/x/api/charts/charts-toolbar-zoom-in-trigger.js index 9dd668a88ba77..b412330ccf4e6 100644 --- a/docs/pages/x/api/charts/charts-toolbar-zoom-in-trigger.js +++ b/docs/pages/x/api/charts/charts-toolbar-zoom-in-trigger.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-toolbar-zoom-in-trigger.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsToolbarZoomInTrigger } from './types.charts-toolbar-zoom-in-trigger'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['render']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-toolbar-zoom-in-trigger', - false, - /\.\/charts-toolbar-zoom-in-trigger.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-toolbar-zoom-out-trigger.js b/docs/pages/x/api/charts/charts-toolbar-zoom-out-trigger.js index ce3798642090b..cad1ec84e727d 100644 --- a/docs/pages/x/api/charts/charts-toolbar-zoom-out-trigger.js +++ b/docs/pages/x/api/charts/charts-toolbar-zoom-out-trigger.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-toolbar-zoom-out-trigger.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsToolbarZoomOutTrigger } from './types.charts-toolbar-zoom-out-trigger'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['render']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-toolbar-zoom-out-trigger', - false, - /\.\/charts-toolbar-zoom-out-trigger.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-tooltip-container.js b/docs/pages/x/api/charts/charts-tooltip-container.js index a9db2d6cee91a..0e98784fc7c7e 100644 --- a/docs/pages/x/api/charts/charts-tooltip-container.js +++ b/docs/pages/x/api/charts/charts-tooltip-container.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-tooltip-container.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsTooltipContainer } from './types.charts-tooltip-container'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['anchor', 'anchorEl', 'children', 'classes', 'component', 'components', 'componentsProps', 'container', 'disablePortal', 'keepMounted', 'modifiers', 'open', 'placement', 'popperOptions', 'popperRef', 'position', 'slotProps', 'slots', 'sx', 'transition', 'trigger']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-tooltip-container', - false, - /\.\/charts-tooltip-container.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-tooltip.js b/docs/pages/x/api/charts/charts-tooltip.js index 051376e0ac538..8981ac302ed81 100644 --- a/docs/pages/x/api/charts/charts-tooltip.js +++ b/docs/pages/x/api/charts/charts-tooltip.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-tooltip.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsTooltip } from './types.charts-tooltip'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['anchor', 'anchorEl', 'classes', 'component', 'components', 'componentsProps', 'container', 'disablePortal', 'keepMounted', 'modifiers', 'open', 'placement', 'popperOptions', 'popperRef', 'position', 'slotProps', 'slots', 'sort', 'sx', 'transition', 'trigger']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-tooltip', - false, - /\.\/charts-tooltip.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-wrapper.js b/docs/pages/x/api/charts/charts-wrapper.js index 2b1de631ae737..37fc3107b6c73 100644 --- a/docs/pages/x/api/charts/charts-wrapper.js +++ b/docs/pages/x/api/charts/charts-wrapper.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-wrapper.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsWrapper } from './types.charts-wrapper'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['extendVertically', 'hideLegend', 'legendDirection', 'legendPosition']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-wrapper', - false, - /\.\/charts-wrapper.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-x-axis.js b/docs/pages/x/api/charts/charts-x-axis.js index 8475d03a81cf7..c44e0c0b4212f 100644 --- a/docs/pages/x/api/charts/charts-x-axis.js +++ b/docs/pages/x/api/charts/charts-x-axis.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-x-axis.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsXAxis } from './types.charts-x-axis'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axisId', 'classes', 'disableLine', 'disableTicks', 'label', 'labelStyle', 'slotProps', 'slots', 'tickInterval', 'tickLabelInterval', 'tickLabelMinGap', 'tickLabelPlacement', 'tickLabelStyle', 'tickMaxStep', 'tickMinStep', 'tickNumber', 'tickPlacement', 'tickSize']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-x-axis', - false, - /\.\/charts-x-axis.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-y-axis.js b/docs/pages/x/api/charts/charts-y-axis.js index f070dab82d0d6..923789e685d65 100644 --- a/docs/pages/x/api/charts/charts-y-axis.js +++ b/docs/pages/x/api/charts/charts-y-axis.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-y-axis.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsYAxis } from './types.charts-y-axis'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axisId', 'classes', 'disableLine', 'disableTicks', 'label', 'labelStyle', 'slotProps', 'slots', 'tickInterval', 'tickLabelInterval', 'tickLabelPlacement', 'tickLabelStyle', 'tickMaxStep', 'tickMinStep', 'tickNumber', 'tickPlacement', 'tickSize']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-y-axis', - false, - /\.\/charts-y-axis.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/charts-zoom-slider.js b/docs/pages/x/api/charts/charts-zoom-slider.js index c902e6c27be51..11c104188591f 100644 --- a/docs/pages/x/api/charts/charts-zoom-slider.js +++ b/docs/pages/x/api/charts/charts-zoom-slider.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './charts-zoom-slider.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChartsZoomSlider } from './types.charts-zoom-slider'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/charts-zoom-slider', - false, - /\.\/charts-zoom-slider.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/continuous-color-legend.js b/docs/pages/x/api/charts/continuous-color-legend.js index fa3c42ac6e0e8..40df520f7ee5b 100644 --- a/docs/pages/x/api/charts/continuous-color-legend.js +++ b/docs/pages/x/api/charts/continuous-color-legend.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './continuous-color-legend.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesContinuousColorLegend } from './types.continuous-color-legend'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axisDirection', 'axisId', 'classes', 'direction', 'gradientId', 'labelPosition', 'maxLabel', 'minLabel', 'reverse', 'rotateGradient', 'thickness']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/continuous-color-legend', - false, - /\.\/continuous-color-legend.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/focused-funnel-section.js b/docs/pages/x/api/charts/focused-funnel-section.js index fc8be4b84bf29..2459d2ada5da0 100644 --- a/docs/pages/x/api/charts/focused-funnel-section.js +++ b/docs/pages/x/api/charts/focused-funnel-section.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './focused-funnel-section.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFocusedFunnelSection } from './types.focused-funnel-section'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/focused-funnel-section', - false, - /\.\/focused-funnel-section.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/focused-heatmap-cell.js b/docs/pages/x/api/charts/focused-heatmap-cell.js index f6256afac0656..9c9006c795d13 100644 --- a/docs/pages/x/api/charts/focused-heatmap-cell.js +++ b/docs/pages/x/api/charts/focused-heatmap-cell.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './focused-heatmap-cell.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFocusedHeatmapCell } from './types.focused-heatmap-cell'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/focused-heatmap-cell', - false, - /\.\/focused-heatmap-cell.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/focused-radar-mark.js b/docs/pages/x/api/charts/focused-radar-mark.js index 022512ab391b0..d54770d29b6b7 100644 --- a/docs/pages/x/api/charts/focused-radar-mark.js +++ b/docs/pages/x/api/charts/focused-radar-mark.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './focused-radar-mark.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFocusedRadarMark } from './types.focused-radar-mark'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/focused-radar-mark', - false, - /\.\/focused-radar-mark.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/focused-range-bar.js b/docs/pages/x/api/charts/focused-range-bar.js index 8b7519b57efd9..135aabfb5969f 100644 --- a/docs/pages/x/api/charts/focused-range-bar.js +++ b/docs/pages/x/api/charts/focused-range-bar.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './focused-range-bar.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFocusedRangeBar } from './types.focused-range-bar'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/focused-range-bar', - false, - /\.\/focused-range-bar.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/focused-sankey-link.js b/docs/pages/x/api/charts/focused-sankey-link.js index 2a5ed861901a0..3b78881aa023e 100644 --- a/docs/pages/x/api/charts/focused-sankey-link.js +++ b/docs/pages/x/api/charts/focused-sankey-link.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './focused-sankey-link.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFocusedSankeyLink } from './types.focused-sankey-link'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/focused-sankey-link', - false, - /\.\/focused-sankey-link.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/focused-sankey-node.js b/docs/pages/x/api/charts/focused-sankey-node.js index 86b0a74546d1f..851c41bd31fb1 100644 --- a/docs/pages/x/api/charts/focused-sankey-node.js +++ b/docs/pages/x/api/charts/focused-sankey-node.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './focused-sankey-node.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFocusedSankeyNode } from './types.focused-sankey-node'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/focused-sankey-node', - false, - /\.\/focused-sankey-node.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/funnel-chart.js b/docs/pages/x/api/charts/funnel-chart.js index 32aef0faefddd..584ee5cbbd511 100644 --- a/docs/pages/x/api/charts/funnel-chart.js +++ b/docs/pages/x/api/charts/funnel-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './funnel-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFunnelChart } from './types.funnel-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axisHighlight', 'categoryAxis', 'colors', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'gap', 'height', 'hiddenItems', 'hideLegend', 'highlightedItem', 'id', 'initialHiddenItems', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onItemClick', 'onTooltipItemChange', 'series', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipItem', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/funnel-chart', - false, - /\.\/funnel-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/funnel-plot.js b/docs/pages/x/api/charts/funnel-plot.js index 34bb54b209442..70d98d03d8276 100644 --- a/docs/pages/x/api/charts/funnel-plot.js +++ b/docs/pages/x/api/charts/funnel-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './funnel-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFunnelPlot } from './types.funnel-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['onItemClick', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/funnel-plot', - false, - /\.\/funnel-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/funnel-series.js b/docs/pages/x/api/charts/funnel-series.js index 6d06e1f509049..d5abf03bacc55 100644 --- a/docs/pages/x/api/charts/funnel-series.js +++ b/docs/pages/x/api/charts/funnel-series.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './funnel-series.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesFunnelSeries } from './types.funnel-series'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/funnel-series.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/gauge-container.js b/docs/pages/x/api/charts/gauge-container.js index c669dbb031e8b..de15fc31f6fcf 100644 --- a/docs/pages/x/api/charts/gauge-container.js +++ b/docs/pages/x/api/charts/gauge-container.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './gauge-container.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesGaugeContainer } from './types.gauge-container'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['cornerRadius', 'cx', 'cy', 'desc', 'endAngle', 'height', 'id', 'innerRadius', 'margin', 'outerRadius', 'skipAnimation', 'startAngle', 'title', 'value', 'valueMax', 'valueMin', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/gauge-container', - false, - /\.\/gauge-container.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/gauge.js b/docs/pages/x/api/charts/gauge.js index 5d6787746d9c8..69e0bc72b8b6c 100644 --- a/docs/pages/x/api/charts/gauge.js +++ b/docs/pages/x/api/charts/gauge.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './gauge.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesGauge } from './types.gauge'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['cornerRadius', 'cx', 'cy', 'desc', 'endAngle', 'height', 'id', 'innerRadius', 'margin', 'outerRadius', 'skipAnimation', 'startAngle', 'title', 'value', 'valueMax', 'valueMin', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/gauge', - false, - /\.\/gauge.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/heatmap-cell.js b/docs/pages/x/api/charts/heatmap-cell.js index b010ebe16187e..98443e91aadff 100644 --- a/docs/pages/x/api/charts/heatmap-cell.js +++ b/docs/pages/x/api/charts/heatmap-cell.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './heatmap-cell.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesHeatmapCell } from './types.heatmap-cell'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/heatmap-cell', - false, - /\.\/heatmap-cell.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/heatmap-plot.js b/docs/pages/x/api/charts/heatmap-plot.js index 2155a3681f870..e8881db08d36d 100644 --- a/docs/pages/x/api/charts/heatmap-plot.js +++ b/docs/pages/x/api/charts/heatmap-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './heatmap-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesHeatmapPlot } from './types.heatmap-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['borderRadius', 'className', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/heatmap-plot', - false, - /\.\/heatmap-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/heatmap-premium.js b/docs/pages/x/api/charts/heatmap-premium.js index ba465fc43bf94..e25f77eeec4c3 100644 --- a/docs/pages/x/api/charts/heatmap-premium.js +++ b/docs/pages/x/api/charts/heatmap-premium.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './heatmap-premium.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesHeatmapPremium } from './types.heatmap-premium'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'height', 'hideLegend', 'highlightedItem', 'id', 'initialZoom', 'loading', 'localeText', 'margin', 'onHighlightChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'renderer', 'series', 'showToolbar', 'slotProps', 'slots', 'title', 'tooltip', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/heatmap-premium', - false, - /\.\/heatmap-premium.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/heatmap-series.js b/docs/pages/x/api/charts/heatmap-series.js index 3f2228ffa3f2f..3f5f6d2313e3d 100644 --- a/docs/pages/x/api/charts/heatmap-series.js +++ b/docs/pages/x/api/charts/heatmap-series.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './heatmap-series.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesHeatmapSeries } from './types.heatmap-series'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/heatmap-series.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/heatmap-tooltip-content.js b/docs/pages/x/api/charts/heatmap-tooltip-content.js index 96176fa8d67e9..ba76e39b7602c 100644 --- a/docs/pages/x/api/charts/heatmap-tooltip-content.js +++ b/docs/pages/x/api/charts/heatmap-tooltip-content.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './heatmap-tooltip-content.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesHeatmapTooltipContent } from './types.heatmap-tooltip-content'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/heatmap-tooltip-content', - false, - /\.\/heatmap-tooltip-content.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/heatmap-tooltip.js b/docs/pages/x/api/charts/heatmap-tooltip.js index bf4dd9ab427e5..d4386a143120b 100644 --- a/docs/pages/x/api/charts/heatmap-tooltip.js +++ b/docs/pages/x/api/charts/heatmap-tooltip.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './heatmap-tooltip.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesHeatmapTooltip } from './types.heatmap-tooltip'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['anchor', 'anchorEl', 'classes', 'component', 'components', 'componentsProps', 'container', 'disablePortal', 'keepMounted', 'modifiers', 'open', 'placement', 'popperOptions', 'popperRef', 'position', 'slotProps', 'slots', 'sx', 'transition', 'trigger']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/heatmap-tooltip', - false, - /\.\/heatmap-tooltip.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/heatmap.js b/docs/pages/x/api/charts/heatmap.js index 7a6362626eb3e..c1d85c316a2a8 100644 --- a/docs/pages/x/api/charts/heatmap.js +++ b/docs/pages/x/api/charts/heatmap.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './heatmap.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesHeatmap } from './types.heatmap'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['borderRadius', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'experimentalFeatures', 'height', 'hideLegend', 'highlightedItem', 'id', 'initialZoom', 'loading', 'localeText', 'margin', 'onHighlightChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'series', 'showToolbar', 'slotProps', 'slots', 'title', 'tooltip', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/heatmap', - false, - /\.\/heatmap.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/legend-item-params.js b/docs/pages/x/api/charts/legend-item-params.js index bcb6ce835da7f..b42e3a6b20a86 100644 --- a/docs/pages/x/api/charts/legend-item-params.js +++ b/docs/pages/x/api/charts/legend-item-params.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './legend-item-params.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLegendItemParams } from './types.legend-item-params'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/legend-item-params.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/line-chart-pro.js b/docs/pages/x/api/charts/line-chart-pro.js index 980facd3b7bdb..d0682949f2375 100644 --- a/docs/pages/x/api/charts/line-chart-pro.js +++ b/docs/pages/x/api/charts/line-chart-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './line-chart-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLineChartPro } from './types.line-chart-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'disableLineItemHighlight', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'initialZoom', 'loading', 'localeText', 'margin', 'onAreaClick', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onLineClick', 'onMarkClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/line-chart-pro', - false, - /\.\/line-chart-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/line-chart.js b/docs/pages/x/api/charts/line-chart.js index beb551dcf7aba..07749d738f6c4 100644 --- a/docs/pages/x/api/charts/line-chart.js +++ b/docs/pages/x/api/charts/line-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './line-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLineChart } from './types.line-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'disableLineItemHighlight', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedAxis', 'highlightedItem', 'id', 'initialHiddenItems', 'loading', 'localeText', 'margin', 'onAreaClick', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onLineClick', 'onMarkClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/line-chart', - false, - /\.\/line-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/line-element.js b/docs/pages/x/api/charts/line-element.js index d7184c18b0a04..0a1150b897175 100644 --- a/docs/pages/x/api/charts/line-element.js +++ b/docs/pages/x/api/charts/line-element.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './line-element.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLineElement } from './types.line-element'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['hidden', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/line-element', - false, - /\.\/line-element.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/line-highlight-element.js b/docs/pages/x/api/charts/line-highlight-element.js index 2a0b2f554d617..36960eb6b2179 100644 --- a/docs/pages/x/api/charts/line-highlight-element.js +++ b/docs/pages/x/api/charts/line-highlight-element.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './line-highlight-element.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLineHighlightElement } from './types.line-highlight-element'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/line-highlight-element', - false, - /\.\/line-highlight-element.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/line-highlight-plot.js b/docs/pages/x/api/charts/line-highlight-plot.js index 72853a4088d5a..b88954f9d7382 100644 --- a/docs/pages/x/api/charts/line-highlight-plot.js +++ b/docs/pages/x/api/charts/line-highlight-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './line-highlight-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLineHighlightPlot } from './types.line-highlight-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/line-highlight-plot', - false, - /\.\/line-highlight-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/line-plot.js b/docs/pages/x/api/charts/line-plot.js index 7bbb61a96c45d..f89959950b724 100644 --- a/docs/pages/x/api/charts/line-plot.js +++ b/docs/pages/x/api/charts/line-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './line-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLinePlot } from './types.line-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['onItemClick', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/line-plot', - false, - /\.\/line-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/line-series.js b/docs/pages/x/api/charts/line-series.js index 0930ba5152aea..be5b73d670a5c 100644 --- a/docs/pages/x/api/charts/line-series.js +++ b/docs/pages/x/api/charts/line-series.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './line-series.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesLineSeries } from './types.line-series'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/line-series.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/mark-element.js b/docs/pages/x/api/charts/mark-element.js index ef1578e89fe21..9348deb99a083 100644 --- a/docs/pages/x/api/charts/mark-element.js +++ b/docs/pages/x/api/charts/mark-element.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './mark-element.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMarkElement } from './types.mark-element'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['dataIndex', 'hidden', 'isFaded', 'isHighlighted', 'shape', 'skipAnimation']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/mark-element', - false, - /\.\/mark-element.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/mark-plot.js b/docs/pages/x/api/charts/mark-plot.js index dc046255e92b2..15aa2b09fa2ce 100644 --- a/docs/pages/x/api/charts/mark-plot.js +++ b/docs/pages/x/api/charts/mark-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './mark-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMarkPlot } from './types.mark-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['onItemClick', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/mark-plot', - false, - /\.\/mark-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-arc-label-plot.js b/docs/pages/x/api/charts/pie-arc-label-plot.js index f90cb91f321ab..696dbf356415d 100644 --- a/docs/pages/x/api/charts/pie-arc-label-plot.js +++ b/docs/pages/x/api/charts/pie-arc-label-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-arc-label-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPieArcLabelPlot } from './types.pie-arc-label-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['arcLabel', 'arcLabelMinAngle', 'arcLabelRadius', 'cornerRadius', 'faded', 'highlighted', 'innerRadius', 'outerRadius', 'paddingAngle', 'seriesId', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/pie-arc-label-plot', - false, - /\.\/pie-arc-label-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-arc-label.js b/docs/pages/x/api/charts/pie-arc-label.js index 167aacf48bb4f..0b3da0489ce86 100644 --- a/docs/pages/x/api/charts/pie-arc-label.js +++ b/docs/pages/x/api/charts/pie-arc-label.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-arc-label.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPieArcLabel } from './types.pie-arc-label'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/pie-arc-label', - false, - /\.\/pie-arc-label.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-arc-plot.js b/docs/pages/x/api/charts/pie-arc-plot.js index 93f14c2f02bfd..a3a2b360e833b 100644 --- a/docs/pages/x/api/charts/pie-arc-plot.js +++ b/docs/pages/x/api/charts/pie-arc-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-arc-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPieArcPlot } from './types.pie-arc-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['arcLabelRadius', 'cornerRadius', 'faded', 'highlighted', 'innerRadius', 'onItemClick', 'outerRadius', 'paddingAngle', 'seriesId', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/pie-arc-plot', - false, - /\.\/pie-arc-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-arc.js b/docs/pages/x/api/charts/pie-arc.js index 69bf4d4267107..5bc256ebb1566 100644 --- a/docs/pages/x/api/charts/pie-arc.js +++ b/docs/pages/x/api/charts/pie-arc.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-arc.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPieArc } from './types.pie-arc'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['skipAnimation', 'skipInteraction']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/pie-arc', - false, - /\.\/pie-arc.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-chart-pro.js b/docs/pages/x/api/charts/pie-chart-pro.js index 49c2012ec110d..6b5a3b4920125 100644 --- a/docs/pages/x/api/charts/pie-chart-pro.js +++ b/docs/pages/x/api/charts/pie-chart-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-chart-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPieChartPro } from './types.pie-chart-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['colors', 'dataset', 'desc', 'disableKeyboardNavigation', 'experimentalFeatures', 'height', 'hiddenItems', 'hideLegend', 'highlightedItem', 'id', 'initialHiddenItems', 'loading', 'localeText', 'margin', 'onHiddenItemsChange', 'onHighlightChange', 'onItemClick', 'onTooltipItemChange', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipItem', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/pie-chart-pro', - false, - /\.\/pie-chart-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-chart.js b/docs/pages/x/api/charts/pie-chart.js index a8d7670843f31..6d025217d2dad 100644 --- a/docs/pages/x/api/charts/pie-chart.js +++ b/docs/pages/x/api/charts/pie-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPieChart } from './types.pie-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['colors', 'dataset', 'desc', 'disableKeyboardNavigation', 'experimentalFeatures', 'height', 'hiddenItems', 'hideLegend', 'highlightedItem', 'id', 'initialHiddenItems', 'loading', 'localeText', 'margin', 'onHiddenItemsChange', 'onHighlightChange', 'onItemClick', 'onTooltipItemChange', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipItem', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/pie-chart', - false, - /\.\/pie-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-plot.js b/docs/pages/x/api/charts/pie-plot.js index ed826c648f964..b378a83d57ea8 100644 --- a/docs/pages/x/api/charts/pie-plot.js +++ b/docs/pages/x/api/charts/pie-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPiePlot } from './types.pie-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['onItemClick', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/pie-plot', - false, - /\.\/pie-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/pie-series.js b/docs/pages/x/api/charts/pie-series.js index 40f519e6a36b3..d5fb006d07856 100644 --- a/docs/pages/x/api/charts/pie-series.js +++ b/docs/pages/x/api/charts/pie-series.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './pie-series.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPieSeries } from './types.pie-series'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/pie-series.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/piecewise-color-legend.js b/docs/pages/x/api/charts/piecewise-color-legend.js index f40a52fcc3260..c5a8fefbef394 100644 --- a/docs/pages/x/api/charts/piecewise-color-legend.js +++ b/docs/pages/x/api/charts/piecewise-color-legend.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './piecewise-color-legend.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesPiecewiseColorLegend } from './types.piecewise-color-legend'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axisDirection', 'axisId', 'classes', 'direction', 'labelFormatter', 'labelPosition', 'markType', 'onItemClick']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/piecewise-color-legend', - false, - /\.\/piecewise-color-legend.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-axis-highlight.js b/docs/pages/x/api/charts/radar-axis-highlight.js index 8dbb80f1a1e53..4c7cfb840b457 100644 --- a/docs/pages/x/api/charts/radar-axis-highlight.js +++ b/docs/pages/x/api/charts/radar-axis-highlight.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-axis-highlight.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarAxisHighlight } from './types.radar-axis-highlight'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-axis-highlight', - false, - /\.\/radar-axis-highlight.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-axis.js b/docs/pages/x/api/charts/radar-axis.js index 0fa853dffc46a..148258c365e2e 100644 --- a/docs/pages/x/api/charts/radar-axis.js +++ b/docs/pages/x/api/charts/radar-axis.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-axis.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarAxis } from './types.radar-axis'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['angle', 'classes', 'divisions', 'dominantBaseline', 'labelOrientation', 'metric', 'textAnchor']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-axis', - false, - /\.\/radar-axis.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-chart-pro.js b/docs/pages/x/api/charts/radar-chart-pro.js index c48732ce6cf3d..32bb57cef5d92 100644 --- a/docs/pages/x/api/charts/radar-chart-pro.js +++ b/docs/pages/x/api/charts/radar-chart-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-chart-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarChartPro } from './types.radar-chart-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['className', 'colors', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'divisions', 'experimentalFeatures', 'height', 'hiddenItems', 'hideLegend', 'highlight', 'highlightedItem', 'id', 'initialHiddenItems', 'loading', 'localeText', 'margin', 'onAreaClick', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onMarkClick', 'onTooltipItemChange', 'radar', 'series', 'shape', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'stripeColor', 'title', 'tooltipItem', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-chart-pro', - false, - /\.\/radar-chart-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-chart.js b/docs/pages/x/api/charts/radar-chart.js index 91d0066cd7ded..ac7eb4b7e7e90 100644 --- a/docs/pages/x/api/charts/radar-chart.js +++ b/docs/pages/x/api/charts/radar-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarChart } from './types.radar-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['className', 'colors', 'desc', 'disableAxisListener', 'disableKeyboardNavigation', 'divisions', 'experimentalFeatures', 'height', 'hiddenItems', 'hideLegend', 'highlight', 'highlightedItem', 'id', 'initialHiddenItems', 'loading', 'localeText', 'margin', 'onAreaClick', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onMarkClick', 'onTooltipItemChange', 'radar', 'series', 'shape', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'stripeColor', 'title', 'tooltipItem', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-chart', - false, - /\.\/radar-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-grid.js b/docs/pages/x/api/charts/radar-grid.js index 4cae160e86aed..140787f151eba 100644 --- a/docs/pages/x/api/charts/radar-grid.js +++ b/docs/pages/x/api/charts/radar-grid.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-grid.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarGrid } from './types.radar-grid'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'divisions', 'shape', 'stripeColor']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-grid', - false, - /\.\/radar-grid.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-metric-labels.js b/docs/pages/x/api/charts/radar-metric-labels.js index a95d2dace59b8..76f822f2dc690 100644 --- a/docs/pages/x/api/charts/radar-metric-labels.js +++ b/docs/pages/x/api/charts/radar-metric-labels.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-metric-labels.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarMetricLabels } from './types.radar-metric-labels'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-metric-labels', - false, - /\.\/radar-metric-labels.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-series-area.js b/docs/pages/x/api/charts/radar-series-area.js index 7f1aebb435ab5..c801e8119876a 100644 --- a/docs/pages/x/api/charts/radar-series-area.js +++ b/docs/pages/x/api/charts/radar-series-area.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-series-area.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarSeriesArea } from './types.radar-series-area'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'onItemClick', 'seriesId']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-series-area', - false, - /\.\/radar-series-area.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-series-marks.js b/docs/pages/x/api/charts/radar-series-marks.js index 1a03096ca28a1..8e5631ca2c402 100644 --- a/docs/pages/x/api/charts/radar-series-marks.js +++ b/docs/pages/x/api/charts/radar-series-marks.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-series-marks.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarSeriesMarks } from './types.radar-series-marks'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'onItemClick', 'seriesId']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-series-marks', - false, - /\.\/radar-series-marks.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-series-plot.js b/docs/pages/x/api/charts/radar-series-plot.js index b7ff1df34d997..de5975824407d 100644 --- a/docs/pages/x/api/charts/radar-series-plot.js +++ b/docs/pages/x/api/charts/radar-series-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-series-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarSeriesPlot } from './types.radar-series-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'onAreaClick', 'onMarkClick', 'seriesId']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/radar-series-plot', - false, - /\.\/radar-series-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/radar-series.js b/docs/pages/x/api/charts/radar-series.js index 165a72fe2fa35..be18867bf2d2f 100644 --- a/docs/pages/x/api/charts/radar-series.js +++ b/docs/pages/x/api/charts/radar-series.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './radar-series.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRadarSeries } from './types.radar-series'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/radar-series.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/range-bar-plot.js b/docs/pages/x/api/charts/range-bar-plot.js index e074412d1e62c..77b71f8fdc37e 100644 --- a/docs/pages/x/api/charts/range-bar-plot.js +++ b/docs/pages/x/api/charts/range-bar-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './range-bar-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesRangeBarPlot } from './types.range-bar-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['borderRadius', 'onItemClick', 'skipAnimation', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/range-bar-plot', - false, - /\.\/range-bar-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/sankey-chart.js b/docs/pages/x/api/charts/sankey-chart.js index 2483bc76351e4..67464fe9c7b9e 100644 --- a/docs/pages/x/api/charts/sankey-chart.js +++ b/docs/pages/x/api/charts/sankey-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './sankey-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesSankeyChart } from './types.sankey-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'colors', 'desc', 'disableKeyboardNavigation', 'experimentalFeatures', 'height', 'highlightedItem', 'id', 'loading', 'localeText', 'margin', 'onHighlightChange', 'onLinkClick', 'onNodeClick', 'onTooltipItemChange', 'series', 'slotProps', 'slots', 'title', 'tooltipItem', 'width']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/sankey-chart', - false, - /\.\/sankey-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/sankey-data-provider.js b/docs/pages/x/api/charts/sankey-data-provider.js index ceae489af2255..7ad30697ba763 100644 --- a/docs/pages/x/api/charts/sankey-data-provider.js +++ b/docs/pages/x/api/charts/sankey-data-provider.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './sankey-data-provider.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesSankeyDataProvider } from './types.sankey-data-provider'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/sankey-data-provider', - false, - /\.\/sankey-data-provider.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/sankey-plot.js b/docs/pages/x/api/charts/sankey-plot.js index f03482dee53bf..aa6dd714addad 100644 --- a/docs/pages/x/api/charts/sankey-plot.js +++ b/docs/pages/x/api/charts/sankey-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './sankey-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesSankeyPlot } from './types.sankey-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'onLinkClick', 'onNodeClick']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/sankey-plot', - false, - /\.\/sankey-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/sankey-tooltip-content.js b/docs/pages/x/api/charts/sankey-tooltip-content.js index 53ba3913272af..ec853433e74e4 100644 --- a/docs/pages/x/api/charts/sankey-tooltip-content.js +++ b/docs/pages/x/api/charts/sankey-tooltip-content.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './sankey-tooltip-content.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesSankeyTooltipContent } from './types.sankey-tooltip-content'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/sankey-tooltip-content', - false, - /\.\/sankey-tooltip-content.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/sankey-tooltip.js b/docs/pages/x/api/charts/sankey-tooltip.js index a0b09c0531c0d..2e392e32a1510 100644 --- a/docs/pages/x/api/charts/sankey-tooltip.js +++ b/docs/pages/x/api/charts/sankey-tooltip.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './sankey-tooltip.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesSankeyTooltip } from './types.sankey-tooltip'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['anchor', 'anchorEl', 'classes', 'component', 'components', 'componentsProps', 'container', 'disablePortal', 'keepMounted', 'modifiers', 'open', 'placement', 'popperOptions', 'popperRef', 'position', 'slotProps', 'slots', 'sx', 'transition', 'trigger']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/sankey-tooltip', - false, - /\.\/sankey-tooltip.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/scatter-chart-pro.js b/docs/pages/x/api/charts/scatter-chart-pro.js index 81f7671153806..dbba788a478c2 100644 --- a/docs/pages/x/api/charts/scatter-chart-pro.js +++ b/docs/pages/x/api/charts/scatter-chart-pro.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './scatter-chart-pro.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesScatterChartPro } from './types.scatter-chart-pro'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableClosestPoint', 'disableHitArea', 'disableKeyboardNavigation', 'disableVoronoi', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedItem', 'hitAreaRadius', 'id', 'initialHiddenItems', 'initialZoom', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'onZoomChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis', 'zoomData', 'zoomInteractionConfig']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/scatter-chart-pro', - false, - /\.\/scatter-chart-pro.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/scatter-chart.js b/docs/pages/x/api/charts/scatter-chart.js index 5ddd144abf5da..57cd59e9665c6 100644 --- a/docs/pages/x/api/charts/scatter-chart.js +++ b/docs/pages/x/api/charts/scatter-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './scatter-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesScatterChart } from './types.scatter-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['axesGap', 'axisHighlight', 'brushConfig', 'colors', 'dataset', 'desc', 'disableAxisListener', 'disableClosestPoint', 'disableHitArea', 'disableKeyboardNavigation', 'disableVoronoi', 'experimentalFeatures', 'grid', 'height', 'hiddenItems', 'hideLegend', 'highlightedItem', 'hitAreaRadius', 'id', 'initialHiddenItems', 'loading', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'renderer', 'series', 'showToolbar', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'width', 'xAxis', 'yAxis', 'zAxis']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/scatter-chart', - false, - /\.\/scatter-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/scatter-plot.js b/docs/pages/x/api/charts/scatter-plot.js index 378b80ad633ea..7b34bde18f1ed 100644 --- a/docs/pages/x/api/charts/scatter-plot.js +++ b/docs/pages/x/api/charts/scatter-plot.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './scatter-plot.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesScatterPlot } from './types.scatter-plot'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['onItemClick', 'renderer', 'slotProps', 'slots']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/scatter-plot', - false, - /\.\/scatter-plot.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/scatter-series.js b/docs/pages/x/api/charts/scatter-series.js index 7937761c60bfe..39747ba8b2adc 100644 --- a/docs/pages/x/api/charts/scatter-series.js +++ b/docs/pages/x/api/charts/scatter-series.js @@ -1,22 +1,12 @@ -import * as React from 'react'; -import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; -import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; -import mapApiPageTranslations from 'docsx/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './scatter-series.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesScatterSeries } from './types.scatter-series'; -export default function Page(props) { - const { descriptions } = props; - return ( - - ); -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/', - false, - /\.\/scatter-series.*.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/scatter.js b/docs/pages/x/api/charts/scatter.js index 0874ed1bad23d..70991b5f5911f 100644 --- a/docs/pages/x/api/charts/scatter.js +++ b/docs/pages/x/api/charts/scatter.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './scatter.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesScatter } from './types.scatter'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['colorGetter', 'onItemClick']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/scatter', - false, - /\.\/scatter.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/spark-line-chart.js b/docs/pages/x/api/charts/spark-line-chart.js index c8123524d34f5..b1a570b2ef7a0 100644 --- a/docs/pages/x/api/charts/spark-line-chart.js +++ b/docs/pages/x/api/charts/spark-line-chart.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './spark-line-chart.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesSparkLineChart } from './types.spark-line-chart'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['area', 'baseline', 'brushConfig', 'clipAreaOffset', 'color', 'data', 'dataset', 'desc', 'disableAxisListener', 'disableClipping', 'disableHitArea', 'disableKeyboardNavigation', 'experimentalFeatures', 'height', 'hiddenItems', 'highlightedAxis', 'highlightedItem', 'hitAreaRadius', 'id', 'initialHiddenItems', 'localeText', 'margin', 'onAxisClick', 'onHiddenItemsChange', 'onHighlightChange', 'onHighlightedAxisChange', 'onItemClick', 'onTooltipAxisChange', 'onTooltipItemChange', 'plotType', 'showHighlight', 'showTooltip', 'skipAnimation', 'slotProps', 'slots', 'title', 'tooltipAxis', 'tooltipItem', 'valueFormatter', 'width', 'xAxis', 'yAxis']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/spark-line-chart', - false, - /\.\/spark-line-chart.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/toolbar-button.js b/docs/pages/x/api/charts/toolbar-button.js index bc2bdd497e6dc..23087419292af 100644 --- a/docs/pages/x/api/charts/toolbar-button.js +++ b/docs/pages/x/api/charts/toolbar-button.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './toolbar-button.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesToolbarButton } from './types.toolbar-button'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['render']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/toolbar-button', - false, - /\.\/toolbar-button.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/toolbar.js b/docs/pages/x/api/charts/toolbar.js index 9ccb74f768e68..c71a1e12559a2 100644 --- a/docs/pages/x/api/charts/toolbar.js +++ b/docs/pages/x/api/charts/toolbar.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './toolbar.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesToolbar } from './types.toolbar'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['render']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/charts/toolbar', - false, - /\.\/toolbar.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/charts/types.animated-area.md b/docs/pages/x/api/charts/types.animated-area.md new file mode 100644 index 0000000000000..294d490591bac --- /dev/null +++ b/docs/pages/x/api/charts/types.animated-area.md @@ -0,0 +1,1963 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.animated-area.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### FocusedLineMark + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `AnimatedAreaProps` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'area' + | 'line' + | 'mark' + | 'markAnimate' + | 'highlight' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + classes?: Partial; + seriesId: string; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.animated-area.ts b/docs/pages/x/api/charts/types.animated-area.ts new file mode 100644 index 0000000000000..3221e7331920f --- /dev/null +++ b/docs/pages/x/api/charts/types.animated-area.ts @@ -0,0 +1,4 @@ +import { AnimatedArea } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesAnimatedArea = createTypes(import.meta.url, AnimatedArea); diff --git a/docs/pages/x/api/charts/types.animated-line.md b/docs/pages/x/api/charts/types.animated-line.md new file mode 100644 index 0000000000000..29f51135ed81f --- /dev/null +++ b/docs/pages/x/api/charts/types.animated-line.md @@ -0,0 +1,1963 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.animated-line.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### FocusedLineMark + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `AnimatedAreaProps` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'area' + | 'line' + | 'mark' + | 'markAnimate' + | 'highlight' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + classes?: Partial; + seriesId: string; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.animated-line.ts b/docs/pages/x/api/charts/types.animated-line.ts new file mode 100644 index 0000000000000..212b325427700 --- /dev/null +++ b/docs/pages/x/api/charts/types.animated-line.ts @@ -0,0 +1,4 @@ +import { AnimatedLine } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesAnimatedLine = createTypes(import.meta.url, AnimatedLine); diff --git a/docs/pages/x/api/charts/types.area-element.md b/docs/pages/x/api/charts/types.area-element.md new file mode 100644 index 0000000000000..af97ed8d2f6dc --- /dev/null +++ b/docs/pages/x/api/charts/types.area-element.md @@ -0,0 +1,1963 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.area-element.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### FocusedLineMark + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `AnimatedAreaProps` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'area' + | 'line' + | 'mark' + | 'markAnimate' + | 'highlight' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + classes?: Partial; + seriesId: string; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.area-element.ts b/docs/pages/x/api/charts/types.area-element.ts new file mode 100644 index 0000000000000..e75412ed93e4e --- /dev/null +++ b/docs/pages/x/api/charts/types.area-element.ts @@ -0,0 +1,4 @@ +import { AreaElement } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesAreaElement = createTypes(import.meta.url, AreaElement); diff --git a/docs/pages/x/api/charts/types.area-plot.md b/docs/pages/x/api/charts/types.area-plot.md new file mode 100644 index 0000000000000..5e0d8e8c53d4f --- /dev/null +++ b/docs/pages/x/api/charts/types.area-plot.md @@ -0,0 +1,1963 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.area-plot.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### FocusedLineMark + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `AnimatedAreaProps` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'area' + | 'line' + | 'mark' + | 'markAnimate' + | 'highlight' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + classes?: Partial; + seriesId: string; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.area-plot.ts b/docs/pages/x/api/charts/types.area-plot.ts new file mode 100644 index 0000000000000..951f19550b984 --- /dev/null +++ b/docs/pages/x/api/charts/types.area-plot.ts @@ -0,0 +1,4 @@ +import { AreaPlot } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesAreaPlot = createTypes(import.meta.url, AreaPlot); diff --git a/docs/pages/x/api/charts/types.axis-config.md b/docs/pages/x/api/charts/types.axis-config.md new file mode 100644 index 0000000000000..de897bd5d9ccd --- /dev/null +++ b/docs/pages/x/api/charts/types.axis-config.md @@ -0,0 +1,38240 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.axis-config.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarChartPremium + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPremium Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar or range bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `(RangeBarSeriesType \| BarSeries)[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] or \[\[RangeBarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartPremiumSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartPremiumSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarChartPro + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### blueberryTwilightPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### bluePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsAxis Props:** + +| Prop | Type | Default | Description | +| :-------- | :-------------------- | :------ | :-------------------------------------- | +| slotProps | `ChartsAxisSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsAxisSlots` | `{}` | Overridable component slots. | + +### ChartsAxisHighlight + +Demos: + +- [Custom components](https://mui.com/x/react-charts/components/) + +API: + +- [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/) + +**ChartsAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :--- | :------------------------ | :------ | :---------- | +| x | `ChartsAxisHighlightType` | - | - | +| y | `ChartsAxisHighlightType` | - | - | + +### ChartsAxisTooltipContent + +**ChartsAxisTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | The sort in which series items are displayed in the tooltip. When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. | +| sx | `SxProps` | - | - | + +### ChartsClipPath + +API: + +- [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/) + +**ChartsClipPath Props:** + +| Prop | Type | Default | Description | +| :----- | :----------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| offset | `{ top?: number; right?: number; bottom?: number; left?: number }` | - | Offset, in pixels, of the clip path rectangle from the drawing area. A positive value will move the rectangle outside the drawing area. | +| id\* | `string` | - | The id of the clip path. | + +### ChartsColorCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### ChartsColorPaletteCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsContainerPremium + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPremium` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPremium API](https://mui.com/x/api/charts/charts-container-premium/) + +**ChartsContainerPremium Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsContainerPro + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPro` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/) + +**ChartsContainerPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsDataProvider + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/react-charts/composition/) + +API: + +- [ChartsDataProvider API](https://mui.com/x/api/charts/charts-data-provider/) + +**ChartsDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsDataProviderPremium + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPremium API](https://mui.com/x/api/charts/charts-data-provider-premium/) + +**ChartsDataProviderPremium Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsDataProviderPro + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPro API](https://mui.com/x/api/charts/charts-data-provider-pro/) + +**ChartsDataProviderPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsGrid + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsGrid API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsGrid Props:** + +| Prop | Type | Default | Description | +| :--------- | :--------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| horizontal | `boolean` | - | Displays horizontal grid. | +| vertical | `boolean` | - | Displays vertical grid. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsItemTooltipContent + +**ChartsItemTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sx | `SxProps` | - | - | + +### ChartsLegend + +**ChartsLegend Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :----------------------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | - | The direction of the legend layout. The default depends on the chart. | +| onItemClick | `((event: React.MouseEvent, legendItem: SeriesLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| toggleVisibilityOnClick | `boolean` | `false` | If `true`, clicking on a legend item will toggle the visibility of the corresponding series. | +| className | `string` | - | - | + +### ChartsLocalizationProvider + +Demos: + +- [localization](https://mui.com/x/react-charts/localization/) + +API: + +- [ChartsLocalizationProvider API](https://mui.com/x/api/charts/charts-localization-provider/) + +**ChartsLocalizationProvider Props:** + +| Prop | Type | Default | Description | +| :--------- | :-------------------------- | :------ | :----------------------------------- | +| localeText | `Partial` | - | Localized text for chart components. | +| children | `React.ReactNode` | - | - | + +### ChartsReferenceLine + +**ChartsReferenceLine Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------- | :--------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | +| label | `string` | - | The label to display along the reference line. | +| axisId | `AxisId` | ``The `id` of the first defined axis.`` | The id of the axis used for the reference value. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| labelAlign | `'start' \| 'middle' \| 'end'` | `'middle'` | The alignment if the label is in the chart drawing area. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the label. | +| lineStyle | `React.CSSProperties` | - | The style applied to the line. | +| spacing | `number \| { x?: number; y?: number }` | `{ x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line.` | Additional space around the label in px. Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. | +| x | `string \| number \| Date` | - | The x value associated with the reference line. If defined the reference line will be vertical. | +| y | `string \| number \| Date` | - | The y value associated with the reference line. If defined the reference line will be horizontal. | + +### ChartsRenderer + +A component that renders different types of charts based on the provided data and configuration. +It supports column, bar, line, area and pie charts with customizable styling and formatting options. +The component handles both single and multiple dimension datasets, with special data processing for each case. +For multiple dimension datasets, it creates grouped axes. + +**ChartsRenderer Props:** + +| Prop | Type | Default | Description | +| :-------------- | :----------------------------------------------------------------------------------------------------- | :------ | :---------- | +| chartType\* | `string` | - | - | +| configuration\* | `Record` | - | - | +| dimensions\* | `({ id: string; label: string; data: (string \| number \| Date \| null)[] })[]` | - | - | +| onRender | `((type: string, props: Record, Component: React.ComponentType) => React.ReactNode)` | - | - | +| values\* | `({ id: string; label: string; data: (number \| null)[] })[]` | - | - | + +### ChartsSurface + +A helper component that combines `` and `` to provide a surface for drawing charts. +If you need more control over the layers, you can use `` and `` separately. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsSurface API](https://mui.com/x/api/charts/charts-surface/) + +**ChartsSurface Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------- | :------ | :----------------------------------------------------------------------------------------- | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsText + +Helper component to manage multiline text in SVG + +**ChartsText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :---------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text\* | `string` | - | Text displayed. | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### ChartsToolbarImageExportTrigger + +A button that triggers an image export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarImageExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartsToolbarImageExportOptions` | - | The options to apply on the image export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPrintExportTrigger + +A button that triggers a print export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarPrintExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartsToolbarPrintExportOptions` | - | The options to apply on the Print export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPro + +The chart toolbar component for the pro package. + +**ChartsToolbarPro Props:** + +| Prop | Type | Default | Description | +| :----------------- | :---------------------------------- | :------ | :---------- | +| imageExportOptions | `ChartsToolbarImageExportOptions[]` | - | - | +| printOptions | `ChartsToolbarPrintExportOptions` | - | - | + +### ChartsToolbarZoomInTrigger + +A button that zooms the chart in. +It renders the `baseButton` slot. + +**ChartsToolbarZoomInTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarZoomOutTrigger + +A button that zooms the chart out. +It renders the `baseButton` slot. + +**ChartsToolbarZoomOutTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsTooltip + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | Defines the sort order in which series items are displayed in the axis tooltip. When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. Only applies when `trigger='axis'`. | +| trigger | `'axis' \| 'none' \| 'item'` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### ChartsTooltipContainer + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltipContainer Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `TriggerOptions` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | +| children | `React.ReactNode` | - | - | + +### ChartsWebGLLayer + +### ChartsXAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/) + +**ChartsXAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'x'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelMinGap | `number` | `4` | The minimum gap in pixels between two tick labels. If two tick labels are closer than this minimum gap, one of them will be hidden. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsYAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/) + +**ChartsYAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'y'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsZoomSlider + +Renders the zoom slider for all x and y axes that have it enabled. + +### ChartZoomSlider + +### cheerfulFiestaPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ContinuousColorLegend + +**ContinuousColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------------------------------------- | :--------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| gradientId | `string` | `auto-generated id` | The id for the gradient to use. If not provided, it will use the generated gradient from the axis configuration. The `gradientId` will be used as `fill="url(#gradientId)"`. | +| labelPosition | `'start' \| 'end' \| 'extremes'` | `'end'` | Where to position the labels relative to the gradient. | +| maxLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the maximum side of the gradient. Can either be a string, or a function. If not defined, the formatted maximal value is display. | +| minLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the minimum side of the gradient. Can either be a string, or a function. | +| reverse | `boolean` | `false` | If `true`, the gradient and labels will be reversed. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| thickness | `number` | `12` | The thickness of the gradient | +| className | `string` | - | - | + +### cyanPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### defaultOnBeforeExport + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| iframe | `HTMLIFrameElement` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = void; +``` + +### FocusedBar + +### FocusedFunnelSection + +### FocusedHeatmapCell + +### FocusedLineMark + +### FocusedPieArc + +**FocusedPieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color | `string` | - | - | +| cornerRadius | `number` | - | - | +| innerRadius | `number` | - | - | +| outerRadius | `number` | - | - | +| paddingAngle | `number` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | + +### FocusedRadarMark + +### FocusedRangeBar + +### FocusedScatterMark + +### FunnelChart + +**FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### FunnelPlot + +**FunnelPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| slotProps | `FunnelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### Gauge + +**Gauge Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| classes | `Partial` | - | - | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeContainer + +**GaugeContainer Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeReferenceArc + +### GaugeValueArc + +**GaugeValueArc Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------- | :------ | :---------- | +| skipAnimation | `boolean` | - | - | + +### GaugeValueText + +**GaugeValueText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### getLocalizedConfigurationOptions + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------- | :------ | :---------- | +| locale? | `Partial` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = GridChartsConfigurationOptions; +``` + +### getPieCoordinates + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------------------- | :------ | :---------- | +| series | `LegendItemParams` | - | - | +| drawing | `LegendItemParams` | - | - | + +**Return Value:** + +| Property | Type | Description | +| :---------------- | :------- | :---------- | +| `cx` | `number` | - | +| `cy` | `number` | - | +| `availableRadius` | `number` | - | + +### getValueToPositionMapper + +For a given scale return a function that map value to their position. +Useful when dealing with specific scale such as band. + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------------------- | :------ | :--------------- | +| scale | `D3Scale<{ toString: function toString() { [native code] } }, Range>` | - | The scale to use | + +**Return Value:** + +A function that map value to their position + +```tsx +type ReturnValue = (value: any) => number; +``` + +### greenPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Heatmap + +**Heatmap Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, item: SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>) => void)` | - | The callback fired when an item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: HeatmapItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `HeatmapSeries[]` | - | The series to display in the bar chart. An array of \[\[HeatmapSeries]] objects. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| slotProps | `HeatmapSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltip | `ChartsTooltipProps` | - | The configuration of the tooltip. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `HeatmapItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### HeatmapCell + +Demos: + +- [Heatmap](https://mui.com/x/react-charts/heatmap/) + +API: + +- [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/) + +**HeatmapCell Props:** + +| Prop | Type | Default | Description | +| :----------- | :---------------------- | :------ | :---------- | +| height\* | `number` | - | - | +| ownerState\* | `HeatmapCellOwnerState` | - | - | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### HeatmapData + +**Constructor Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| data | `HeatmapValueType[]` | - | - | + +**Methods:** + +```typescript +function getValue(xIndex: number, yIndex: number): number | null; +``` + +### HeatmapPlot + +**HeatmapPlot Props:** + +| Prop | Type | Default | Description | +| :----------- | :--------------------- | :------ | :------------------------------------------------ | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| slotProps | `HeatmapPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### HeatmapPremium + +**HeatmapPremium Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, item: SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>) => void)` | - | The callback fired when an item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: HeatmapItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| renderer | `'svg-single' \| 'webgl'` | - | The type of renderer to use for the heatmap plot. `svg-single`: Renders every scatter item in a `` element.`webgl`: Renders heatmap cells using WebGL for better performance, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/heatmap/#performance | +| series\* | `HeatmapSeries[]` | - | The series to display in the bar chart. An array of \[\[HeatmapSeries]] objects. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| slotProps | `HeatmapSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltip | `ChartsTooltipProps` | - | The configuration of the tooltip. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `HeatmapItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### HeatmapTooltip + +**HeatmapTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### HeatmapTooltipContent + +**HeatmapTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineChartPro + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### mangoFusionPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +### orangePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### PieArc + +**PieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| dataIndex\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| innerRadius\* | `number` | - | - | +| isFaded\* | `boolean` | - | - | +| isFocused\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| outerRadius\* | `number` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | +| startAngle\* | `number` | - | - | + +### PieArcLabel + +**PieArcLabel Props:** + +| Prop | Type | Default | Description | +| :---------------- | :-------------------- | :------ | :---------- | +| hidden | `boolean` | - | - | +| arcLabelRadius\* | `number` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| formattedArcLabel | `string \| null` | - | - | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| startAngle\* | `number` | - | - | + +### PieArcLabelPlot + +**PieArcLabelPlot Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabel | `'formattedValue' \| 'label' \| 'value' \| ((item: { id?: PieItemId; color: string; labelMarkType?: ChartsLabelMarkType; value: number; formattedValue: string; hidden: boolean; label?: string }) => string)` | - | The label displayed into the arc. | +| arcLabelMinAngle | `number` | `0` | The minimal angle required to display the arc label. | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcLabelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcLabelPlotSlots` | `{}` | Overridable component slots. | + +### PieArcPlot + +**PieArcPlot Props:** + +| Prop | Type | Default | Description | +| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcPlotSlots` | `{}` | Overridable component slots. | + +### piecewiseColorDefaultLabelFormatter + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| params | `PiecewiseLabelFormatterParams` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### PiecewiseColorLegend + +**PiecewiseColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------- | :------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :------------------------------------------------------------------ | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| labelFormatter | `((params: PiecewiseLabelFormatterParams) => string \| null)` | - | Format the legend labels. | +| labelPosition | `'start' \| 'end' \| 'extremes' \| 'inline-start' \| 'inline-end'` | `'extremes'` | Where to position the labels relative to the color marks. | +| onItemClick | `((event: React.MouseEvent, legendItem: PiecewiseColorLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| className | `string` | - | - | + +### PieChart + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PieChart API](https://mui.com/x/api/charts/pie-chart/) + +**PieChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PieChartPro + +**PieChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PiePlot + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PiePlot API](https://mui.com/x/api/charts/pie-plot/) + +**PiePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------- | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PiePlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PiePlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### pinkPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### purplePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### RadarAxis + +**RadarAxis Props:** + +| Prop | Type | Default | Description | +| :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| angle | `number` | - | The absolute rotation angle of the metrics (in degree) If not defined the metric angle will be used. | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| divisions | `number` | `1` | The number of divisions with label. | +| dominantBaseline | `'auto' \| 'use-script' \| 'no-change' \| 'reset-size' \| 'ideographic' \| 'alphabetic' \| 'hanging' \| 'mathematical' \| 'central' \| 'middle' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| ((angle: number) => 'auto' \| 'middle' \| 'alphabetic' \| 'hanging' \| 'ideographic' \| 'mathematical' \| 'central' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| 'use-script' \| 'no-change' \| 'reset-size' \| undefined)` | - | The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). | +| labelOrientation | `'horizontal' \| 'rotated'` | `'horizontal'` | Defines how label align with the axis. 'horizontal': labels stay horizontal and their placement change with the axis angle.'rotated': labels are rotated 90deg relatively to their axis. | +| metric | `string` | - | The metric to get. If `undefined`, the hook returns `null` | +| textAnchor | `'start' \| 'middle' \| 'end' \| 'inherit' \| ((angle: number) => 'start' \| 'end' \| 'middle' \| 'inherit' \| undefined)` | - | The labels text anchor or a function returning the text anchor for a given axis angle (in degree). | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarAxisHighlight + +**RadarAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarChart + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarChartPro + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartProSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarDataProvider + +**RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### RadarGrid + +**RadarGrid Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------ | :------------------------------------------------------------------------------------- | :-------------------------------------------------------- | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | + +### RadarMetricLabels + +### RadarSeriesArea + +**RadarSeriesArea Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesMarks + +**RadarSeriesMarks Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesPlot + +**RadarSeriesPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### rainbowSurgePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### RangeBarPlot + +Demos: + +- [Range Bar](https://mui.com/x/react-charts/range-bar/) + +API: + +- [RangeBarPlot API](https://mui.com/x/api/charts/range-bar-plot/) + +**RangeBarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------- | :---------- | :-------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `((event: React.MouseEvent, barItemIdentifier: RangeBarItemIdentifier) => void)` | - | Callback fired when a bar item is clicked. | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `RangeBarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `RangeBarPlotSlots` | `{}` | Overridable component slots. | + +### redPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Scatter + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [Scatter API](https://mui.com/x/api/charts/scatter/) + +**Scatter Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| colorGetter\* | `((dataIndex?: number) => string)` | - | Function to get the color of a scatter item given its data index. The data index argument is optional. If not provided, the color for the entire series is returned. If provided, the color for the specific scatter item is returned. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| series\* | `DefaultizedScatterSeriesType` | - | - | +| slotProps | `ScatterSlotProps` | - | - | +| slots | `ScatterSlots` | - | - | +| xScale\* | `D3Scale` | - | - | +| yScale\* | `D3Scale` | - | - | + +### ScatterChart + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterChartPro + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterMarker + +**ScatterMarker Props:** + +| Prop | Type | Default | Description | +| :-------------- | :------------------------------------------------------------ | :------ | :---------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | Callback fired when clicking on a scatter item. | +| color\* | `string` | - | The fill color of the marker. | +| dataIndex\* | `number` | - | The index of the data point. | +| isFaded\* | `boolean` | - | If `true`, the marker is faded. | +| isHighlighted\* | `boolean` | - | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | The series ID. | +| size\* | `number` | - | The size of the marker. | +| x\* | `number` | - | The x coordinate of the data point. | +| y\* | `number` | - | The y coordinate of the data point. | + +### ScatterPlot + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/) + +**ScatterPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :---------------------------------------------------------------------------------------------------------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| classes | `Partial` | - | - | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| slotProps | `ScatterPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### SparkLineChart + +Demos: + +- [SparkLine](https://mui.com/x/react-charts/sparkline/) + +API: + +- [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/) + +**SparkLineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| area | `boolean` | `false` | Set to `true` to fill spark line area. Has no effect if plotType='bar'. | +| axisHighlight | `ChartsAxisHighlightProps` | - | - | +| baseline | `number \| 'min' \| 'max'` | `0` | The value of the line at the base of the series area. `'min'` the area will fill the space **under** the line.`'max'` the area will fill the space **above** the line.`number` the area will fill the space between this value and the line | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| clipAreaOffset | `{ top?: number; right?: number; bottom?: number; left?: number }` | `{ top: 1, right: 1, bottom: 1, left: 1 }` | The clipped area offset in pixels. This prevents partial clipping of lines when they are drawn on the edge of the drawing area. | +| color | `ChartsColor` | `rainbowSurgePalette[0]` | Color used to colorize the sparkline. | +| curve | `CurveType` | `'linear'` | - | +| data\* | `number[]` | - | Data to plot. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClipping | `boolean` | `false` | When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. | +| disableHitArea | `boolean` | - | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'rangeBar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'rangeBar' } \| { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| { type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'rangeBar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'rangeBar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'ohlc'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'rangeBar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'rangeBar' } \| { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | `5` | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'rangeBar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'rangeBar' } \| { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| { type: 'bar'; seriesId: string; dataIndex?: number } \| { type: 'line'; seriesId: string; dataIndex?: number } \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| { type: 'pie'; seriesId: string; dataIndex?: number } \| { type: 'radar'; seriesId: string; dataIndex?: number } \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| { type: 'rangeBar'; seriesId: string; dataIndex?: number } \| { type: 'ohlc'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking close to an item. This is only available for scatter plot for now. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| LineItemIdentifier \| ScatterItemIdentifier \| PieItemIdentifier \| RadarItemIdentifier \| HeatmapItemIdentifier \| FunnelItemIdentifier \| SankeyItemIdentifier \| RangeBarItemIdentifier \| OHLCItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plotType | `'bar' \| 'line'` | `'line'` | Type of plot used. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'>; line: ChartSeriesTypeConfig<'line'>; scatter: ChartSeriesTypeConfig<'scatter'>; pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> }; radar: ChartSeriesTypeConfig<'radar'>; heatmap: ChartSeriesTypeConfig<'heatmap'>; funnel: ChartSeriesTypeConfig<'funnel'>; sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> }; rangeBar: ChartSeriesTypeConfig<'rangeBar'>; ohlc: ChartSeriesTypeConfig<'ohlc'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showHighlight | `boolean` | `false` | Set to `true` to highlight the value. With line, it shows a point. With bar, it shows a highlight band. | +| showTooltip | `boolean` | `false` | Set to `true` to enable the tooltip in the sparkline. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `SparkLineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SparkLineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| LineItemIdentifier \| LegendItemParams \| ScatterItemIdentifier \| LegendItemParams \| PieItemIdentifier \| LegendItemParams \| RadarItemIdentifier \| LegendItemParams \| HeatmapItemIdentifier \| LegendItemParams \| FunnelItemIdentifier \| LegendItemParams \| SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| RangeBarItemIdentifier \| LegendItemParams \| OHLCItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| valueFormatter | `((value: number \| null) => string)` | `(value: number \| null) => (value === null ? '' : value.toString())` | Formatter used by the tooltip. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `XAxis` | - | The xAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| yAxis | `YAxis` | - | The yAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### strawberrySkyPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Unstable_CandlestickChart + +Demos: + +- [Candlestick](https://mui.com/x/react-charts/candlestick/) + +API: + +- [Unstable_CandlestickChart API](https://mui.com/x/api/charts/candlestick/) + +**Unstable_CandlestickChart Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line', y: 'line' }` | The configuration of axes highlight. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'ohlc'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: OHLCItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `OHLCSeries[]` | - | The series to display in the candlestick chart. An array of \[\[OHLCSeries]] objects. Currently, only one OHLC series is supported. If would like to display more than one OHLC series, open an issue at https\://github.com/mui/mui-x explaining your use case. | +| seriesConfig | `{ ohlc: ChartSeriesTypeConfig<'ohlc'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `CandlestickChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `CandlestickChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `OHLCItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_CandlestickPlot + +### Unstable_FunnelChart + +**Unstable_FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarChart + +**Unstable_RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarDataProvider + +**Unstable_RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### useAnimate + +Hook to customize the animation of an element. +Animates a ref from `initialProps` to `props`. + +**useAnimate Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------- | :------ | :----------------------- | +| props | `{}` | - | The props to animate to. | +| \_\_1 | `UseAnimateParams<{}, Element, {}>` | - | - | + +**useAnimate Return Value:** + +an object containing a ref that should be passed to the element to animate and the transformed props. +If `skip` is true, the transformed props are the `props` to animate to; if it is false, the transformed props are the +`initialProps`. + +The animated props are only accessible in `applyProps`. The props returned from this hook are not animated. + +When an animation starts, an interpolator is created using `createInterpolator`. +On every animation frame: + +1. The interpolator is called to get the interpolated props; +2. `transformProps` is called to transform the interpolated props; +3. `applyProps` is called to apply the transformed props to the element. + +If `props` change while an animation is progress, the animation will continue towards the new `props`. + +The animation can be skipped by setting `skip` to true. If a transition is in progress, it will immediately end +and `applyProps` be called with the final value. If there isn't a transition in progress, a new one won't be +started and `applyProps` will not be called. + +```tsx +type ReturnValue = UseAnimateReturn; +``` + +### useAnimateArea + +Animates an area of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateArea Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateAreaParams` | - | - | + +**useAnimateArea Return Value:** + +```tsx +type ReturnValue = UseAnimatedAreaReturn; +``` + +### useAnimateBar + +Animates a bar from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to its +final position. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBar Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------- | :------ | :---------- | +| props | `UseAnimateBarParams` | - | - | + +**useAnimateBar Return Value:** + +```tsx +type ReturnValue = UseAnimateBarReturnValue; +``` + +### useAnimateBarLabel + +Animates a bar label from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to the +center of the bar it belongs to. +The label is horizontally centered within the bar when the layout is vertical, and vertically centered for laid out +horizontally. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBarLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------- | :------ | :---------- | +| props | `UseAnimateBarLabelParams` | - | - | + +**useAnimateBarLabel Return Value:** + +```tsx +type ReturnValue = UseAnimateBarLabelReturn; +``` + +### useAnimateLine + +Animates a line of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateLine Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateLineParams` | - | - | + +**useAnimateLine Return Value:** + +```tsx +type ReturnValue = UseAnimatedReturnValue; +``` + +### useAnimatePieArc + +Animates a slice of a pie chart by increasing the start and end angles from the middle angle to their final values. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArc Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------- | :------ | :---------- | +| props | `UseAnimatePieArcParams` | - | - | + +**useAnimatePieArc Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcReturnValue; +``` + +### useAnimatePieArcLabel + +Animates the label of pie slice from its middle point to the centroid of the slice. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArcLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------- | :------ | :---------- | +| props | `UseAnimatePieArcLabelParams` | - | - | + +**useAnimatePieArcLabel Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcLabelReturn; +``` + +### useAnimateRangeBar + +Animates a range bar from its center outwards. +The animation only happens in the direction of the numerical axis (x-axis for vertical layout, y-axis for horizontal layout). +The other direction remains constant during the animation. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateRangeBar Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------- | :------ | :---------- | +| props | `UseAnimateRangeBarParams` | - | - | + +**useAnimateRangeBar Return Value:** + +```tsx +type ReturnValue = UseAnimateRangeBarReturnValue; +``` + +### useAxesTooltip + +Returns the axes to display in the tooltip and the series item related to them. + +**useAxesTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| params | `UseAxesTooltipParams` | - | - | + +**useAxesTooltip Return Value:** + +```tsx +type ReturnValue = + | UseAxesTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'radar' | 'heatmap' | 'funnel' | 'rangeBar' | 'ohlc', + string | number | Date + >[] + | null; +``` + +### useBarSeries + +Get access to the internal state of bar series. + +**useBarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useBarSeries Return Value:** + +the bar series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + stackOffset?: StackOffsetType; + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + barLabelPlacement?: 'center' | 'outside'; + stack?: string; + stackOrder?: StackOrderType; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + layout: 'horizontal' | 'vertical'; + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useBarSeriesContext + +Get access to the internal state of bar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useBarSeriesContext Return Value:** + +the bar series + +```tsx +type ReturnValue = SeriesProcessorResult<'bar'> | undefined; +``` + +### useBrush + +Get the current brush state. + +- `start` is the starting point of the brush selection. +- `current` is the current point of the brush selection. + +**useBrush Return Value:** + +`{ start, current }` - The brush state. + +```tsx +type ReturnValue = { start: { x: number; y: number }; current: { x: number; y: number } } | null; +``` + +### useChartApiContext + +The `useChartApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProvider` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject>; +``` + +### useChartCartesianAxis + +**useChartCartesianAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartCartesianAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartClosestPoint + +**useChartClosestPoint Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartClosestPoint Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartGradientId + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +For a gradient that respects the coordinates of the object on which it is applied, use `useChartGradientIdObjectBound` instead. + +**useChartGradientId Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientId Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartGradientIdObjectBound + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +This gradient differs from `useChartGradientId` in that it respects the coordinates of the object on which it is applied. + +**useChartGradientIdObjectBound Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientIdObjectBound Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartHighlight + +**useChartHighlight Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartHighlight Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartId + +Get the unique identifier of the chart. + +**useChartId Return Value:** + +chartId if it exists. + +```tsx +type ReturnValue = string | undefined; +``` + +### useChartInteraction + +**useChartInteraction Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartInteraction Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartPolarAxis + +**useChartPolarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartPolarAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartPremiumApiRef + +Hook that instantiates a \[\[ChartPremiumApiRef]]. +The chart type needs to be given as the generic parameter to narrow down the API to the specific chart type. + +**useChartPremiumApiRef Return Value:** + +```tsx +type ReturnValue = React.RefObject< + | ChartPremiumApi< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition', + ChartAnyPluginSignature[] + > + | undefined +>; +``` + +### useChartProApiContext + +The `useChartProApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProviderPro` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartProApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartProApiRef + +Hook that instantiates a \[\[ChartProApiRef]]. +The chart type needs to be given as the generic parameter to narrow down the API to the specific chart type. + +**useChartProApiRef Return Value:** + +```tsx +type ReturnValue = React.RefObject< + | ChartProApi< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition', + ChartAnyPluginSignature[] + > + | undefined +>; +``` + +### useChartProExport + +**useChartProExport Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProExport Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartProZoom + +**useChartProZoom Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProZoom Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartRootRef + +Get the ref for the root chart element. + +**useChartRootRef Return Value:** + +The root chart element ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLayerContainerRef + +Get the ref for the chart surface element. + +**useChartsLayerContainerRef Return Value:** + +The chart surface ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLocalization + +**useChartsLocalization Return Value:** + +```tsx +type ReturnValue = ChartsLocalizationContextValue; +``` + +### useChartTooltip + +**useChartTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartTooltip Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartVisibilityManager + +**useChartVisibilityManager Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------------------ | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartVisibilityManager Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartZAxis + +**useChartZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartZAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useDataset + +Get access to the dataset used to populate series and axes data. + +**useDataset Return Value:** + +The dataset array if provided, otherwise undefined. + +```tsx +type ReturnValue = Readonly[]> | undefined; +``` + +### useDrawingArea + +Get the drawing area dimensions and coordinates. The drawing area is the area where the chart is rendered. + +It includes the left, top, width, height, bottom, and right dimensions. + +**useDrawingArea Return Value:** + +The drawing area dimensions. + +```tsx +type ReturnValue = ChartDrawingArea; +``` + +### useFocusedItem + +Get the focused item from keyboard navigation. + +**useFocusedItem Return Value:** + +```tsx +type ReturnValue = FocusedItemIdentifier | null; +``` + +### useFunnelSeries + +Get access to the internal state of funnel series. + +**useFunnelSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useFunnelSeries Return Value:** + +the funnel series + +```tsx +type ReturnValue = DefaultizedFunnelSeriesType | undefined; +``` + +### useFunnelSeriesContext + +Get access to the internal state of funnel series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useFunnelSeriesContext Return Value:** + +the funnel series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useGaugeState + +**useGaugeState Return Value:** + +```tsx +type ReturnValue = { + value: number | null; + valueMin: number; + valueMax: number; + startAngle: number; + endAngle: number; + innerRadius: number; + outerRadius: number; + cornerRadius: number; + cx: number; + cy: number; + maxRadius: number; + valueAngle: number | null; +}; +``` + +### useHeatmapSeries + +Get access to the internal state of heatmap series. + +**useHeatmapSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useHeatmapSeries Return Value:** + +the heatmap series + +```tsx +type ReturnValue = DefaultizedHeatmapSeriesType | undefined; +``` + +### useHeatmapSeriesContext + +Get access to the internal state of heatmap series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useHeatmapSeriesContext Return Value:** + +the heatmap series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useIsZoomInteracting + +Get access to the zoom state. + +**useIsZoomInteracting Return Value:** + +Inform the zoom is interacting. + +```tsx +type ReturnValue = boolean; +``` + +### useItemHighlightState + +A hook to check the highlighted state of the item. +This function already calculates that an item is not faded if it is highlighted. + +If you need fine control over the state, use the `useItemHighlightStateGetter` hook instead. + +**useItemHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :------ | :------------------- | +| item | `UseItemHighlightedParams<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | is the item to check | + +**useItemHighlightState Return Value:** + +the state of the item + +```tsx +type ReturnValue = HighlightState; +``` + +### useItemHighlightStateGetter + +A hook to get a callback that returns the highlight state of an item. + +If you're interested by a single item, consider using `useItemHighlightState`. + +**useItemHighlightStateGetter Return Value:** + +callback to get the highlight state of an item. + +```tsx +type ReturnValue = ( + item: + | SankeyItemIdentifier + | { type: 'bar'; seriesId: string; dataIndex?: number } + | { type: 'line'; seriesId: string; dataIndex?: number } + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | { type: 'pie'; seriesId: string; dataIndex?: number } + | { type: 'radar'; seriesId: string; dataIndex?: number } + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | { type: 'rangeBar'; seriesId: string; dataIndex?: number } + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | null, +) => HighlightState; +``` + +### useItemTooltip + +Returns a config object when the tooltip contains a single item to display. +Some specific charts like radar need more complex structure. Use specific hook like `useRadarItemTooltip` for them. + +**useItemTooltip Return Value:** + +The tooltip item config + +```tsx +type ReturnValue = UseItemTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'pie' | 'heatmap' | 'funnel' | 'sankey' | 'rangeBar' | 'ohlc' +> | null; +``` + +### useLegend + +Get the legend items to display. + +This hook is used by the `ChartsLegend` component. And will return the legend items formatted for display. + +An alternative is to use the `useSeries` hook and format the legend items yourself. + +**useLegend Return Value:** + +legend data + +| Property | Type | Description | +| :------- | :------------------------- | :---------- | +| items | `SeriesLegendItemParams[]` | - | + +### useLineSeries + +Get access to the internal state of line series. + +**useLineSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useLineSeries Return Value:** + +the line series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + baseline?: number | 'min' | 'max'; + stackOffset?: StackOffsetType; + stack?: string; + stackOrder?: StackOrderType; + area?: boolean; + curve?: CurveType; + strictStepCurve?: boolean; + showMark?: boolean | ((params: ShowMarkParams) => boolean); + shape?: MarkShape; + disableHighlight?: boolean; + connectNulls?: boolean; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useLineSeriesContext + +Get access to the internal state of line series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useLineSeriesContext Return Value:** + +the line series + +```tsx +type ReturnValue = SeriesProcessorResult<'line'> | undefined; +``` + +### useOHLCSeries + +Get access to the internal state of OHLC series. + +**useOHLCSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useOHLCSeries Return Value:** + +the OHLC series + +```tsx +type ReturnValue = DefaultizedOHLCSeriesType | undefined; +``` + +### useOHLCSeriesContext + +Get access to the internal state of OHLC series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useOHLCSeriesContext Return Value:** + +the OHLC series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### usePieSeries + +Get access to the internal state of pie series. + +**usePieSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**usePieSeries Return Value:** + +the pie series + +```tsx +type ReturnValue = DefaultizedPieSeriesType | undefined; +``` + +### usePieSeriesContext + +Get access to the internal state of pie series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**usePieSeriesContext Return Value:** + +the pie series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadarAxis + +Returns an array with one item per metric with the different points to label. + +**useRadarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| params | `UseRadarAxisParams` | - | - | + +**useRadarAxis Return Value:** + +```tsx +type ReturnValue = { + metric: string; + angle: number; + center: { x: number; y: number }; + labels: { x: number; y: number; value: number | Date; formattedValue: string }[]; +} | null; +``` + +### useRadarItemTooltip + +Contains an object per value with their content and the label of the associated metric. + +**useRadarItemTooltip Return Value:** + +The tooltip item configs + +```tsx +type ReturnValue = UseRadarItemTooltipReturnValue | null; +``` + +### useRadarSeries + +Get access to the internal state of radar series. + +**useRadarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useRadarSeries Return Value:** + +the radar series + +```tsx +type ReturnValue = DefaultizedRadarSeriesType | undefined; +``` + +### useRadarSeriesContext + +Get access to the internal state of radar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useRadarSeriesContext Return Value:** + +the radar series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadiusAxes + +Get all the radius axes for polar charts. + +Returns all radial axes configured in polar charts along with their IDs. +Radius axes are used in charts like `RadarChart` to define radial positioning and scaling. + +**useRadiusAxes Return Value:** + +An object containing: + +- `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `radiusAxisIds`: An array of all radius axis IDs in the chart + +| Property | Type | Description | +| :------------ | :--------------------------------------------- | :---------- | +| radiusAxis | `DefaultizedAxisConfig` | - | +| radiusAxisIds | `string[]` | - | + +### useRadiusAxis + +Get a specific radius axis or the default radius axis for polar charts. + +Returns the configuration and scale for a radial axis in polar charts. +The radius axis controls the radial distance of data points from the center of the circle. + +**useRadiusAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's radius axis configurationUndefined to get the default (first) radius axis | + +**useRadiusAxis Return Value:** + +The radius axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRadiusAxisProps + > + | undefined; +``` + +### useRadiusScale + +Get the radius scale. + +**useRadiusScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `radiusAxis` propUndefined to get the default radius axis | + +**useRadiusScale Return Value:** + +The radius axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useRangeBarSeries + +Get access to the internal state of range bar series. + +**useRangeBarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useRangeBarSeries Return Value:** + +the range bar series + +```tsx +type ReturnValue = DefaultizedRangeBarSeriesType | undefined; +``` + +### useRangeBarSeriesContext + +Get access to the internal state of range bar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useRangeBarSeriesContext Return Value:** + +the range bar series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRotationAxes + +Get all the rotation axes for polar charts. + +Returns all rotation axes configured in polar charts along with their IDs. +Rotation axes are used in charts like `RadarChart` to define angular positioning. + +**useRotationAxes Return Value:** + +An object containing: + +- `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `rotationAxisIds`: An array of all rotation axis IDs in the chart + +| Property | Type | Description | +| :-------------- | :----------------------------------------------- | :---------- | +| rotationAxis | `DefaultizedAxisConfig` | - | +| rotationAxisIds | `string[]` | - | + +### useRotationAxis + +Get a specific rotation axis or the default rotation axis for polar charts. + +Returns the configuration and scale for a rotation axis in polar charts. +The rotation axis controls the angular positioning of data points around the circle. + +**useRotationAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's rotation axis configurationUndefined to get the default (first) rotation axis | + +**useRotationAxis Return Value:** + +The rotation axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRotationAxisProps + > + | undefined; +``` + +### useRotationScale + +Get the rotation scale. + +**useRotationScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `rotationAxis` propUndefined to get the default rotation axis | + +**useRotationScale Return Value:** + +The rotation axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useScatterSeries + +Get access to the internal state of scatter series. + +**useScatterSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useScatterSeries Return Value:** + +the scatter series + +```tsx +type ReturnValue = DefaultizedScatterSeriesType | undefined; +``` + +### useScatterSeriesContext + +Get access to the internal state of scatter series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useScatterSeriesContext Return Value:** + +the scatter series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useSeries + +Get access to the internal state of series. +Structured by type of series: +{ seriesType?: { series: { id1: precessedValue, ... }, seriesOrder: \[id1, ...] } } + +**useSeries Return Value:** + +FormattedSeries series + +```tsx +type ReturnValue = ProcessedSeries; +``` + +### useXAxes + +Get all the x-axes. + +Returns all X axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useXAxes Return Value:** + +An object containing: + +- `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `xAxisIds`: An array of all X axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| xAxis | `ComputedAxisConfig` | - | +| xAxisIds | `AxisId[]` | - | + +### useXAxis + +Get a specific X axis or the default X axis. + +**useXAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXAxis Return Value:** + +The configuration for a single X axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsXAxisProps +>; +``` + +### useXAxisCoordinates + +Get the coordinates of the given X axis. The coordinates are relative to the SVG's origin. + +**useXAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisCoordinates Return Value:** + +The coordinates of the X axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useXAxisTicks + +Returns the ticks for the given X axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useXAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useXColorScale + +Get the X axis color scale. + +**useXColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useXColorScale Return Value:** + +The color scale for the specified X axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useXScale + +Get the X scale. + +**useXScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXScale Return Value:** + +The X axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useYAxes + +Get all the y-axes. + +Returns all Y axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useYAxes Return Value:** + +An object containing: + +- `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `yAxisIds`: An array of all Y axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| yAxis | `ComputedAxisConfig` | - | +| yAxisIds | `AxisId[]` | - | + +### useYAxis + +Get a specific Y axis or the default Y axis. + +**useYAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYAxis Return Value:** + +The configuration for a single Y axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsYAxisProps +>; +``` + +### useYAxisCoordinates + +Returns the coordinates of the given Y axis. The coordinates are relative to the SVG's origin. + +**useYAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisCoordinates Return Value:** + +The coordinates of the Y axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useYAxisTicks + +Returns the ticks for the given Y axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useYAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useYColorScale + +Get the Y axis color scale. + +**useYColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useYColorScale Return Value:** + +The color scale for the specified Y axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useYScale + +Get the Y scale. + +**useYScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYScale Return Value:** + +The Y axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useZAxes + +**useZAxes Return Value:** + +| Property | Type | Description | +| :------- | :----------------------- | :---------- | +| zAxis | `DefaultizedZAxisConfig` | - | +| zAxisIds | `AxisId[]` | - | + +### useZAxis + +**useZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :--------- | :----------------- | :------ | :---------- | +| identifier | `number \| string` | - | - | + +**useZAxis Return Value:** + +```tsx +type ReturnValue = ZAxisDefaultized; +``` + +### useZColorScale + +Get the Z axis color scale. + +**useZColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useZColorScale Return Value:** + +The color scale for the specified Z axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### yellowPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +## Additional Types + +### AllSeriesType + +```typescript +type AllSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | MakeOptional[] + | number[] + | FunnelValueType[] + | SankeyData + | (RangeBarValueType | null)[] + | (OHLCValueType | null)[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter> + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null) + | SeriesValueFormatter + | ((value: number | null, context: { dataIndex: number; field: OHLCField }) => string | null); + /** The id of this series. */ + id?: SeriesId; +}; +``` + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AXIS_LABEL_DEFAULT_HEIGHT + +```typescript +type AXIS_LABEL_DEFAULT_HEIGHT = 20; +``` + +### axisClasses + +```typescript +type axisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### AxisConfig + +Use this type for advanced typing. For basic usage, use `XAxis`, `YAxis`, `RotationAxis` or `RadiusAxis`. + +```typescript +type AxisConfig = { offset?: number } & CommonAxisConfig & { min?: NumberValue; max?: NumberValue } | {} & Omit, 'axisId'> & Partial | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig }, 'scale'>> & AxisSideConfig & TickParams & AxisConfigExtension +``` + +### AxisCoordinates + +```typescript +type AxisCoordinates = { left: number; top: number; right: number; bottom: number }; +``` + +### AxisItemIdentifier + +Identifies a data point within an axis. + +```typescript +type AxisItemIdentifier = { + /** The axis id. */ + axisId: AxisId; + /** The data index. */ + dataIndex: number; +}; +``` + +### AxisValueFormatterContext + +```typescript +type AxisValueFormatterContext< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', +> = + | { location: 'legend' } + | { + location: 'tooltip' | 'zoom-slider-tooltip'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + } + | { + location: 'tick'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + defaultTickLabel: string; + tickNumber?: number; + }; +``` + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BAR_CHART_PREMIUM_PLUGINS + +```typescript +type BAR_CHART_PREMIUM_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BAR_CHART_PRO_PLUGINS + +```typescript +type BAR_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartPremiumPluginSignatures + +```typescript +type BarChartPremiumPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartPremiumProps + +````typescript +type BarChartPremiumProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartPremiumSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartPremiumSlotProps; + /** Callback fired when a bar or range bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] or [[RangeBarSeries]] objects. + */ + series: (RangeBarSeriesType | BarSeries)[]; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartPremiumSlotProps + +```typescript +type BarChartPremiumSlotProps = { + bar?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + barLabel?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartPremiumSlots + +```typescript +type BarChartPremiumSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### BarChartProPluginSignatures + +```typescript +type BarChartProPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartProProps + +````typescript +type BarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartProSlotProps + +```typescript +type BarChartProSlotProps = { + bar?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + barLabel?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartProSlots + +```typescript +type BarChartProSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'label' | 'root' | 'series' | 'element' | 'seriesLabels' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + seriesId: string; + dataIndex: number; + color: string; + classes?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarItemIdentifier + +An object that allows to identify a single bar. +Used for item interaction + +```typescript +type BarItemIdentifier = { type: 'bar'; seriesId: string; dataIndex: number }; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +### BarSeriesType + +```typescript +type BarSeriesType = { + type: 'bar'; + /** Data associated to each bar. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize?: number; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### BarValueType + +```typescript +type BarValueType = number; +``` + +### blueberryTwilightPaletteDark + +```typescript +type blueberryTwilightPaletteDark = string[]; +``` + +### blueberryTwilightPaletteLight + +```typescript +type blueberryTwilightPaletteLight = string[]; +``` + +### bluePaletteDark + +```typescript +type bluePaletteDark = string[]; +``` + +### bluePaletteLight + +```typescript +type bluePaletteLight = string[]; +``` + +### CandlestickChartProps + +````typescript +type CandlestickChartProps = { + /** + * The series to display in the candlestick chart. + * An array of [[OHLCSeries]] objects. + * + * Currently, only one OHLC series is supported. If would like to display more than one OHLC + * series, open an issue at https://github.com/mui/mui-x explaining your use case. + */ + series: OHLCSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line', y: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: CandlestickChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: CandlestickChartSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: OHLCItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: OHLCItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { ohlc: ChartSeriesTypeConfig<'ohlc'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'ohlc'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'ohlc'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### CandlestickChartSlotProps + +```typescript +type CandlestickChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### CandlestickChartSlots + +```typescript +type CandlestickChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### CandlestickPlotProps + +```typescript +type CandlestickPlotProps = {}; +``` + +### CartesianChartSeriesType + +```typescript +type CartesianChartSeriesType = + | 'bar' + | 'line' + | 'scatter' + | 'heatmap' + | 'funnel' + | 'rangeBar' + | 'ohlc'; +``` + +### CategoryAxis + +```typescript +type CategoryAxis = { + /** + * The categories to be displayed on the axis. + * The order of the categories is the order in which they are displayed. + */ + categories?: string[]; + /** + * The position of the axis. + * - 'left' - The axis is positioned on the left side of the chart. + * - 'right' - The axis is positioned on the right side of the chart. + * - 'top' - The axis is positioned on the top side of the chart. + * - 'bottom' - The axis is positioned on the bottom side of the chart. + * - 'none' - The axis is not displayed. + */ + position?: 'left' | 'right' | 'top' | 'bottom' | 'none'; + /** + * The size of the axis. + * - If the axis is horizontal, the size is the height of the axis. + * - If the axis is vertical, the size is the width of the axis. + * - If set to `'auto'`, the size is automatically calculated based on tick label measurements. + */ + size?: number | 'auto'; + scaleType?: 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### ChartApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartApi< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'composition' | undefined = undefined, + TSignatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### chartAxisZoomSliderThumbClasses + +```typescript +type chartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClasses + +```typescript +type ChartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClassKey + +```typescript +type ChartAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartAxisZoomSliderTrackClasses + +```typescript +type chartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClasses + +```typescript +type ChartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClassKey + +```typescript +type ChartAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartBaseButtonProps + +```typescript +type ChartBaseButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; +``` + +### ChartBaseCommonProps + +```typescript +type ChartBaseCommonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +}; +``` + +### ChartBaseIconButtonProps + +```typescript +type ChartBaseIconButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; +}; +``` + +### ChartBaseIconProps + +```typescript +type ChartBaseIconProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +``` + +### ChartDrawingArea + +```typescript +type ChartDrawingArea = { + /** The gap between the left border of the SVG and the drawing area. */ + left: number; + /** The gap between the top border of the SVG and the drawing area. */ + top: number; + /** The gap between the bottom border of the SVG and the drawing area. */ + bottom: number; + /** The gap between the right border of the SVG and the drawing area. */ + right: number; + /** The width of the drawing area. */ + width: number; + /** The height of the drawing area. */ + height: number; +}; +``` + +### ChartPremiumApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartPremiumApi< + ChartType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition' + | undefined = undefined, + Signatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### ChartProApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartProApi< + ChartType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition' + | undefined = undefined, + Signatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### ChartsAxisClasses + +```typescript +type ChartsAxisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### ChartsAxisClassKey + +```typescript +type ChartsAxisClassKey = + | 'line' + | 'label' + | 'tick' + | 'bottom' + | 'left' + | 'right' + | 'top' + | 'root' + | 'tickContainer' + | 'tickLabel' + | 'directionX' + | 'directionY'; +``` + +### ChartsAxisData + +The data format returned by onAxisClick. + +```typescript +type ChartsAxisData = { + /** The index in the axis' data property. */ + dataIndex: number; + /** Tha value associated to the axis item. */ + axisValue: number | Date | string; + /** The mapping of series ids to their value for this particular axis index. */ + seriesValues: Record; +}; +``` + +### chartsAxisHighlightClasses + +```typescript +type chartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClasses + +```typescript +type ChartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClassKey + +```typescript +type ChartsAxisHighlightClassKey = 'root'; +``` + +### ChartsAxisHighlightPath + +```typescript +type ChartsAxisHighlightPath = StyledComponent< + MUIStyledCommonProps & { ownerState: { axisHighlight: ChartsAxisHighlightType } }, + Pick< + React.SVGProps, + | 'string' + | 'id' + | 'min' + | 'max' + | 'type' + | 'color' + | 'scale' + | 'className' + | 'offset' + | 'end' + | 'height' + | 'x' + | 'style' + | 'width' + | 'ref' + | 'dominantBaseline' + | 'suppressHydrationWarning' + | 'lang' + | 'media' + | 'method' + | 'name' + | 'nonce' + | 'part' + | 'slot' + | 'target' + | 'role' + | 'tabIndex' + | 'crossOrigin' + | 'accentHeight' + | 'accumulate' + | 'additive' + | 'alignmentBaseline' + | 'allowReorder' + | 'alphabetic' + | 'amplitude' + | 'arabicForm' + | 'ascent' + | 'attributeName' + | 'attributeType' + | 'autoReverse' + | 'azimuth' + | 'baseFrequency' + | 'baselineShift' + | 'baseProfile' + | 'bbox' + | 'begin' + | 'bias' + | 'by' + | 'calcMode' + | 'capHeight' + | 'clip' + | 'clipPath' + | 'clipPathUnits' + | 'clipRule' + | 'colorInterpolation' + | 'colorInterpolationFilters' + | 'colorProfile' + | 'colorRendering' + | 'contentScriptType' + | 'contentStyleType' + | 'cursor' + | 'cx' + | 'cy' + | 'd' + | 'decelerate' + | 'descent' + | 'diffuseConstant' + | 'direction' + | 'display' + | 'divisor' + | 'dur' + | 'dx' + | 'dy' + | 'edgeMode' + | 'elevation' + | 'enableBackground' + | 'exponent' + | 'externalResourcesRequired' + | 'fill' + | 'fillOpacity' + | 'fillRule' + | 'filter' + | 'filterRes' + | 'filterUnits' + | 'floodColor' + | 'floodOpacity' + | 'focusable' + | 'fontFamily' + | 'fontSize' + | 'fontSizeAdjust' + | 'fontStretch' + | 'fontStyle' + | 'fontVariant' + | 'fontWeight' + | 'format' + | 'fr' + | 'from' + | 'fx' + | 'fy' + | 'g1' + | 'g2' + | 'glyphName' + | 'glyphOrientationHorizontal' + | 'glyphOrientationVertical' + | 'glyphRef' + | 'gradientTransform' + | 'gradientUnits' + | 'hanging' + | 'horizAdvX' + | 'horizOriginX' + | 'href' + | 'ideographic' + | 'imageRendering' + | 'in2' + | 'in' + | 'intercept' + | 'k1' + | 'k2' + | 'k3' + | 'k4' + | 'k' + | 'kernelMatrix' + | 'kernelUnitLength' + | 'kerning' + | 'keyPoints' + | 'keySplines' + | 'keyTimes' + | 'lengthAdjust' + | 'letterSpacing' + | 'lightingColor' + | 'limitingConeAngle' + | 'local' + | 'markerEnd' + | 'markerHeight' + | 'markerMid' + | 'markerStart' + | 'markerUnits' + | 'markerWidth' + | 'mask' + | 'maskContentUnits' + | 'maskUnits' + | 'mathematical' + | 'mode' + | 'numOctaves' + | 'opacity' + | 'operator' + | 'order' + | 'orient' + | 'orientation' + | 'origin' + | 'overflow' + | 'overlinePosition' + | 'overlineThickness' + | 'paintOrder' + | 'panose1' + | 'path' + | 'pathLength' + | 'patternContentUnits' + | 'patternTransform' + | 'patternUnits' + | 'pointerEvents' + | 'points' + | 'pointsAtX' + | 'pointsAtY' + | 'pointsAtZ' + | 'preserveAlpha' + | 'preserveAspectRatio' + | 'primitiveUnits' + | 'r' + | 'radius' + | 'refX' + | 'refY' + | 'renderingIntent' + | 'repeatCount' + | 'repeatDur' + | 'requiredExtensions' + | 'requiredFeatures' + | 'restart' + | 'result' + | 'rotate' + | 'rx' + | 'ry' + | 'seed' + | 'shapeRendering' + | 'slope' + | 'spacing' + | 'specularConstant' + | 'specularExponent' + | 'speed' + | 'spreadMethod' + | 'startOffset' + | 'stdDeviation' + | 'stemh' + | 'stemv' + | 'stitchTiles' + | 'stopColor' + | 'stopOpacity' + | 'strikethroughPosition' + | 'strikethroughThickness' + | 'stroke' + | 'strokeDasharray' + | 'strokeDashoffset' + | 'strokeLinecap' + | 'strokeLinejoin' + | 'strokeMiterlimit' + | 'strokeOpacity' + | 'strokeWidth' + | 'surfaceScale' + | 'systemLanguage' + | 'tableValues' + | 'targetX' + | 'targetY' + | 'textAnchor' + | 'textDecoration' + | 'textLength' + | 'textRendering' + | 'to' + | 'transform' + | 'u1' + | 'u2' + | 'underlinePosition' + | 'underlineThickness' + | 'unicode' + | 'unicodeBidi' + | 'unicodeRange' + | 'unitsPerEm' + | 'vAlphabetic' + | 'values' + | 'vectorEffect' + | 'version' + | 'vertAdvY' + | 'vertOriginX' + | 'vertOriginY' + | 'vHanging' + | 'vIdeographic' + | 'viewBox' + | 'viewTarget' + | 'visibility' + | 'vMathematical' + | 'widths' + | 'wordSpacing' + | 'writingMode' + | 'x1' + | 'x2' + | 'xChannelSelector' + | 'xHeight' + | 'xlinkActuate' + | 'xlinkArcrole' + | 'xlinkHref' + | 'xlinkRole' + | 'xlinkShow' + | 'xlinkTitle' + | 'xlinkType' + | 'xmlBase' + | 'xmlLang' + | 'xmlns' + | 'xmlnsXlink' + | 'xmlSpace' + | 'y1' + | 'y2' + | 'y' + | 'yChannelSelector' + | 'z' + | 'zoomAndPan' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + >, + {} +>; +``` + +### ChartsAxisHighlightProps + +```typescript +type ChartsAxisHighlightProps = { x?: ChartsAxisHighlightType; y?: ChartsAxisHighlightType }; +``` + +### ChartsAxisHighlightType + +```typescript +type ChartsAxisHighlightType = 'none' | 'line' | 'band'; +``` + +### ChartsAxisProps + +```typescript +type ChartsAxisProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsAxisSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsAxisSlotProps; +}; +``` + +### ChartsAxisSlotProps + +```typescript +type ChartsAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsAxisSlots + +```typescript +type ChartsAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsAxisTooltipContentClasses + +```typescript +type ChartsAxisTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsAxisTooltipContentProps + +```typescript +type ChartsAxisTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; + /** + * The sort in which series items are displayed in the tooltip. + * When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### chartsAxisZoomSliderThumbClasses + +```typescript +type chartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClasses + +```typescript +type ChartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClassKey + +```typescript +type ChartsAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartsAxisZoomSliderTrackClasses + +```typescript +type chartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClasses + +```typescript +type ChartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClassKey + +```typescript +type ChartsAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartsBaseSlots + +```typescript +type ChartsBaseSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### ChartsClipPathProps + +```typescript +type ChartsClipPathProps = { + /** The id of the clip path. */ + id: string; + /** + * Offset, in pixels, of the clip path rectangle from the drawing area. + * + * A positive value will move the rectangle outside the drawing area. + */ + offset?: { top?: number; right?: number; bottom?: number; left?: number }; +}; +``` + +### ChartsColor + +```typescript +type ChartsColor = string | ChartsColorCallback; +``` + +### ChartsColorPalette + +```typescript +type ChartsColorPalette = string[] | ChartsColorPaletteCallback; +``` + +### ChartsContainerPremiumProps + +```typescript +type ChartsContainerPremiumProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsContainerPremiumSlotProps + +```typescript +type ChartsContainerPremiumSlotProps = {}; +``` + +### ChartsContainerPremiumSlots + +```typescript +type ChartsContainerPremiumSlots = {}; +``` + +### ChartsContainerProProps + +```typescript +type ChartsContainerProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsDataProviderPremiumProps + +```typescript +type ChartsDataProviderPremiumProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderPremiumSlotProps + +```typescript +type ChartsDataProviderPremiumSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderPremiumSlots + +```typescript +type ChartsDataProviderPremiumSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### ChartsDataProviderProProps + +```typescript +type ChartsDataProviderProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProps + +```typescript +type ChartsDataProviderProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartClosestPointSignature, + UseChartKeyboardNavigationSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProSlotProps + +```typescript +type ChartsDataProviderProSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderProSlots + +```typescript +type ChartsDataProviderProSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### ChartsDataProviderSlotProps + +```typescript +type ChartsDataProviderSlotProps = { + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ChartsDataProviderSlots + +```typescript +type ChartsDataProviderSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### chartsGridClasses + +```typescript +type chartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClasses + +```typescript +type ChartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClassKey + +```typescript +type ChartsGridClassKey = 'line' | 'root' | 'horizontalLine' | 'verticalLine'; +``` + +### ChartsGridProps + +```typescript +type ChartsGridProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Displays vertical grid. */ + vertical?: boolean; + /** Displays horizontal grid. */ + horizontal?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### ChartsIconSlots + +```typescript +type ChartsIconSlots = {}; +``` + +### ChartsItemTooltipContentClasses + +```typescript +type ChartsItemTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsItemTooltipContentProps + +```typescript +type ChartsItemTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; +}; +``` + +### ChartsLabel + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabel = unknown; +``` + +### ChartsLabelClasses + +```typescript +type ChartsLabelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsLabelCustomMarkProps + +```typescript +type ChartsLabelCustomMarkProps = { + className?: string; + /** Color of the series this mark refers to. */ + color?: string; +}; +``` + +### ChartsLabelGradientClasses + +```typescript +type ChartsLabelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### ChartsLabelMark + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabelMark = unknown; +``` + +### ChartsLabelMarkClasses + +```typescript +type ChartsLabelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### ChartsLabelMarkProps + +```typescript +type ChartsLabelMarkProps = { + /** + * The type of the mark. + * @default 'square' + */ + type?: ChartsLabelMarkType; + /** + * The mark will be rendered as a combination of a line and the specified mark type. + * The line will be rendered first, followed by the mark. + * Only used if `type='line+mark'`. + */ + markShape?: MarkShape; + /** The color of the mark. */ + color?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLabelProps + +```typescript +type ChartsLabelProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLegendClasses + +```typescript +type ChartsLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### ChartsLegendPosition + +```typescript +type ChartsLegendPosition = { + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; +}; +``` + +### ChartsLegendProps + +```typescript +type ChartsLegendProps = { + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * If `true`, clicking on a legend item will toggle the visibility of the corresponding series. + * @default false + */ + toggleVisibilityOnClick?: boolean; + className?: string; + sx?: SxProps; + tabIndex?: number; +}; +``` + +### ChartsLegendSlotExtension + +```typescript +type ChartsLegendSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsLegendSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsLegendSlotProps; +}; +``` + +### ChartsLegendSlotProps + +```typescript +type ChartsLegendSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; +}; +``` + +### ChartsLegendSlots + +```typescript +type ChartsLegendSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; +}; +``` + +### ChartsLocalizationProviderProps + +```typescript +type ChartsLocalizationProviderProps = { + children?: React.ReactNode; + /** Localized text for chart components. */ + localeText?: Partial; +}; +``` + +### ChartsPieSorting + +```typescript +type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number); +``` + +### ChartsReferenceLineClasses + +```typescript +type ChartsReferenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### ChartsReferenceLineClassKey + +```typescript +type ChartsReferenceLineClassKey = 'line' | 'label' | 'root' | 'horizontal' | 'vertical'; +``` + +### ChartsReferenceLineProps + +```typescript +type ChartsReferenceLineProps = ( + | { x?: undefined; y: string | number | Date } + | { y?: undefined; x: string | number | Date } +) & { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### ChartsRendererProps + +```typescript +type ChartsRendererProps = { + dimensions: { id: string; label: string; data: (string | number | Date | null)[] }[]; + values: { id: string; label: string; data: (number | null)[] }[]; + chartType: string; + configuration: Record; + onRender?: ( + type: string, + props: Record, + Component: React.ComponentType, + ) => React.ReactNode; +}; +``` + +### chartsSurfaceClasses + +```typescript +type chartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceClasses + +```typescript +type ChartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceProps + +```typescript +type ChartsSurfaceProps = { + className?: string; + sx?: SxProps; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; +}; +``` + +### ChartsTextProps + +```typescript +type ChartsTextProps = { + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** Text displayed. */ + text: string; + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### ChartsTextStyle + +```typescript +type ChartsTextStyle = { + angle?: number; + /** + * The text baseline + * @default 'central' + */ + dominantBaseline?: ChartsTextBaseline; + /** + * The text anchor + * @default 'middle' + */ + textAnchor?: ChartsTextAnchor; +}; +``` + +### ChartsToolbarImageExportOptions + +```typescript +type ChartsToolbarImageExportOptions = { + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; + /** + * The quality of the image to be exported between 0 and 1. This is only applicable for lossy formats, such as + * 'image/jpeg' and 'image/webp'. 'image/png' does not support this option. + * @default 0.9 + */ + quality?: number; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * The format of the image to be exported. + * Browsers are required to support 'image/png'. Some browsers also support 'image/jpeg' and 'image/webp'. + * If the provided `type` is not supported by the browser, it will default to 'image/png'. + * @default 'image/png' + */ + type: string; +}; +``` + +### ChartsToolbarImageExportTriggerProps + +```typescript +type ChartsToolbarImageExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartsToolbarImageExportOptions; +}; +``` + +### ChartsToolbarPrintExportOptions + +```typescript +type ChartsToolbarPrintExportOptions = { + /** + * If `true`, this export option will be removed from the ChartsToolbarExport menu. + * @default false + */ + disableToolbarButton?: boolean; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartsToolbarPrintExportTriggerProps + +```typescript +type ChartsToolbarPrintExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartPrintExportOptions; +}; +``` + +### ChartsToolbarProProps + +```typescript +type ChartsToolbarProProps = { + printOptions?: ChartsToolbarPrintExportOptions; + imageExportOptions?: ChartsToolbarImageExportOptions[]; +}; +``` + +### ChartsToolbarProSlotProps + +```typescript +type ChartsToolbarProSlotProps = { + /** Props for the toolbar component. */ + toolbar?: Partial; +}; +``` + +### ChartsToolbarProSlots + +```typescript +type ChartsToolbarProSlots = { + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipCell + +```typescript +type ChartsTooltipCell = StyledComponent< + Pick< + TypographyOwnProps & + CommonProps & + Omit< + React.DetailedHTMLProps, HTMLSpanElement>, + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'children' + | 'variant' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + >, + | 'id' + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'ref' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + | 'content' + | 'translate' + | 'hidden' + | 'variant' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + > & + MUIStyledCommonProps & { component?: React.ElementType }, + {}, + {} +>; +``` + +### chartsTooltipClasses + +```typescript +type chartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClasses + +```typescript +type ChartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClassKey + +```typescript +type ChartsTooltipClassKey = 'root' | 'paper' | 'table' | 'row' | 'cell' | 'mark' | 'axisValueCell'; +``` + +### ChartsTooltipContainerClasses + +```typescript +type ChartsTooltipContainerClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipContainerProps + +```typescript +type ChartsTooltipContainerProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + children?: React.ReactNode; +}; +``` + +### ChartsTooltipContainerSlotProps + +```typescript +type ChartsTooltipContainerSlotProps = {}; +``` + +### ChartsTooltipContainerSlots + +```typescript +type ChartsTooltipContainerSlots = {}; +``` + +### ChartsTooltipPaper + +```typescript +type ChartsTooltipPaper = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLDivElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipProps + +```typescript +type ChartsTooltipProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'axis' | 'none' | 'item'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * Defines the sort order in which series items are displayed in the axis tooltip. + * When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. + * Only applies when `trigger='axis'`. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### ChartsTooltipRow + +```typescript +type ChartsTooltipRow = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableRowElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipSlotProps + +```typescript +type ChartsTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial>; +}; +``` + +### ChartsTooltipSlots + +```typescript +type ChartsTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ChartsTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipTable + +```typescript +type ChartsTooltipTable = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'width' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'border' + | 'bgcolor' + | 'hidden' + | 'title' + | 'summary' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'cellPadding' + | 'cellSpacing' + | 'frame' + | 'rules' + >, + {} +>; +``` + +### ChartsTypeFeatureFlags + +```typescript +type ChartsTypeFeatureFlags = {}; +``` + +### ChartsXAxisProps + +```typescript +type ChartsXAxisProps = { + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsXAxisSlotProps + +```typescript +type ChartsXAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsXAxisSlots + +```typescript +type ChartsXAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsXReferenceLineProps + +```typescript +type ChartsXReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The x value associated with the reference line. + * If defined the reference line will be vertical. + */ + x: TValue; +}; +``` + +### ChartsYAxisProps + +```typescript +type ChartsYAxisProps = { + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsYAxisSlotProps + +```typescript +type ChartsYAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsYAxisSlots + +```typescript +type ChartsYAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsYReferenceLineProps + +```typescript +type ChartsYReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The y value associated with the reference line. + * If defined the reference line will be horizontal. + */ + y: TValue; +}; +``` + +### cheerfulFiestaPaletteDark + +```typescript +type cheerfulFiestaPaletteDark = string[]; +``` + +### cheerfulFiestaPaletteLight + +```typescript +type cheerfulFiestaPaletteLight = string[]; +``` + +### ColorLegendSelector + +```typescript +type ColorLegendSelector = { + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### ComputedPieRadius + +Props received when the parent components has done the percentage conversion. + +```typescript +type ComputedPieRadius = { + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### configurationOptions + +```typescript +type configurationOptions = { + [key: string]: { + label: string; + icon: (props: any) => React.ReactNode; + customization: GridChartsConfigurationSection[]; + dimensionsLabel?: string; + valuesLabel?: string; + maxDimensions?: number; + maxValues?: number; + }; +}; +``` + +### continuousColorLegendClasses + +```typescript +type continuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendClasses + +```typescript +type ContinuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendProps + +```typescript +type ContinuousColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * The label to display at the minimum side of the gradient. + * Can either be a string, or a function. + * @default formattedValue + */ + minLabel?: string | LabelFormatter; + /** + * The label to display at the maximum side of the gradient. + * Can either be a string, or a function. + * If not defined, the formatted maximal value is display. + * @default formattedValue + */ + maxLabel?: string | LabelFormatter; + /** + * The id for the gradient to use. + * If not provided, it will use the generated gradient from the axis configuration. + * The `gradientId` will be used as `fill="url(#gradientId)"`. + * @default auto-generated id + */ + gradientId?: string; + /** + * Where to position the labels relative to the gradient. + * @default 'end' + */ + labelPosition?: 'start' | 'end' | 'extremes'; + /** + * If `true`, the gradient and labels will be reversed. + * @default false + */ + reverse?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; + /** + * The thickness of the gradient + * @default 12 + */ + thickness?: number; +}; +``` + +### ContinuousScaleName + +```typescript +type ContinuousScaleName = 'linear' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc'; +``` + +### CurveType + +The type of curve to use for the line. +Read more about curves at +[line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + +```typescript +type CurveType = + | 'catmullRom' + | 'linear' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepBefore' + | 'stepAfter' + | 'bumpY' + | 'bumpX'; +``` + +### cyanPaletteDark + +```typescript +type cyanPaletteDark = string[]; +``` + +### cyanPaletteLight + +```typescript +type cyanPaletteLight = string[]; +``` + +### DEFAULT_AXIS_SIZE_HEIGHT + +```typescript +type DEFAULT_AXIS_SIZE_HEIGHT = 25; +``` + +### DEFAULT_AXIS_SIZE_WIDTH + +```typescript +type DEFAULT_AXIS_SIZE_WIDTH = 45; +``` + +### DEFAULT_MARGINS + +```typescript +type DEFAULT_MARGINS = { top: number; bottom: number; left: number; right: number }; +``` + +### DEFAULT_RADIUS_AXIS_KEY + +```typescript +type DEFAULT_RADIUS_AXIS_KEY = 'DEFAULT_RADIUS_AXIS_KEY'; +``` + +### DEFAULT_ROTATION_AXIS_KEY + +```typescript +type DEFAULT_ROTATION_AXIS_KEY = 'DEFAULT_ROTATION_AXIS_KEY'; +``` + +### DEFAULT_X_AXIS_KEY + +```typescript +type DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY'; +``` + +### DEFAULT_Y_AXIS_KEY + +```typescript +type DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY'; +``` + +### DefaultizedBarSeriesType + +```typescript +type DefaultizedBarSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; +}; +``` + +### DefaultizedFunnelSeriesType + +```typescript +type DefaultizedFunnelSeriesType = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### DefaultizedHeatmapSeriesType + +```typescript +type DefaultizedHeatmapSeriesType = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### DefaultizedLineSeriesType + +```typescript +type DefaultizedLineSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedOHLCSeriesType + +```typescript +type DefaultizedOHLCSeriesType = { + hidden: boolean; + /** The color of the candle body when the close price is greater than or equal to the open price. */ + upColor: string; + /** The color of the candle body when the close price is less than the open price. */ + downColor: string; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + type: 'ohlc'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** The id of this series. */ + id: string; + /** The OHLC data points. */ + data: (OHLCValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedPieSeriesType + +```typescript +type DefaultizedPieSeriesType = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### DefaultizedPieValueType + +```typescript +type DefaultizedPieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; + color: string; + formattedValue: string; + hidden: boolean; +}; +``` + +### DefaultizedRadarSeriesType + +```typescript +type DefaultizedRadarSeriesType = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedRangeBarSeriesType + +```typescript +type DefaultizedRangeBarSeriesType = { + hidden: boolean; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + type: 'rangeBar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The id of this series. */ + id: string; + /** Data associated to each range bar. */ + data: (RangeBarValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; +}; +``` + +### DefaultizedScatterSeriesType + +```typescript +type DefaultizedScatterSeriesType = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### DefaultizedSeriesType + +```typescript +type DefaultizedSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: CommonHighlightScope | SankeyHighlightScope; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | number[] + | (RangeBarValueType | null)[] + | (OHLCValueType | null)[] + | DefaultizedPieValueType[] + | MakeRequired[] + | SankeyLayout; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null) + | SeriesValueFormatter + | ((value: number | null, context: { dataIndex: number; field: OHLCField }) => string | null) + | SeriesValueFormatter; +}; +``` + +### defaultSeriesConfigPremium + +```typescript +type defaultSeriesConfigPremium = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + rangeBar: ChartSeriesTypeConfig<'rangeBar'>; + ohlc: ChartSeriesTypeConfig<'ohlc'>; +}; +``` + +### defaultSeriesConfigPro + +```typescript +type defaultSeriesConfigPro = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; +}; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### FadeOptions + +```typescript +type FadeOptions = 'none' | 'series' | 'global'; +``` + +### FocusedItemIdentifier + +```typescript +type FocusedItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### FUNNEL_CHART_PLUGINS + +```typescript +type FUNNEL_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### FunnelChartPluginSignatures + +```typescript +type FunnelChartPluginSignatures = FunnelChartPluginSignatures; +``` + +### FunnelChartProps + +````typescript +type FunnelChartProps = { + /** + * The series to display in the funnel chart. + * An array of [[FunnelSeries]] objects. + */ + series: FunnelSeries[]; + /** + * The configuration of the category axis. + * @default { position: 'none' } + */ + categoryAxis?: CategoryAxis; + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: FunnelItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: FunnelItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The gap, in pixels, between funnel sections. + * @default 0 + */ + gap?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { funnel: ChartSeriesTypeConfig<'funnel'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all funnel elements at the current position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'funnel'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'funnel'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +```` + +### FunnelChartSlotExtension + +```typescript +type FunnelChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +``` + +### FunnelChartSlotProps + +```typescript +type FunnelChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### FunnelChartSlots + +```typescript +type FunnelChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### funnelClasses + +```typescript +type funnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClasses + +```typescript +type FunnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClassKey + +```typescript +type FunnelClassKey = 'root' | 'section' | 'sectionLabel' | 'sectionFilled' | 'sectionOutlined'; +``` + +### FunnelCurveType + +```typescript +type FunnelCurveType = 'linear' | 'linear-sharp' | 'step' | 'bump' | 'pyramid' | 'step-pyramid'; +``` + +### FunnelDataPoints + +```typescript +type FunnelDataPoints = Record<'x' | 'y', number> & { useBandWidth: boolean; stackOffset: number }; +``` + +### FunnelItem + +```typescript +type FunnelItem = { + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number; +}; +``` + +### FunnelItemId + +```typescript +type FunnelItemId = string | number; +``` + +### FunnelItemIdentifier + +An object that allows to identify a funnel item. +Used for item interaction + +```typescript +type FunnelItemIdentifier = { + type: 'funnel'; + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; +}; +``` + +### FunnelLabelOptions + +```typescript +type FunnelLabelOptions = { + /** + * The position of the label. + * @default { vertical: 'middle', horizontal: 'center' } + */ + position?: Position; + /** + * The text anchor of the label. Affects the horizontal alignment of the text. + * + * Default value depends on the position. + */ + textAnchor?: 'start' | 'middle' | 'end'; + /** + * The dominant baseline of the label. Affects the vertical alignment of the text. + * + * Default value depends on the position. + */ + dominantBaseline?: + | 'auto' + | 'baseline' + | 'hanging' + | 'middle' + | 'central' + | 'text-after-edge' + | 'text-before-edge'; + /** + * The offset of the label from the anchor point. + * If a single number is provided, the offset will be applied in both directions. + * @default 0 + */ + offset?: number | { x?: number; y?: number }; +}; +``` + +### FunnelPlotProps + +```typescript +type FunnelPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotExtension + +```typescript +type FunnelPlotSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotProps + +```typescript +type FunnelPlotSlotProps = { + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; +}; +``` + +### FunnelPlotSlots + +```typescript +type FunnelPlotSlots = { + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### FunnelScaleName + +```typescript +type FunnelScaleName = Exclude< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + 'point' +>; +``` + +### FunnelSection + +```typescript +type FunnelSection = unknown; +``` + +### FunnelSectionLabel + +```typescript +type FunnelSectionLabel = unknown; +``` + +### FunnelSeries + +```typescript +type FunnelSeries = { + /** The id of this series. */ + id?: SeriesId; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + type?: 'funnel'; +}; +``` + +### FunnelSeriesType + +```typescript +type FunnelSeriesType = { + type: 'funnel'; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### FunnelValueType + +```typescript +type FunnelValueType = { + /** A unique identifier of the funnel section. */ + id?: FunnelItemId; + /** The value of the funnel section. */ + value: number; + /** The label to display on the tooltip, funnel section, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'section') => string | undefined); + /** The color of the funnel section */ + color?: string; + /** + * Defines the mark type for the funnel item. + * @default 'square' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### gaugeClasses + +```typescript +type gaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClasses + +```typescript +type GaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClassKey + +```typescript +type GaugeClassKey = 'root' | 'valueArc' | 'referenceArc' | 'valueText'; +``` + +### GaugeContainerProps + +```typescript +type GaugeContainerProps = { + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; +}; +``` + +### GaugeFormatterParams + +```typescript +type GaugeFormatterParams = { value: number | null; valueMin: number; valueMax: number }; +``` + +### GaugeProps + +```typescript +type GaugeProps = { + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; + text?: string | ((params: GaugeFormatterParams) => string | null); +}; +``` + +### GaugeValueTextProps + +```typescript +type GaugeValueTextProps = { + text?: string | ((params: GaugeFormatterParams) => string | null); + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### greenPaletteDark + +```typescript +type greenPaletteDark = string[]; +``` + +### greenPaletteLight + +```typescript +type greenPaletteLight = string[]; +``` + +### GridChartsConfigurationOptions + +```typescript +type GridChartsConfigurationOptions = { + [key: string]: { + label: string; + icon: (props: any) => React.ReactNode; + customization: GridChartsConfigurationSection[]; + dimensionsLabel?: string; + valuesLabel?: string; + maxDimensions?: number; + maxValues?: number; + }; +}; +``` + +### GridChartsConfigurationSection + +```typescript +type GridChartsConfigurationSection = { + id: string; + label: string; + controls: { [key: string]: GridChartsConfigurationControl }; +}; +``` + +### HEATMAP_PLUGINS + +```typescript +type HEATMAP_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### HeatmapCellOwnerState + +```typescript +type HeatmapCellOwnerState = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + value: number; +}; +``` + +### HeatmapCellProps + +```typescript +type HeatmapCellProps = { + x: number; + y: number; + width: number; + height: number; + ownerState: HeatmapCellOwnerState; +}; +``` + +### heatmapClasses + +```typescript +type heatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClasses + +```typescript +type HeatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClassKey + +```typescript +type HeatmapClassKey = 'root' | 'series' | 'highlighted' | 'faded' | 'cell'; +``` + +### HeatmapItemIdentifier + +An object that allows to identify a single cell. +Used for item interaction + +```typescript +type HeatmapItemIdentifier = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; +}; +``` + +### HeatmapItemIdentifierWithData + +The cell identifier with the associated data value. + +```typescript +type HeatmapItemIdentifierWithData = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; + /** The value of the cell. Null if there is no data associated. */ + value: number | null; +}; +``` + +### HeatmapPlotProps + +```typescript +type HeatmapPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapPlotSlotProps; +}; +``` + +### HeatmapPlotSlotProps + +```typescript +type HeatmapPlotSlotProps = { cell?: Partial }; +``` + +### HeatmapPlotSlots + +```typescript +type HeatmapPlotSlots = { + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; +}; +``` + +### HeatmapPluginSignatures + +```typescript +type HeatmapPluginSignatures = HeatmapPluginSignatures; +``` + +### HeatmapPremiumProps + +```typescript +type HeatmapPremiumProps = { + /** + * The type of renderer to use for the heatmap plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `webgl`: Renders heatmap cells using WebGL for better performance, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/heatmap/#performance + */ + renderer?: 'svg-single' | 'webgl'; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The series to display in the bar chart. + * An array of [[HeatmapSeries]] objects. + */ + series: HeatmapSeries[]; + /** + * The configuration of the tooltip. + * @see + */ + tooltip?: ChartsTooltipProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: HeatmapItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: HeatmapItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** The callback fired when an item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + item: SeriesItemIdentifierWithType< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + ) => void; + apiRef?: React.RefObject | undefined>; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +``` + +### HeatmapPremiumSlotProps + +```typescript +type HeatmapPremiumSlotProps = { + tooltip?: Partial; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + cell?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### HeatmapPremiumSlots + +```typescript +type HeatmapPremiumSlots = { + /** + * Custom component for the tooltip. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the legend. + * @default ContinuousColorLegendProps + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### HeatmapProps + +```typescript +type HeatmapProps = { + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The series to display in the bar chart. + * An array of [[HeatmapSeries]] objects. + */ + series: HeatmapSeries[]; + /** + * The configuration of the tooltip. + * @see + */ + tooltip?: ChartsTooltipProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: HeatmapItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: HeatmapItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** The callback fired when an item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + item: SeriesItemIdentifierWithType< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + ) => void; + apiRef?: React.RefObject | undefined>; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +``` + +### HeatmapSeries + +```typescript +type HeatmapSeries = { + /** The id of this series. */ + id?: SeriesId; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + type?: 'heatmap'; +}; +``` + +### HeatmapSeriesType + +```typescript +type HeatmapSeriesType = { + type: 'heatmap'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The id of this series. */ + id?: SeriesId; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### HeatmapSlotProps + +```typescript +type HeatmapSlotProps = { + tooltip?: Partial; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + cell?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### HeatmapSlots + +```typescript +type HeatmapSlots = { + /** + * Custom component for the tooltip. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the legend. + * @default ContinuousColorLegendProps + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### HeatmapTooltipClasses + +```typescript +type HeatmapTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentClasses + +```typescript +type HeatmapTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentProps + +```typescript +type HeatmapTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### HeatmapTooltipProps + +```typescript +type HeatmapTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer'; +}; +``` + +### HeatmapTooltipSlotProps + +```typescript +type HeatmapTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial; +}; +``` + +### HeatmapTooltipSlots + +```typescript +type HeatmapTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### HeatmapValueType + +```typescript +type HeatmapValueType = HeatmapValueType; +``` + +### HighlightItemIdentifier + +Identifies an highlighted item or series. + +```typescript +type HighlightItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightItemIdentifierWithType + +```typescript +type HighlightItemIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightOptions + +```typescript +type HighlightOptions = 'none' | 'item' | 'series'; +``` + +### HighlightScope + +```typescript +type HighlightScope = CommonHighlightScope | SankeyHighlightScope; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` + +### ItemTooltip + +```typescript +type ItemTooltip< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | RangeBarValueType + | OHLCValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### labelClasses + +```typescript +type labelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### labelGradientClasses + +```typescript +type labelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### labelMarkClasses + +```typescript +type labelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### legendClasses + +```typescript +type legendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### LegendItemContext + +```typescript +type LegendItemContext = SeriesLegendItemContext | PiecewiseColorLegendItemContext; +``` + +### LegendItemParams + +```typescript +type LegendItemParams = { + /** The type of the series */ + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + markType: ChartsLabelMarkType | undefined; + /** The identifier of the series */ + seriesId?: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The minimum value of the category */ + minValue?: number | Date | null; + /** The maximum value of the category */ + maxValue?: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LINE_CHART_PRO_PLUGINS + +```typescript +type LINE_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProPluginSignatures + +```typescript +type LineChartProPluginSignatures = LineChartProPluginSignatures; +``` + +### LineChartProProps + +````typescript +type LineChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartProSlotProps + +```typescript +type LineChartProSlotProps = { + line?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + area?: SlotComponentPropsFromProps; + mark?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + lineHighlight?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### LineChartProSlots + +```typescript +type LineChartProSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'line' + | 'area' + | 'mark' + | 'highlight' + | 'markAnimate' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LineItemIdentifier + +An object that allows to identify a single line. +Used for item interaction + +```typescript +type LineItemIdentifier = { + type: 'line'; + seriesId: string; + /** `dataIndex` can be `undefined` if the mouse is over the area and not a specific item. */ + dataIndex?: number; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### LineSeriesType + +```typescript +type LineSeriesType = { + type: 'line'; + /** Data associated to the line. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### mangoFusionPaletteDark + +```typescript +type mangoFusionPaletteDark = string[]; +``` + +### mangoFusionPaletteLight + +```typescript +type mangoFusionPaletteLight = string[]; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + seriesId: string; + classes?: Partial; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +### MarkShape + +```typescript +type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; +``` + +### NumberValue + +```typescript +type NumberValue = NumberValue; +``` + +### OHLCField + +The OHLC fields that can be formatted individually. + +```typescript +type OHLCField = 'open' | 'high' | 'low' | 'close'; +``` + +### OHLCFormattedValue + +The structured formatted tooltip value for OHLC series. + +```typescript +type OHLCFormattedValue = { + open: string | null; + high: string | null; + low: string | null; + close: string | null; +}; +``` + +### OHLCItemIdentifier + +An object that allows to identify a single bar. +Used for item interaction + +```typescript +type OHLCItemIdentifier = { type: 'ohlc'; seriesId: string; dataIndex: number }; +``` + +### OHLCSeries + +```typescript +type OHLCSeries = { + /** The id of this series. */ + id?: SeriesId; + /** The OHLC data points. */ + data?: (OHLCValueType | null)[]; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** + * The color of the candle body when the close price is greater than or equal to the open price. + * @default (mode) => mode === 'dark' ? '#66bb6a' : '#2e7d32' + */ + upColor?: ChartsColor; + /** + * The color of the candle body when the close price is less than the open price. + * @default (mode) => mode === 'dark' ? '#f44336' : '#d32f2f' + */ + downColor?: ChartsColor; + type?: 'ohlc'; +}; +``` + +### OHLCSeriesType + +```typescript +type OHLCSeriesType = { + type: 'ohlc'; + /** The OHLC data points. */ + data?: (OHLCValueType | null)[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** + * The color of the candle body when the close price is greater than or equal to the open price. + * @default (mode) => mode === 'dark' ? '#66bb6a' : '#2e7d32' + */ + upColor?: ChartsColor; + /** + * The color of the candle body when the close price is less than the open price. + * @default (mode) => mode === 'dark' ? '#f44336' : '#d32f2f' + */ + downColor?: ChartsColor; + /** The id of this series. */ + id?: SeriesId; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### OHLCTooltipValue + +The structured tooltip value for OHLC series. + +```typescript +type OHLCTooltipValue = { open: string; high: string; low: string; close: string }; +``` + +### OHLCValueType + +Type representing the values of a single OHLC element. +The array contains four numbers in the following order: +\[open, high, low, close]. + +```typescript +type OHLCValueType = OHLCValueType; +``` + +### orangePaletteDark + +```typescript +type orangePaletteDark = string[]; +``` + +### orangePaletteLight + +```typescript +type orangePaletteLight = string[]; +``` + +### OrdinalTimeTicks + +```typescript +type OrdinalTimeTicks = (TickFrequencyDefinition | TickFrequency)[]; +``` + +### PIE_CHART_PLUGINS + +```typescript +type PIE_CHART_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### PIE_CHART_PRO_PLUGINS + +```typescript +type PIE_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### PieArcLabelPlotProps + +```typescript +type PieArcLabelPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcLabelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcLabelPlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcLabelPlotSlotProps + +```typescript +type PieArcLabelPlotSlotProps = { pieArcLabel?: Partial }; +``` + +### PieArcLabelPlotSlots + +```typescript +type PieArcLabelPlotSlots = { pieArcLabel?: React.JSXElementConstructor }; +``` + +### PieArcLabelProps + +```typescript +type PieArcLabelProps = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + classes?: Partial; + startAngle: number; + endAngle: number; + arcLabelRadius: number; + cornerRadius: number; + paddingAngle: number; + skipAnimation: boolean; + formattedArcLabel?: string | null; + hidden?: boolean; +}; +``` + +### PieArcOwnerState + +```typescript +type PieArcOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; +}; +``` + +### PieArcPlotProps + +```typescript +type PieArcPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcPlotSlotProps; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcPlotSlotProps + +```typescript +type PieArcPlotSlotProps = { pieArc?: Partial }; +``` + +### PieArcPlotSlots + +```typescript +type PieArcPlotSlots = { pieArc?: React.JSXElementConstructor }; +``` + +### PieArcProps + +```typescript +type PieArcProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; + cornerRadius: number; + endAngle: number; + innerRadius: number; + onClick?: (event: React.MouseEvent) => void; + outerRadius: number; + paddingAngle: number; + startAngle: number; + /** If `true`, the animation is disabled. */ + skipAnimation?: boolean; + /** + * If `true`, the default event handlers are disabled. + * Those are used, for example, to display a tooltip or highlight the arc on hover. + */ + skipInteraction?: boolean; +}; +``` + +### piecewiseColorLegendClasses + +```typescript +type piecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendClasses + +```typescript +type PiecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendItemContext + +```typescript +type PiecewiseColorLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'piecewiseColor'; + /** The minimum value of the category */ + minValue: number | Date | null; + /** The maximum value of the category */ + maxValue: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### PiecewiseColorLegendProps + +```typescript +type PiecewiseColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * Format the legend labels. + * @returns The displayed label, `''` to skip the label but show the color mark, or `null` to skip it entirely. + */ + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + /** + * Where to position the labels relative to the color marks. + * @default 'extremes' + */ + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### PiecewiseLabelFormatterParams + +```typescript +type PiecewiseLabelFormatterParams = { + /** The index of the entry. */ + index: number; + /** The length of the entries array. */ + length: number; + /** The min value of the piece. `null` is infinite. */ + min: number | Date | null; + /** The max value of the piece. `null` is infinite. */ + max: number | Date | null; + /** The formatted min value of the piece. `null` is infinite. */ + formattedMin: string | null; + /** The formatted max value of the piece. `null` is infinite. */ + formattedMax: string | null; +}; +``` + +### PieChartPluginSignatures + +```typescript +type PieChartPluginSignatures = PieChartPluginSignatures; +``` + +### PieChartProPluginSignatures + +```typescript +type PieChartProPluginSignatures = PieChartProPluginSignatures; +``` + +### PieChartProProps + +````typescript +type PieChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; +}; +```` + +### PieChartProps + +````typescript +type PieChartProps = { + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartSlotProps; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### PieChartProSlotProps + +```typescript +type PieChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + pieArc?: Partial; + pieArcLabel?: Partial; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### PieChartProSlots + +```typescript +type PieChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### PieChartSlotProps + +```typescript +type PieChartSlotProps = { + pieArc?: Partial; + pieArcLabel?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### PieChartSlots + +```typescript +type PieChartSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### pieClasses + +```typescript +type pieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClasses + +```typescript +type PieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClassKey + +```typescript +type PieClassKey = + | 'root' + | 'arc' + | 'series' + | 'arcLabel' + | 'animate' + | 'seriesLabels' + | 'focusIndicator'; +``` + +### PieItemId + +```typescript +type PieItemId = string | number; +``` + +### PieItemIdentifier + +An object that allows to identify a single pie slice. +Used for item interaction + +```typescript +type PieItemIdentifier = { type: 'pie'; seriesId: string; dataIndex: number }; +``` + +### PiePlotProps + +```typescript +type PiePlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: PiePlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PiePlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; +}; +``` + +### PiePlotSlotProps + +```typescript +type PiePlotSlotProps = { pieArc?: Partial; pieArcLabel?: Partial }; +``` + +### PiePlotSlots + +```typescript +type PiePlotSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; +}; +``` + +### PieSeries + +```typescript +type PieSeries = MakeOptional>, 'type'>; +``` + +### PieSeriesLayout + +Layout information computed from the pie series and the drawing area. + +```typescript +type PieSeriesLayout = { + /** The pie center coordinate in px. */ + center: { x: number; y: number }; + /** + * The pie radius in px. + * Computed based on the drawing area and the center placement. + */ + radius: { + /** + * The maximum available radius in px. + * Correspond to radius='100%'. + */ + available: number; + /** The pie inner radius in px, except if overridden by item state (highlight/faded). */ + inner: number; + /** The pie outer radius in px, except if overridden by item state (highlight/faded). */ + outer: number; + /** The pie label radius in px, except if overridden by item state (highlight/faded). */ + label: number; + }; +}; +``` + +### PieSeriesType + +```typescript +type PieSeriesType = { + type: 'pie'; + data: TData[]; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### PieValueType + +```typescript +type PieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### pinkPaletteDark + +```typescript +type pinkPaletteDark = string[]; +``` + +### pinkPaletteLight + +```typescript +type pinkPaletteLight = string[]; +``` + +### Position + +```typescript +type Position = { + /** The vertical position. */ + vertical?: 'top' | 'middle' | 'bottom'; + /** The horizontal position. */ + horizontal?: 'start' | 'center' | 'end'; +}; +``` + +### PropsFromSlot + +```typescript +type PropsFromSlot = + | P + | React.ComponentProps< + NonNullable | React.ElementType | null | undefined> + >; +``` + +### purplePaletteDark + +```typescript +type purplePaletteDark = string[]; +``` + +### purplePaletteLight + +```typescript +type purplePaletteLight = string[]; +``` + +### RADAR_CHART_PRO_PLUGINS + +```typescript +type RADAR_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### RADAR_PLUGINS + +```typescript +type RADAR_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, +]; +``` + +### RadarAxisHighlightProps + +```typescript +type RadarAxisHighlightProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial< + Pick + >; +}; +``` + +### RadarAxisProps + +```typescript +type RadarAxisProps = { + /** + * Defines how label align with the axis. + * - 'horizontal': labels stay horizontal and their placement change with the axis angle. + * - 'rotated': labels are rotated 90deg relatively to their axis. + * @default 'horizontal' + */ + labelOrientation?: 'horizontal' | 'rotated'; + /** The labels text anchor or a function returning the text anchor for a given axis angle (in degree). */ + textAnchor?: + | 'start' + | 'middle' + | 'end' + | 'inherit' + | ((angle: number) => 'start' | 'end' | 'middle' | 'inherit' | undefined); + /** The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). */ + dominantBaseline?: + | 'auto' + | 'use-script' + | 'no-change' + | 'reset-size' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'central' + | 'middle' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | (( + angle: number, + ) => + | 'auto' + | 'middle' + | 'alphabetic' + | 'hanging' + | 'ideographic' + | 'mathematical' + | 'central' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | 'use-script' + | 'no-change' + | 'reset-size' + | undefined); + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial>; + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### RadarChartPluginSignatures + +```typescript +type RadarChartPluginSignatures = RadarChartPluginSignatures; +``` + +### RadarChartProPluginSignatures + +```typescript +type RadarChartProPluginSignatures = RadarChartProPluginSignatures; +``` + +### RadarChartProProps + +````typescript +type RadarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** A CSS class name applied to the root element. */ + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; +}; +```` + +### RadarChartProps + +````typescript +type RadarChartProps = { + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; +}; +```` + +### RadarChartProSlotProps + +```typescript +type RadarChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### RadarChartProSlots + +```typescript +type RadarChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### RadarChartSlotProps + +```typescript +type RadarChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### RadarChartSlots + +```typescript +type RadarChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### radarClasses + +```typescript +type radarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClasses + +```typescript +type RadarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClassKey + +```typescript +type RadarClassKey = + | 'axisLine' + | 'axisLabel' + | 'axisRoot' + | 'gridRadial' + | 'gridDivider' + | 'gridStripe' + | 'seriesRoot' + | 'seriesArea' + | 'seriesMark' + | 'axisHighlightRoot' + | 'axisHighlightLine' + | 'axisHighlightDot'; +``` + +### RadarDataProviderProps + +```typescript +type RadarDataProviderProps< + TSignatures extends ChartAnyPluginSignature[] = RadarChartPluginSignatures, +> = { + /** Array of plugins used to add features to the chart. */ + plugins?: [] | [ChartPlugin]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** Slots to customize charts' components. */ + slots?: Partial; + /** The props for the slots. */ + slotProps?: Partial; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: + | string + | number + | bigint + | boolean + | ReactElement + | Iterable + | React.ReactPortal + | Promise + | null; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: number | Partial; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: {}; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; +}; +``` + +### RadarGridProps + +```typescript +type RadarGridProps = { + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; +}; +``` + +### RadarItemIdentifier + +An object that allows to identify either a radar series or a radar point (if dataIndex is defined). +Used for item interaction + +```typescript +type RadarItemIdentifier = { type: 'radar'; seriesId: string; dataIndex?: number }; +``` + +### RadarSeries + +```typescript +type RadarSeries = { + /** The id of this series. */ + id?: SeriesId; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + type?: 'radar'; +}; +``` + +### RadarSeriesAreaProps + +```typescript +type RadarSeriesAreaProps = { + /** Callback fired when an area is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesMarksProps + +```typescript +type RadarSeriesMarksProps = { + /** Callback fired when a mark is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesPlotProps + +```typescript +type RadarSeriesPlotProps = { + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesType + +```typescript +type RadarSeriesType = { + type: 'radar'; + data: number[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### RadiusAxis + +```typescript +type RadiusAxis = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * The minimal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + min?: number; + /** + * The maximal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + max?: number; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The minimal radius. */ + minRadius?: number; + /** The maximal radius. */ + maxRadius?: number; + colorMap?: ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### rainbowSurgePaletteDark + +```typescript +type rainbowSurgePaletteDark = string[]; +``` + +### rainbowSurgePaletteLight + +```typescript +type rainbowSurgePaletteLight = string[]; +``` + +### rangeBarClasses + +```typescript +type rangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClasses + +```typescript +type RangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClassKey + +```typescript +type RangeBarClassKey = 'root' | 'series' | 'seriesLabels'; +``` + +### RangeBarItemIdentifier + +An object that allows to identify a range bar. +Used for item interaction + +```typescript +type RangeBarItemIdentifier = { type: 'rangeBar'; seriesId: string; dataIndex: number }; +``` + +### RangeBarPlotProps + +```typescript +type RangeBarPlotProps = { + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + barItemIdentifier: RangeBarItemIdentifier, + ) => void; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RangeBarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: RangeBarPlotSlots; +}; +``` + +### RangeBarPlotSlotProps + +```typescript +type RangeBarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### RangeBarPlotSlots + +```typescript +type RangeBarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### RangeBarSeries + +```typescript +type RangeBarSeries = { + type: 'rangeBar'; + /** Data associated to each range bar. */ + data?: (RangeBarValueType | null)[]; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### RangeBarSeriesType + +```typescript +type RangeBarSeriesType = { + type: 'rangeBar'; + /** Data associated to each range bar. */ + data?: (RangeBarValueType | null)[]; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### RangeBarValueType + +\[start, end] + +```typescript +type RangeBarValueType = RangeBarValueType; +``` + +### redPaletteDark + +```typescript +type redPaletteDark = string[]; +``` + +### redPaletteLight + +```typescript +type redPaletteLight = string[]; +``` + +### referenceLineClasses + +```typescript +type referenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### RotationAxis + +```typescript +type RotationAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The start angle (in deg). */ + startAngle?: number; + /** The end angle (in deg). */ + endAngle?: number; + /** The gap between the axis and the label. */ + labelGap?: number; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### ScaleName + +```typescript +type ScaleName = 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### SCATTER_CHART_PLUGINS + +```typescript +type SCATTER_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### SCATTER_CHART_PRO_PLUGINS + +```typescript +type SCATTER_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### ScatterChartPluginSignatures + +```typescript +type ScatterChartPluginSignatures = ScatterChartPluginSignatures; +``` + +### ScatterChartProPluginSignatures + +```typescript +type ScatterChartProPluginSignatures = ScatterChartProPluginSignatures; +``` + +### ScatterChartProProps + +````typescript +type ScatterChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### ScatterChartProps + +````typescript +type ScatterChartProps = { + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartSlotProps; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; +}; +```` + +### ScatterChartProSlotProps + +```typescript +type ScatterChartProSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + scatter?: Partial; + marker?: ScatterMarkerProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ScatterChartProSlots + +```typescript +type ScatterChartProSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### ScatterChartSlotProps + +```typescript +type ScatterChartSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + scatter?: Partial; + marker?: ScatterMarkerProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ScatterChartSlots + +```typescript +type ScatterChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### scatterClasses + +```typescript +type scatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClasses + +```typescript +type ScatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClassKey + +```typescript +type ScatterClassKey = 'marker' | 'root' | 'series' | 'focusedMark'; +``` + +### ScatterItemIdentifier + +An object that allows to identify a single scatter item. +Used for item interaction + +```typescript +type ScatterItemIdentifier = { type: 'scatter'; seriesId: string; dataIndex: number }; +``` + +### ScatterMarkerProps + +```typescript +type ScatterMarkerProps = { + /** The series ID. */ + seriesId: string; + /** The index of the data point. */ + dataIndex: number; + /** The x coordinate of the data point. */ + x: number; + /** The y coordinate of the data point. */ + y: number; + /** The fill color of the marker. */ + color: string; + /** The size of the marker. */ + size: number; + /** If `true`, the marker is highlighted. */ + isHighlighted: boolean; + /** If `true`, the marker is faded. */ + isFaded: boolean; + /** Callback fired when clicking on a scatter item. */ + onClick?: (event: React.MouseEvent) => void; +}; +``` + +### ScatterMarkerSlotExtension + +```typescript +type ScatterMarkerSlotExtension = { + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterMarkerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterMarkerSlots; +}; +``` + +### ScatterMarkerSlotProps + +```typescript +type ScatterMarkerSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterMarkerSlots + +```typescript +type ScatterMarkerSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterPlotProps + +```typescript +type ScatterPlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterPlotSlotProps; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + classes?: Partial; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; +}; +``` + +### ScatterPlotSlotProps + +```typescript +type ScatterPlotSlotProps = { scatter?: Partial; marker?: ScatterMarkerProps }; +``` + +### ScatterPlotSlots + +```typescript +type ScatterPlotSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterProps + +```typescript +type ScatterProps = { + series: DefaultizedScatterSeriesType; + xScale: D3Scale; + yScale: D3Scale; + color: string; + /** + * Function to get the color of a scatter item given its data index. + * The data index argument is optional. If not provided, the color for the entire series is returned. + * If provided, the color for the specific scatter item is returned. + */ + colorGetter: (dataIndex?: number) => string; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; + classes?: Partial; + slots?: ScatterSlots; + slotProps?: ScatterSlotProps; +}; +``` + +### ScatterSeries + +```typescript +type ScatterSeries = MakeOptional; +``` + +### ScatterSeriesType + +```typescript +type ScatterSeriesType = { + type: 'scatter'; + data?: ScatterValueType[]; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize?: number; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + preview?: { markerSize?: number }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### ScatterSlotProps + +```typescript +type ScatterSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterSlots + +```typescript +type ScatterSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterValueType + +```typescript +type ScatterValueType = { + x: number; + y: number; + z?: any; + /** A unique identifier for the scatter point */ + id?: string | number; +}; +``` + +### SeriesId + +The unique identifier of a series. + +```typescript +type SeriesId = string; +``` + +### SeriesItem + +```typescript +type SeriesItem< + T extends 'bar' | 'line' | 'scatter' | 'radar' | 'heatmap' | 'funnel' | 'rangeBar' | 'ohlc', +> = { + seriesId: string; + color: string; + value: + | { open: number; high: number; low: number; close: number } + | number + | HeatmapValueType + | ScatterValueType + | RangeBarValueType + | OHLCValueType + | MakeRequired + | null; + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string; + formattedLabel: string | null; + markType: ChartsLabelMarkType | undefined; + markShape: MarkShape | undefined; +}; +``` + +### SeriesItemIdentifier + +```typescript +type SeriesItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { seriesId: string }; +``` + +### SeriesItemIdentifierWithData + +```typescript +type SeriesItemIdentifierWithData< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### SeriesItemIdentifierWithType + +```typescript +type SeriesItemIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### SeriesLegendItemContext + +```typescript +type SeriesLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'series'; + /** The identifier of the series */ + seriesId: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### SeriesLegendItemParams + +```typescript +type SeriesLegendItemParams = { + /** The identifier of the series */ + seriesId: string; + /** The type of the series */ + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + markType: ChartsLabelMarkType | undefined; + markShape?: MarkShape; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### ShowMarkParams + +```typescript +type ShowMarkParams = { + /** The item index. */ + index: number; + /** The x coordinate in the SVG. */ + x: number; + /** The y coordinate in the SVG. */ + y: number; + /** The item position value. It likely comes from the axis `data` property. */ + position: AxisValue; + /** The item value. It comes from the series `data` property. */ + value: number; +}; +``` + +### SparkLineChartProps + +````typescript +type SparkLineChartProps = { + /** + * The xAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + xAxis?: XAxis; + /** + * The yAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + yAxis?: YAxis; + axisHighlight?: ChartsAxisHighlightProps; + /** + * Type of plot used. + * @default 'line' + */ + plotType?: 'bar' | 'line'; + /** Data to plot. */ + data: number[]; + /** + * Formatter used by the tooltip. + * @default (value: number | null) => (value === null ? '' : value.toString()) + * @returns the formatted value. + */ + valueFormatter?: (value: number | null) => string; + /** + * Set to `true` to enable the tooltip in the sparkline. + * @default false + */ + showTooltip?: boolean; + /** + * Set to `true` to highlight the value. + * With line, it shows a point. + * With bar, it shows a highlight band. + * @default false + */ + showHighlight?: boolean; + /** + * Set to `true` to fill spark line area. + * Has no effect if plotType='bar'. + * @default false + */ + area?: boolean; + /** @default 'linear' */ + curve?: CurveType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + * @default 5 + */ + margin?: Partial | number; + /** + * Overridable component slots. + * @default {} + */ + slots?: SparkLineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SparkLineChartSlotProps; + /** + * Color used to colorize the sparkline. + * @default rainbowSurgePalette[0] + */ + color?: ChartsColor; + /** + * When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. + * @default false + */ + disableClipping?: boolean; + /** + * The clipped area offset in pixels. + * + * This prevents partial clipping of lines when they are drawn on the edge of the drawing area. + * @default { top: 1, right: 1, bottom: 1, left: 1 } + */ + clipAreaOffset?: { top?: number; right?: number; bottom?: number; left?: number }; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | BarItemIdentifier + | Omit + | LineItemIdentifier + | Omit + | ScatterItemIdentifier + | Omit + | PieItemIdentifier + | Omit + | RadarItemIdentifier + | Omit + | HeatmapItemIdentifier + | Omit + | FunnelItemIdentifier + | Omit + | SankeyItemIdentifier + | Omit + | Omit + | RangeBarItemIdentifier + | Omit + | OHLCItemIdentifier + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: ( + tooltipItem: + | BarItemIdentifier + | LineItemIdentifier + | ScatterItemIdentifier + | PieItemIdentifier + | RadarItemIdentifier + | HeatmapItemIdentifier + | FunnelItemIdentifier + | SankeyItemIdentifier + | RangeBarItemIdentifier + | OHLCItemIdentifier + | null, + ) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'rangeBar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'rangeBar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: + | SankeyItemIdentifier + | { type: 'bar'; seriesId: string; dataIndex?: number } + | { type: 'line'; seriesId: string; dataIndex?: number } + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | { type: 'pie'; seriesId: string; dataIndex?: number } + | { type: 'radar'; seriesId: string; dataIndex?: number } + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | { type: 'rangeBar'; seriesId: string; dataIndex?: number } + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * Callback fired when clicking close to an item. + * This is only available for scatter plot for now. + */ + onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + radar: ChartSeriesTypeConfig<'radar'>; + heatmap: ChartSeriesTypeConfig<'heatmap'>; + funnel: ChartSeriesTypeConfig<'funnel'>; + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + rangeBar: ChartSeriesTypeConfig<'rangeBar'>; + ohlc: ChartSeriesTypeConfig<'ohlc'>; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'rangeBar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'rangeBar'; + } + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + )[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'rangeBar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'rangeBar'; + } + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'rangeBar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'rangeBar'; + } + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** If true, the hit area interaction is disabled and falls back to hover events. */ + disableHitArea?: boolean; +}; +```` + +### SparkLineChartSlotProps + +```typescript +type SparkLineChartSlotProps = { + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SparkLineChartSlots + +```typescript +type SparkLineChartSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### StackableChartSeriesType + +```typescript +type StackableChartSeriesType = 'bar' | 'line'; +``` + +### StackOffsetType + +```typescript +type StackOffsetType = 'expand' | 'diverging' | 'none' | 'silhouette' | 'wiggle'; +``` + +### StackOrderType + +```typescript +type StackOrderType = 'appearance' | 'ascending' | 'descending' | 'insideOut' | 'none' | 'reverse'; +``` + +### strawberrySkyPaletteDark + +```typescript +type strawberrySkyPaletteDark = string[]; +``` + +### strawberrySkyPaletteLight + +```typescript +type strawberrySkyPaletteLight = string[]; +``` + +### TickFrequency + +The predefined tick frequencies for time ordinal axes. + +- 'years': displays the year, placing ticks at the start of each year +- 'quarterly': displays the month, placing ticks at the start of each quarter +- 'months': displays the month, placing ticks at the start of each month +- 'biweekly': displays the day, placing ticks every two weeks +- 'weeks': displays the day, placing ticks at the start of each week +- 'days': displays the day, placing ticks at the start of each day +- 'hours': displays the hour and minutes, placing ticks at the start of each hour + +```typescript +type TickFrequency = 'years' | 'quarterly' | 'months' | 'biweekly' | 'weeks' | 'days' | 'hours'; +``` + +### TickFrequencyDefinition + +Definition of a tick frequency for time ordinal axes. + +```typescript +type TickFrequencyDefinition = { + /** + * Returns the number of ticks in the given date range for this tick frequency. + * @returns The number of ticks in the [from, to] range. + */ + getTickNumber: (from: Date, to: Date) => number; + /** + * Decides if the current date should be shown as a tick. + * @returns Whether the current date is a tick or not. + */ + isTick: (prev: Date, value: Date) => boolean; + /** + * Format the tick value for display. + * @returns The formatted date string. + */ + format: (date: Date) => string; +}; +``` + +### TickItem + +```typescript +type TickItem = { + /** + * The value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + value?: any; + /** + * The formatted value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + formattedValue?: string; + /** + * The offset in pixels relative to the SVG origin. + * For an x-axis, it is relative to the left side of the SVG. + * For a y-axis, it is relative to the top side of the SVG. + */ + offset: number; + /** + * The offset in pixels relative to the tick position. + * For an x-axis, a positive value means the label is shifted to the right of the tick. + * For a y-axis, a positive value means the label is shifted downwards from the tick. + */ + labelOffset: number; +}; +``` + +### UseAnimateParams + +```typescript +type UseAnimateParams = { + /** + * Function that returns the interpolation function for animating props. + * @returns + * Interpolation function that takes a time value between 0 and 1 and returns the interpolated + * props at time t. This function is called on every frame of the animation. + */ + createInterpolator: (lastProps: Props, newProps: Props) => (t: number) => Props; + /** + * Transforms the interpolated props to be passed to `applyProps`, which usually means transforming them to element + * attributes, e.g., transforming an array of points into a `d` attribute for a path. + * @returns The transformed props. + */ + transformProps: (props: Props) => T; + /** + * Applies the transformed props to the element. Usually this will be a call to `element.setAttribute("x", x)` or + * to `element.style.width = width` so that updating the element does not go through the React lifecycle (i.e., not + * causing a re-render), with the objective of improving performance. + * + * This function is called on every frame of the animation. + */ + applyProps: (element: Elem, props: T) => void; + /** If `true`, the animation will be skipped and the final props will be applied immediately. */ + skip?: boolean; + /** Initial props to animate from. If not provided, defaults to the props passed as the first argument of `useAnimate`. */ + initialProps?: Props; + /** Optional ref to merge with the ref returned from this hook. */ + ref?: React.Ref; +}; +``` + +### UseAnimateReturn + +```typescript +type UseAnimateReturn = { + /** Ref to be passed to the element to animate. */ + ref: React.Ref; +}; +``` + +### UseAxesTooltipParams + +```typescript +type UseAxesTooltipParams = { + /** + * The axis directions to consider. + * If not defined, all directions are considered + */ + directions?: ('x' | 'y' | 'rotation')[]; +}; +``` + +### UseAxesTooltipReturnValue + +```typescript +type UseAxesTooltipReturnValue = { axisDirection: 'x' | 'y' | 'radius' | 'rotation'; +mainAxis: { /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ +id: AxisId; +/** The data used by `'band'` and `'point'` scales. */ +data?: any[]; +/** The key used to retrieve `data` from the `dataset` prop. */ +dataKey?: string; +/** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ +valueGetter?: ((item: DatasetElementType) => any); +colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string); type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'piecewise'; thresholds: (number | Date)[]; colors: string[]; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) }; +/** + * Formats the axis value. + * @returns The string to display. + */ +valueFormatter?: ((value: any, context: AxisValueFormatterContext) => string); +/** The label of the axis. */ +label?: string; +/** A CSS class name applied to the root element. */ +className?: string; +/** + * If true, the axis line is disabled. + * @default false + */ +disableLine?: boolean; +/** + * If true, the ticks are disabled. + * @default false + */ +disableTicks?: boolean; +/** The style applied to ticks text. */ +tickLabelStyle?: ChartsTextStyle; +/** The style applied to the axis label. */ +labelStyle?: ChartsTextStyle; +/** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ +tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); +/** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ +tickSpacing?: number; +/** + * The size of the ticks. + * @default 6 + */ +tickSize?: number; +/** Override or extend the styles applied to the component. */ +classes?: Partial; +/** + * Overridable component slots. + * @default {} + */ +slots?: Partial; +/** + * The props used for each component slot. + * @default {} + */ +slotProps?: Partial; +sx?: SxProps; +/** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMaxStep?: number; +/** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMinStep?: number; +/** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ +tickNumber?: number; +/** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ +tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; +/** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ +tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; +/** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ +tickLabelPlacement?: 'middle' | 'tick'; +/** If `true`, hide this value in the tooltip */ +hideTooltip?: boolean; +/** If `true`, Reverse the axis scaleBand. */ +reverse?: boolean; +/** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ +domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); +/** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ +ignoreTooltip?: boolean; +zoom?: boolean | ZoomOptions | false & DefaultizedZoomOptions | true & DefaultizedZoomOptions | { minStart?: number; maxEnd?: number; step?: number; minSpan?: number; maxSpan?: number; panning?: boolean; filterMode?: ZoomFilterMode; slider?: ZoomSliderOptions; axisId: AxisId; axisDirection: 'x' | 'y'; slider: DefaultedZoomSliderOptions; reverse: boolean; minStart: number; maxEnd: number; step: number; minSpan: number; maxSpan: number; panning: boolean; filterMode: ZoomFilterMode }; +/** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ +offset?: number; +scaleType: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +scale: ScaleBand<{ toString: function toString() { [native code] } }> | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; +colorScale?: ScaleOrdinal | ScaleOrdinal | ScaleSequential | ScaleThreshold | ScaleThreshold; +/** Indicate if the axis should be consider by a tooltip with `trigger='axis'`. */ +triggerTooltip?: boolean }; +axisId: AxisId; +axisValue: AxisValueT; +axisFormattedValue: string; +dataIndex: number; +seriesItems: SeriesItem[] } +``` + +### UseBarSeriesContextReturnValue + +```typescript +type UseBarSeriesContextReturnValue = SeriesProcessorResult<'bar'>; +``` + +### UseBarSeriesReturnValue + +```typescript +type UseBarSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UseChartCartesianAxisSignature + +```typescript +type UseChartCartesianAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartCartesianAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartCartesianAxisDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartCartesianAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature, UseChartBrushSignature]; +}; +``` + +### UseChartClosestPointSignature + +```typescript +type UseChartClosestPointSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVoronoiParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVoronoiDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVoronoiInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVoronoiState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [ + UseChartInteractionSignature, + UseChartHighlightSignature, + UseChartTooltipSignature, + ]; +}; +``` + +### UseChartHighlightSignature + +```typescript +type UseChartHighlightSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartHighlightParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartHighlightDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartHighlightInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartHighlightState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartInteractionSignature + +```typescript +type UseChartInteractionSignature = { + /** The raw properties that can be passed to the plugin. */ + params: {}; + /** The params after being processed with the default values. */ + defaultizedParams: {}; + /** An imperative api available for internal use. */ + instance: UseChartInteractionInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartInteractionState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartPolarAxisSignature + +```typescript +type UseChartPolarAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartPolarAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartPolarAxisParameters; + /** An imperative api available for internal use. */ + instance: UseChartPolarAxisInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartPolarAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature]; +}; +``` + +### UseChartProExportSignature + +```typescript +type UseChartProExportSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProExportParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProExportParameters; + /** An imperative api available for internal use. */ + instance: UseChartProExportInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProExportState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProExportPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartProZoomSignature + +```typescript +type UseChartProZoomSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProZoomParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProZoomDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartProZoomInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProZoomState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProZoomPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature, UseChartBrushSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartTooltipSignature + +```typescript +type UseChartTooltipSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartTooltipParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartTooltipDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartTooltipInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartTooltipState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartVisibilityManagerInstance + +```typescript +type UseChartVisibilityManagerInstance< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** Hide an item by its identifier. */ + hideItem: hideItem; + /** Show an item by its identifier. */ + showItem: showItem; + /** Toggle the visibility of an item by its identifier. */ + toggleItemVisibility: toggleItemVisibility; +}; +``` + +### UseChartVisibilityManagerParameters + +````typescript +type UseChartVisibilityManagerParameters< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: (hiddenItems: VisibilityIdentifierWithType[]) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: (VisibilityIdentifierWithType | VisibilityIdentifier)[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | VisibilityIdentifierWithType + | VisibilityIdentifier + )[]; +}; +```` + +### UseChartVisibilityManagerSignature + +```typescript +type UseChartVisibilityManagerSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVisibilityManagerParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVisibilityManagerDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVisibilityManagerInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVisibilityManagerState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartZAxisSignature + +```typescript +type UseChartZAxisSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartZAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartZAxisParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartZAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseFunnelSeriesContextReturnValue + +```typescript +type UseFunnelSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseFunnelSeriesReturnValue + +```typescript +type UseFunnelSeriesReturnValue = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### UseHeatmapSeriesContextReturnValue + +```typescript +type UseHeatmapSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseHeatmapSeriesReturnValue + +```typescript +type UseHeatmapSeriesReturnValue = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### UseItemTooltipReturnValue + +```typescript +type UseItemTooltipReturnValue< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | RangeBarValueType + | OHLCValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### UseLineSeriesContextReturnValue + +```typescript +type UseLineSeriesContextReturnValue = SeriesProcessorResult<'line'>; +``` + +### UseLineSeriesReturnValue + +```typescript +type UseLineSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UseOHLCSeriesContextReturnValue + +```typescript +type UseOHLCSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseOHLCSeriesReturnValue + +```typescript +type UseOHLCSeriesReturnValue = { + hidden: boolean; + /** The color of the candle body when the close price is greater than or equal to the open price. */ + upColor: string; + /** The color of the candle body when the close price is less than the open price. */ + downColor: string; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + type: 'ohlc'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** The id of this series. */ + id: string; + /** The OHLC data points. */ + data: (OHLCValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### UsePieSeriesContextReturnValue + +```typescript +type UsePieSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UsePieSeriesReturnValue + +```typescript +type UsePieSeriesReturnValue = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### UseRadarAxisParams + +```typescript +type UseRadarAxisParams = { + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### UseRadarItemTooltipReturnValue + +```typescript +type UseRadarItemTooltipReturnValue = { + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; + values: ItemTooltipValue<'radar'>[]; +}; +``` + +### UseRadarSeriesContextReturnValue + +```typescript +type UseRadarSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseRadarSeriesReturnValue + +```typescript +type UseRadarSeriesReturnValue = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### UseRangeBarSeriesContextReturnValue + +```typescript +type UseRangeBarSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseRangeBarSeriesReturnValue + +```typescript +type UseRangeBarSeriesReturnValue = { + hidden: boolean; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + type: 'rangeBar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The id of this series. */ + id: string; + /** Data associated to each range bar. */ + data: (RangeBarValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; +}; +``` + +### UseScatterSeriesContextReturnValue + +```typescript +type UseScatterSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseScatterSeriesReturnValue + +```typescript +type UseScatterSeriesReturnValue = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### VisibilityIdentifier + +```typescript +type VisibilityIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type?: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId?: string; + seriesId: string; +}; +``` + +### VisibilityIdentifierWithType + +```typescript +type VisibilityIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### XAxis + +```typescript +type XAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### YAxis + +```typescript +type YAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'left' | 'right' | 'none'; + zoom?: boolean | ZoomOptions; + /** + * The width of the axis. + * Set to `'auto'` to automatically calculate the width based on tick label measurements. + * @default 65 if an axis label is provided, 45 otherwise. + */ + width?: number | 'auto'; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### yellowPaletteDark + +```typescript +type yellowPaletteDark = string[]; +``` + +### yellowPaletteLight + +```typescript +type yellowPaletteLight = string[]; +``` + +### ZoomData + +```typescript +type ZoomData = { + /** The id of the zoomed axis. */ + axisId: AxisId; + /** The starting percentage of the zoom range. In the range of 0 to 100. */ + start: number; + /** The ending percentage of the zoom range. In the range of 0 to 100. */ + end: number; +}; +``` + +### ZoomFilterMode + +```typescript +type ZoomFilterMode = 'keep' | 'discard'; +``` + +### ZoomOptions + +```typescript +type ZoomOptions = { + /** + * The starting percentage of the zoom range. In the range of 0 to 100. + * @default 0 + */ + minStart?: number; + /** + * The ending percentage of the zoom range. In the range of 0 to 100. + * @default 100 + */ + maxEnd?: number; + /** + * The step size of the zooming function. Defines the granularity of the zoom. + * @default 5 + */ + step?: number; + /** + * Restricts the minimum span size in the range of 0 to 100. + * + * If the span size is smaller than the minSpan, the span will be resized to the minSpan. + * @default 10 + */ + minSpan?: number; + /** + * Restricts the maximum span size in the range of 0 to 100. + * + * If the span size is larger than the maxSpan, the span will be resized to the maxSpan. + * @default 100 + */ + maxSpan?: number; + /** + * Set to `false` to disable panning. Useful when you want to pan programmatically, + * or to show only a specific section of the chart. + * @default true + */ + panning?: boolean; + /** + * Defines how to filter the axis data when it is outside of the zoomed range of this axis. + * + * - `keep`: The data outside the zoomed range is kept. And the other axes will stay the same. + * - `discard`: The data outside the zoomed range is discarded for the other axes. + * The other axes will be adjusted to fit the zoomed range. + * @default 'keep' + */ + filterMode?: ZoomFilterMode; + /** Configures the zoom slider. The slider is an element that shows the zoomed range and allows its manipulation. */ + slider?: ZoomSliderOptions; +}; +``` + +### ZoomSliderOptions + +```typescript +type ZoomSliderOptions = { + /** If `true`, the slider will be shown. */ + enabled?: boolean; + /** + * The size reserved for the zoom slider. The actual size of the slider might be smaller, so + * increasing this value effectively increases the margin around the slider. + * This means the height for the x-axis and the width for the y-axis. + * @default 48 if preview is enabled, 28 otherwise. + */ + size?: number; + /** + * Defines when the tooltip with the zoom values should be shown. + * - 'always': The tooltip is always shown. + * - 'hover': The tooltip is shown when hovering over the track or thumb. + * - 'never': The tooltip is never shown. + * @default 'hover' + */ + showTooltip?: ZoomSliderShowTooltip; + /** + * If `true`, a preview of the chart will be shown in the slider. + * Can also be an object to configure which series are shown in the preview. + */ + preview?: boolean | ZoomSliderPreviewOptions; +}; +``` + +### ZoomSliderShowTooltip + +```typescript +type ZoomSliderShowTooltip = 'always' | 'hover' | 'never'; +``` + +## External Types + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; +}) => { + identifier: { type: 'pie'; seriesId: string; dataIndex: number }; + color: string; + label: string | undefined; + value: unknown; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { pie?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; + seriesLayout: { pie?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + type: 'pie'; + data: unknown; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id?: string | undefined; + valueFormatter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + color?: string | undefined; + colorGetter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => unknown; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: { + type: 'pie'; + seriesId: string; + dataIndex: number; +}) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: { type: 'pie'; seriesId: string; dataIndex: number }) => { + type: 'pie'; + seriesId: string; + dataIndex: number; +}; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = ( + state: unknown, + point: { x: number; y: number }, +) => { type: 'pie'; seriesId: string; dataIndex: number } | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | null + | undefined, + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number | undefined } | null, +) => unknown; +``` + +### SeriesValueFormatter + +```typescript +type SeriesValueFormatter = (value: number, context: { dataIndex: number }) => string | null; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### Exclude + +```typescript +type Exclude = 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### hideItem + +```typescript +type hideItem = (identifier: unknown) => void; +``` + +### showItem + +```typescript +type showItem = (identifier: unknown) => void; +``` + +### toggleItemVisibility + +```typescript +type toggleItemVisibility = ( + identifier: + | unknown + | { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; + }, +) => void; +``` + +### TriggerOptions + +```typescript +type TriggerOptions = 'item' | 'axis' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.axis-config.ts b/docs/pages/x/api/charts/types.axis-config.ts new file mode 100644 index 0000000000000..6e0dc64ded023 --- /dev/null +++ b/docs/pages/x/api/charts/types.axis-config.ts @@ -0,0 +1,4 @@ +import { AxisConfig } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesAxisConfig = createTypes(import.meta.url, AxisConfig); diff --git a/docs/pages/x/api/charts/types.bar-chart-premium.md b/docs/pages/x/api/charts/types.bar-chart-premium.md new file mode 100644 index 0000000000000..5db68eadc7386 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-chart-premium.md @@ -0,0 +1,1680 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.bar-chart-premium.md' + +## API Reference + +### BarChartPremium + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPremium Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar or range bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `(RangeBarSeriesType \| BarSeries)[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] or \[\[RangeBarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartPremiumSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartPremiumSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### FocusedRangeBar + +### RangeBarPlot + +Demos: + +- [Range Bar](https://mui.com/x/react-charts/range-bar/) + +API: + +- [RangeBarPlot API](https://mui.com/x/api/charts/range-bar-plot/) + +**RangeBarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------- | :---------- | :-------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `((event: React.MouseEvent, barItemIdentifier: RangeBarItemIdentifier) => void)` | - | Callback fired when a bar item is clicked. | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `RangeBarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `RangeBarPlotSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### BAR_CHART_PREMIUM_PLUGINS + +```typescript +type BAR_CHART_PREMIUM_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BarChartPremiumPluginSignatures + +```typescript +type BarChartPremiumPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartPremiumProps + +````typescript +type BarChartPremiumProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartPremiumSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartPremiumSlotProps; + /** Callback fired when a bar or range bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] or [[RangeBarSeries]] objects. + */ + series: (RangeBarSeriesType | BarSeries)[]; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + children?: React.ReactNode; + className?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + sx?: SxProps; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartPremiumSlotProps + +```typescript +type BarChartPremiumSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'pointer' | 'node'; sort?: undefined } + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'desc' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + bar?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + barLabel?: SlotComponentPropsFromProps; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartPremiumSlots + +```typescript +type BarChartPremiumSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'pointer' | 'node'; sort?: undefined } + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'desc' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### rangeBarClasses + +```typescript +type rangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClasses + +```typescript +type RangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClassKey + +```typescript +type RangeBarClassKey = 'root' | 'series' | 'seriesLabels'; +``` + +### RangeBarPlotProps + +```typescript +type RangeBarPlotProps = { + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + barItemIdentifier: RangeBarItemIdentifier, + ) => void; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RangeBarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: RangeBarPlotSlots; +}; +``` + +### RangeBarPlotSlotProps + +```typescript +type RangeBarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### RangeBarPlotSlots + +```typescript +type RangeBarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### RangeBarSeries + +```typescript +type RangeBarSeries = { + type: 'rangeBar'; + /** Data associated to each range bar. */ + data?: (RangeBarValueType | null)[]; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'rangeBar' + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +## External Types + +### SeriesValueFormatter + +```typescript +type SeriesValueFormatter = ( + value: unknown | null, + context: { dataIndex: number }, +) => string | null; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + itemIdentifier: + | { type: 'bar'; seriesId: string; dataIndex: number } + | { type: 'rangeBar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` diff --git a/docs/pages/x/api/charts/types.bar-chart-premium.ts b/docs/pages/x/api/charts/types.bar-chart-premium.ts new file mode 100644 index 0000000000000..677c31fe15955 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-chart-premium.ts @@ -0,0 +1,4 @@ +import { BarChartPremium } from '@mui/x-charts-premium/BarChartPremium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesBarChartPremium = createTypes(import.meta.url, BarChartPremium); diff --git a/docs/pages/x/api/charts/types.bar-chart-pro.md b/docs/pages/x/api/charts/types.bar-chart-pro.md new file mode 100644 index 0000000000000..69a9268c51488 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-chart-pro.md @@ -0,0 +1,1493 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.bar-chart-pro.md' + +## API Reference + +### BarChartPro + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'vertical' \| 'horizontal'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +## Additional Types + +### BAR_CHART_PRO_PLUGINS + +```typescript +type BAR_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BarChartProPluginSignatures + +```typescript +type BarChartProPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartProProps + +````typescript +type BarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartProSlotProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'vertical' | 'horizontal'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartProSlotProps + +```typescript +type BarChartProSlotProps = { + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartProSlots + +```typescript +type BarChartProSlots = { + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'legend' + | 'small' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'line' + | 'label' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'legend' + | 'small' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'line' + | 'label' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'legend' + | 'small' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'line' + | 'label' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'legend' + | 'small' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'line' + | 'label' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.bar-chart-pro.ts b/docs/pages/x/api/charts/types.bar-chart-pro.ts new file mode 100644 index 0000000000000..3625aa8e57aa7 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-chart-pro.ts @@ -0,0 +1,4 @@ +import { BarChartPro } from '@mui/x-charts-pro/BarChartPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesBarChartPro = createTypes(import.meta.url, BarChartPro); diff --git a/docs/pages/x/api/charts/types.bar-chart.md b/docs/pages/x/api/charts/types.bar-chart.md new file mode 100644 index 0000000000000..69e855a71e2be --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-chart.md @@ -0,0 +1,1702 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.bar-chart.md' + +## API Reference + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'vertical' \| 'horizontal'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### FocusedBar + +## Additional Types + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'vertical' | 'horizontal'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'root' | 'series' | 'seriesLabels' | 'element' | 'label' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + color: string; + classes?: Partial; + seriesId: string; + dataIndex: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.bar-chart.ts b/docs/pages/x/api/charts/types.bar-chart.ts new file mode 100644 index 0000000000000..52b983d92ab7a --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-chart.ts @@ -0,0 +1,4 @@ +import { BarChart } from '@mui/x-charts/BarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesBarChart = createTypes(import.meta.url, BarChart); diff --git a/docs/pages/x/api/charts/types.bar-element.md b/docs/pages/x/api/charts/types.bar-element.md new file mode 100644 index 0000000000000..b9100ae3c7324 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-element.md @@ -0,0 +1,1702 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.bar-element.md' + +## API Reference + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'vertical' \| 'horizontal'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### FocusedBar + +## Additional Types + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'vertical' | 'horizontal'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'root' | 'series' | 'seriesLabels' | 'element' | 'label' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + color: string; + classes?: Partial; + seriesId: string; + dataIndex: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.bar-element.ts b/docs/pages/x/api/charts/types.bar-element.ts new file mode 100644 index 0000000000000..95c8f189987f6 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-element.ts @@ -0,0 +1,4 @@ +import { BarElement } from '@mui/x-charts/BarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesBarElement = createTypes(import.meta.url, BarElement); diff --git a/docs/pages/x/api/charts/types.bar-label.md b/docs/pages/x/api/charts/types.bar-label.md new file mode 100644 index 0000000000000..7b0f6a01da737 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-label.md @@ -0,0 +1,1702 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.bar-label.md' + +## API Reference + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'vertical' \| 'horizontal'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### FocusedBar + +## Additional Types + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'vertical' | 'horizontal'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'root' | 'series' | 'seriesLabels' | 'element' | 'label' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + color: string; + classes?: Partial; + seriesId: string; + dataIndex: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.bar-label.ts b/docs/pages/x/api/charts/types.bar-label.ts new file mode 100644 index 0000000000000..4a58dc971d7c4 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-label.ts @@ -0,0 +1,4 @@ +import { BarLabel } from '@mui/x-charts/BarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesBarLabel = createTypes(import.meta.url, BarLabel); diff --git a/docs/pages/x/api/charts/types.bar-plot.md b/docs/pages/x/api/charts/types.bar-plot.md new file mode 100644 index 0000000000000..797ccba92422a --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-plot.md @@ -0,0 +1,1702 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.bar-plot.md' + +## API Reference + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'vertical' \| 'horizontal'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### FocusedBar + +## Additional Types + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'vertical' | 'horizontal'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'label' + | 'marker' + | 'line' + | 'text' + | 'p' + | 'center' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'root' | 'series' | 'seriesLabels' | 'element' | 'label' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + color: string; + classes?: Partial; + seriesId: string; + dataIndex: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.bar-plot.ts b/docs/pages/x/api/charts/types.bar-plot.ts new file mode 100644 index 0000000000000..8026201e026c9 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-plot.ts @@ -0,0 +1,4 @@ +import { BarPlot } from '@mui/x-charts/BarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesBarPlot = createTypes(import.meta.url, BarPlot); diff --git a/docs/pages/x/api/charts/types.bar-series.md b/docs/pages/x/api/charts/types.bar-series.md new file mode 100644 index 0000000000000..c06769af5cd0c --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-series.md @@ -0,0 +1,38240 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.bar-series.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarChartPremium + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPremium Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar or range bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `(RangeBarSeriesType \| BarSeries)[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] or \[\[RangeBarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartPremiumSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartPremiumSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarChartPro + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### blueberryTwilightPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### bluePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsAxis Props:** + +| Prop | Type | Default | Description | +| :-------- | :-------------------- | :------ | :-------------------------------------- | +| slotProps | `ChartsAxisSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsAxisSlots` | `{}` | Overridable component slots. | + +### ChartsAxisHighlight + +Demos: + +- [Custom components](https://mui.com/x/react-charts/components/) + +API: + +- [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/) + +**ChartsAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :--- | :------------------------ | :------ | :---------- | +| x | `ChartsAxisHighlightType` | - | - | +| y | `ChartsAxisHighlightType` | - | - | + +### ChartsAxisTooltipContent + +**ChartsAxisTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | The sort in which series items are displayed in the tooltip. When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. | +| sx | `SxProps` | - | - | + +### ChartsClipPath + +API: + +- [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/) + +**ChartsClipPath Props:** + +| Prop | Type | Default | Description | +| :----- | :----------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| offset | `{ top?: number; right?: number; bottom?: number; left?: number }` | - | Offset, in pixels, of the clip path rectangle from the drawing area. A positive value will move the rectangle outside the drawing area. | +| id\* | `string` | - | The id of the clip path. | + +### ChartsColorCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### ChartsColorPaletteCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsContainerPremium + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPremium` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPremium API](https://mui.com/x/api/charts/charts-container-premium/) + +**ChartsContainerPremium Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsContainerPro + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPro` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/) + +**ChartsContainerPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsDataProvider + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/react-charts/composition/) + +API: + +- [ChartsDataProvider API](https://mui.com/x/api/charts/charts-data-provider/) + +**ChartsDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsDataProviderPremium + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPremium API](https://mui.com/x/api/charts/charts-data-provider-premium/) + +**ChartsDataProviderPremium Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsDataProviderPro + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPro API](https://mui.com/x/api/charts/charts-data-provider-pro/) + +**ChartsDataProviderPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType \| RangeBarSeriesType \| OHLCSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsGrid + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsGrid API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsGrid Props:** + +| Prop | Type | Default | Description | +| :--------- | :--------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| horizontal | `boolean` | - | Displays horizontal grid. | +| vertical | `boolean` | - | Displays vertical grid. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsItemTooltipContent + +**ChartsItemTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sx | `SxProps` | - | - | + +### ChartsLegend + +**ChartsLegend Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :----------------------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | - | The direction of the legend layout. The default depends on the chart. | +| onItemClick | `((event: React.MouseEvent, legendItem: SeriesLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| toggleVisibilityOnClick | `boolean` | `false` | If `true`, clicking on a legend item will toggle the visibility of the corresponding series. | +| className | `string` | - | - | + +### ChartsLocalizationProvider + +Demos: + +- [localization](https://mui.com/x/react-charts/localization/) + +API: + +- [ChartsLocalizationProvider API](https://mui.com/x/api/charts/charts-localization-provider/) + +**ChartsLocalizationProvider Props:** + +| Prop | Type | Default | Description | +| :--------- | :-------------------------- | :------ | :----------------------------------- | +| localeText | `Partial` | - | Localized text for chart components. | +| children | `React.ReactNode` | - | - | + +### ChartsReferenceLine + +**ChartsReferenceLine Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------- | :--------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | +| label | `string` | - | The label to display along the reference line. | +| axisId | `AxisId` | ``The `id` of the first defined axis.`` | The id of the axis used for the reference value. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| labelAlign | `'start' \| 'middle' \| 'end'` | `'middle'` | The alignment if the label is in the chart drawing area. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the label. | +| lineStyle | `React.CSSProperties` | - | The style applied to the line. | +| spacing | `number \| { x?: number; y?: number }` | `{ x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line.` | Additional space around the label in px. Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. | +| x | `string \| number \| Date` | - | The x value associated with the reference line. If defined the reference line will be vertical. | +| y | `string \| number \| Date` | - | The y value associated with the reference line. If defined the reference line will be horizontal. | + +### ChartsRenderer + +A component that renders different types of charts based on the provided data and configuration. +It supports column, bar, line, area and pie charts with customizable styling and formatting options. +The component handles both single and multiple dimension datasets, with special data processing for each case. +For multiple dimension datasets, it creates grouped axes. + +**ChartsRenderer Props:** + +| Prop | Type | Default | Description | +| :-------------- | :----------------------------------------------------------------------------------------------------- | :------ | :---------- | +| chartType\* | `string` | - | - | +| configuration\* | `Record` | - | - | +| dimensions\* | `({ id: string; label: string; data: (string \| number \| Date \| null)[] })[]` | - | - | +| onRender | `((type: string, props: Record, Component: React.ComponentType) => React.ReactNode)` | - | - | +| values\* | `({ id: string; label: string; data: (number \| null)[] })[]` | - | - | + +### ChartsSurface + +A helper component that combines `` and `` to provide a surface for drawing charts. +If you need more control over the layers, you can use `` and `` separately. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsSurface API](https://mui.com/x/api/charts/charts-surface/) + +**ChartsSurface Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------- | :------ | :----------------------------------------------------------------------------------------- | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsText + +Helper component to manage multiline text in SVG + +**ChartsText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :---------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text\* | `string` | - | Text displayed. | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### ChartsToolbarImageExportTrigger + +A button that triggers an image export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarImageExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartsToolbarImageExportOptions` | - | The options to apply on the image export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPrintExportTrigger + +A button that triggers a print export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarPrintExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartsToolbarPrintExportOptions` | - | The options to apply on the Print export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPro + +The chart toolbar component for the pro package. + +**ChartsToolbarPro Props:** + +| Prop | Type | Default | Description | +| :----------------- | :---------------------------------- | :------ | :---------- | +| imageExportOptions | `ChartsToolbarImageExportOptions[]` | - | - | +| printOptions | `ChartsToolbarPrintExportOptions` | - | - | + +### ChartsToolbarZoomInTrigger + +A button that zooms the chart in. +It renders the `baseButton` slot. + +**ChartsToolbarZoomInTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarZoomOutTrigger + +A button that zooms the chart out. +It renders the `baseButton` slot. + +**ChartsToolbarZoomOutTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsTooltip + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | Defines the sort order in which series items are displayed in the axis tooltip. When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. Only applies when `trigger='axis'`. | +| trigger | `'axis' \| 'none' \| 'item'` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### ChartsTooltipContainer + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltipContainer Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `TriggerOptions` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | +| children | `React.ReactNode` | - | - | + +### ChartsWebGLLayer + +### ChartsXAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/) + +**ChartsXAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'x'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelMinGap | `number` | `4` | The minimum gap in pixels between two tick labels. If two tick labels are closer than this minimum gap, one of them will be hidden. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsYAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/) + +**ChartsYAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'y'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsZoomSlider + +Renders the zoom slider for all x and y axes that have it enabled. + +### ChartZoomSlider + +### cheerfulFiestaPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ContinuousColorLegend + +**ContinuousColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------------------------------------- | :--------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| gradientId | `string` | `auto-generated id` | The id for the gradient to use. If not provided, it will use the generated gradient from the axis configuration. The `gradientId` will be used as `fill="url(#gradientId)"`. | +| labelPosition | `'start' \| 'end' \| 'extremes'` | `'end'` | Where to position the labels relative to the gradient. | +| maxLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the maximum side of the gradient. Can either be a string, or a function. If not defined, the formatted maximal value is display. | +| minLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the minimum side of the gradient. Can either be a string, or a function. | +| reverse | `boolean` | `false` | If `true`, the gradient and labels will be reversed. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| thickness | `number` | `12` | The thickness of the gradient | +| className | `string` | - | - | + +### cyanPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### defaultOnBeforeExport + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| iframe | `HTMLIFrameElement` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = void; +``` + +### FocusedBar + +### FocusedFunnelSection + +### FocusedHeatmapCell + +### FocusedLineMark + +### FocusedPieArc + +**FocusedPieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color | `string` | - | - | +| cornerRadius | `number` | - | - | +| innerRadius | `number` | - | - | +| outerRadius | `number` | - | - | +| paddingAngle | `number` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | + +### FocusedRadarMark + +### FocusedRangeBar + +### FocusedScatterMark + +### FunnelChart + +**FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### FunnelPlot + +**FunnelPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| slotProps | `FunnelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### Gauge + +**Gauge Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| classes | `Partial` | - | - | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeContainer + +**GaugeContainer Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeReferenceArc + +### GaugeValueArc + +**GaugeValueArc Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------- | :------ | :---------- | +| skipAnimation | `boolean` | - | - | + +### GaugeValueText + +**GaugeValueText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### getLocalizedConfigurationOptions + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------- | :------ | :---------- | +| locale? | `Partial` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = GridChartsConfigurationOptions; +``` + +### getPieCoordinates + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------------------- | :------ | :---------- | +| series | `LegendItemParams` | - | - | +| drawing | `LegendItemParams` | - | - | + +**Return Value:** + +| Property | Type | Description | +| :---------------- | :------- | :---------- | +| `cx` | `number` | - | +| `cy` | `number` | - | +| `availableRadius` | `number` | - | + +### getValueToPositionMapper + +For a given scale return a function that map value to their position. +Useful when dealing with specific scale such as band. + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------------------- | :------ | :--------------- | +| scale | `D3Scale<{ toString: function toString() { [native code] } }, Range>` | - | The scale to use | + +**Return Value:** + +A function that map value to their position + +```tsx +type ReturnValue = (value: any) => number; +``` + +### greenPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Heatmap + +**Heatmap Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, item: SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>) => void)` | - | The callback fired when an item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: HeatmapItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `HeatmapSeries[]` | - | The series to display in the bar chart. An array of \[\[HeatmapSeries]] objects. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| slotProps | `HeatmapSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltip | `ChartsTooltipProps` | - | The configuration of the tooltip. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `HeatmapItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### HeatmapCell + +Demos: + +- [Heatmap](https://mui.com/x/react-charts/heatmap/) + +API: + +- [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/) + +**HeatmapCell Props:** + +| Prop | Type | Default | Description | +| :----------- | :---------------------- | :------ | :---------- | +| height\* | `number` | - | - | +| ownerState\* | `HeatmapCellOwnerState` | - | - | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### HeatmapData + +**Constructor Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| data | `HeatmapValueType[]` | - | - | + +**Methods:** + +```typescript +function getValue(xIndex: number, yIndex: number): number | null; +``` + +### HeatmapPlot + +**HeatmapPlot Props:** + +| Prop | Type | Default | Description | +| :----------- | :--------------------- | :------ | :------------------------------------------------ | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| slotProps | `HeatmapPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### HeatmapPremium + +**HeatmapPremium Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, item: SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>) => void)` | - | The callback fired when an item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: HeatmapItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| renderer | `'svg-single' \| 'webgl'` | - | The type of renderer to use for the heatmap plot. `svg-single`: Renders every scatter item in a `` element.`webgl`: Renders heatmap cells using WebGL for better performance, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/heatmap/#performance | +| series\* | `HeatmapSeries[]` | - | The series to display in the bar chart. An array of \[\[HeatmapSeries]] objects. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| slotProps | `HeatmapSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltip | `ChartsTooltipProps` | - | The configuration of the tooltip. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `HeatmapItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### HeatmapTooltip + +**HeatmapTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### HeatmapTooltipContent + +**HeatmapTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineChartPro + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### mangoFusionPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +### orangePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### PieArc + +**PieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| dataIndex\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| innerRadius\* | `number` | - | - | +| isFaded\* | `boolean` | - | - | +| isFocused\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| outerRadius\* | `number` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | +| startAngle\* | `number` | - | - | + +### PieArcLabel + +**PieArcLabel Props:** + +| Prop | Type | Default | Description | +| :---------------- | :-------------------- | :------ | :---------- | +| hidden | `boolean` | - | - | +| arcLabelRadius\* | `number` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| formattedArcLabel | `string \| null` | - | - | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| startAngle\* | `number` | - | - | + +### PieArcLabelPlot + +**PieArcLabelPlot Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabel | `'formattedValue' \| 'label' \| 'value' \| ((item: { id?: PieItemId; color: string; labelMarkType?: ChartsLabelMarkType; value: number; formattedValue: string; hidden: boolean; label?: string }) => string)` | - | The label displayed into the arc. | +| arcLabelMinAngle | `number` | `0` | The minimal angle required to display the arc label. | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcLabelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcLabelPlotSlots` | `{}` | Overridable component slots. | + +### PieArcPlot + +**PieArcPlot Props:** + +| Prop | Type | Default | Description | +| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcPlotSlots` | `{}` | Overridable component slots. | + +### piecewiseColorDefaultLabelFormatter + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| params | `PiecewiseLabelFormatterParams` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### PiecewiseColorLegend + +**PiecewiseColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------- | :------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :------------------------------------------------------------------ | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| labelFormatter | `((params: PiecewiseLabelFormatterParams) => string \| null)` | - | Format the legend labels. | +| labelPosition | `'start' \| 'end' \| 'extremes' \| 'inline-start' \| 'inline-end'` | `'extremes'` | Where to position the labels relative to the color marks. | +| onItemClick | `((event: React.MouseEvent, legendItem: PiecewiseColorLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| className | `string` | - | - | + +### PieChart + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PieChart API](https://mui.com/x/api/charts/pie-chart/) + +**PieChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PieChartPro + +**PieChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PiePlot + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PiePlot API](https://mui.com/x/api/charts/pie-plot/) + +**PiePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------- | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PiePlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PiePlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### pinkPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### purplePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### RadarAxis + +**RadarAxis Props:** + +| Prop | Type | Default | Description | +| :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| angle | `number` | - | The absolute rotation angle of the metrics (in degree) If not defined the metric angle will be used. | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| divisions | `number` | `1` | The number of divisions with label. | +| dominantBaseline | `'auto' \| 'use-script' \| 'no-change' \| 'reset-size' \| 'ideographic' \| 'alphabetic' \| 'hanging' \| 'mathematical' \| 'central' \| 'middle' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| ((angle: number) => 'auto' \| 'middle' \| 'alphabetic' \| 'hanging' \| 'ideographic' \| 'mathematical' \| 'central' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| 'use-script' \| 'no-change' \| 'reset-size' \| undefined)` | - | The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). | +| labelOrientation | `'horizontal' \| 'rotated'` | `'horizontal'` | Defines how label align with the axis. 'horizontal': labels stay horizontal and their placement change with the axis angle.'rotated': labels are rotated 90deg relatively to their axis. | +| metric | `string` | - | The metric to get. If `undefined`, the hook returns `null` | +| textAnchor | `'start' \| 'middle' \| 'end' \| 'inherit' \| ((angle: number) => 'start' \| 'end' \| 'middle' \| 'inherit' \| undefined)` | - | The labels text anchor or a function returning the text anchor for a given axis angle (in degree). | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarAxisHighlight + +**RadarAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarChart + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarChartPro + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartProSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarDataProvider + +**RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### RadarGrid + +**RadarGrid Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------ | :------------------------------------------------------------------------------------- | :-------------------------------------------------------- | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | + +### RadarMetricLabels + +### RadarSeriesArea + +**RadarSeriesArea Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesMarks + +**RadarSeriesMarks Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesPlot + +**RadarSeriesPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### rainbowSurgePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### RangeBarPlot + +Demos: + +- [Range Bar](https://mui.com/x/react-charts/range-bar/) + +API: + +- [RangeBarPlot API](https://mui.com/x/api/charts/range-bar-plot/) + +**RangeBarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------- | :---------- | :-------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `((event: React.MouseEvent, barItemIdentifier: RangeBarItemIdentifier) => void)` | - | Callback fired when a bar item is clicked. | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `RangeBarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `RangeBarPlotSlots` | `{}` | Overridable component slots. | + +### redPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Scatter + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [Scatter API](https://mui.com/x/api/charts/scatter/) + +**Scatter Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| colorGetter\* | `((dataIndex?: number) => string)` | - | Function to get the color of a scatter item given its data index. The data index argument is optional. If not provided, the color for the entire series is returned. If provided, the color for the specific scatter item is returned. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| series\* | `DefaultizedScatterSeriesType` | - | - | +| slotProps | `ScatterSlotProps` | - | - | +| slots | `ScatterSlots` | - | - | +| xScale\* | `D3Scale` | - | - | +| yScale\* | `D3Scale` | - | - | + +### ScatterChart + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterChartPro + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterMarker + +**ScatterMarker Props:** + +| Prop | Type | Default | Description | +| :-------------- | :------------------------------------------------------------ | :------ | :---------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | Callback fired when clicking on a scatter item. | +| color\* | `string` | - | The fill color of the marker. | +| dataIndex\* | `number` | - | The index of the data point. | +| isFaded\* | `boolean` | - | If `true`, the marker is faded. | +| isHighlighted\* | `boolean` | - | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | The series ID. | +| size\* | `number` | - | The size of the marker. | +| x\* | `number` | - | The x coordinate of the data point. | +| y\* | `number` | - | The y coordinate of the data point. | + +### ScatterPlot + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/) + +**ScatterPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :---------------------------------------------------------------------------------------------------------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| classes | `Partial` | - | - | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| slotProps | `ScatterPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### SparkLineChart + +Demos: + +- [SparkLine](https://mui.com/x/react-charts/sparkline/) + +API: + +- [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/) + +**SparkLineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| area | `boolean` | `false` | Set to `true` to fill spark line area. Has no effect if plotType='bar'. | +| axisHighlight | `ChartsAxisHighlightProps` | - | - | +| baseline | `number \| 'min' \| 'max'` | `0` | The value of the line at the base of the series area. `'min'` the area will fill the space **under** the line.`'max'` the area will fill the space **above** the line.`number` the area will fill the space between this value and the line | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| clipAreaOffset | `{ top?: number; right?: number; bottom?: number; left?: number }` | `{ top: 1, right: 1, bottom: 1, left: 1 }` | The clipped area offset in pixels. This prevents partial clipping of lines when they are drawn on the edge of the drawing area. | +| color | `ChartsColor` | `rainbowSurgePalette[0]` | Color used to colorize the sparkline. | +| curve | `CurveType` | `'linear'` | - | +| data\* | `number[]` | - | Data to plot. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClipping | `boolean` | `false` | When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. | +| disableHitArea | `boolean` | - | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'rangeBar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'rangeBar' } \| { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| { type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'rangeBar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'rangeBar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'ohlc'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'rangeBar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'rangeBar' } \| { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | `5` | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'rangeBar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'rangeBar' } \| { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| { type: 'bar'; seriesId: string; dataIndex?: number } \| { type: 'line'; seriesId: string; dataIndex?: number } \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| { type: 'pie'; seriesId: string; dataIndex?: number } \| { type: 'radar'; seriesId: string; dataIndex?: number } \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| { type: 'rangeBar'; seriesId: string; dataIndex?: number } \| { type: 'ohlc'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking close to an item. This is only available for scatter plot for now. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| LineItemIdentifier \| ScatterItemIdentifier \| PieItemIdentifier \| RadarItemIdentifier \| HeatmapItemIdentifier \| FunnelItemIdentifier \| SankeyItemIdentifier \| RangeBarItemIdentifier \| OHLCItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plotType | `'bar' \| 'line'` | `'line'` | Type of plot used. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'>; line: ChartSeriesTypeConfig<'line'>; scatter: ChartSeriesTypeConfig<'scatter'>; pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> }; radar: ChartSeriesTypeConfig<'radar'>; heatmap: ChartSeriesTypeConfig<'heatmap'>; funnel: ChartSeriesTypeConfig<'funnel'>; sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> }; rangeBar: ChartSeriesTypeConfig<'rangeBar'>; ohlc: ChartSeriesTypeConfig<'ohlc'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showHighlight | `boolean` | `false` | Set to `true` to highlight the value. With line, it shows a point. With bar, it shows a highlight band. | +| showTooltip | `boolean` | `false` | Set to `true` to enable the tooltip in the sparkline. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `SparkLineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SparkLineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| LineItemIdentifier \| LegendItemParams \| ScatterItemIdentifier \| LegendItemParams \| PieItemIdentifier \| LegendItemParams \| RadarItemIdentifier \| LegendItemParams \| HeatmapItemIdentifier \| LegendItemParams \| FunnelItemIdentifier \| LegendItemParams \| SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| RangeBarItemIdentifier \| LegendItemParams \| OHLCItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| valueFormatter | `((value: number \| null) => string)` | `(value: number \| null) => (value === null ? '' : value.toString())` | Formatter used by the tooltip. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `XAxis` | - | The xAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| yAxis | `YAxis` | - | The yAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### strawberrySkyPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Unstable_CandlestickChart + +Demos: + +- [Candlestick](https://mui.com/x/react-charts/candlestick/) + +API: + +- [Unstable_CandlestickChart API](https://mui.com/x/api/charts/candlestick/) + +**Unstable_CandlestickChart Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line', y: 'line' }` | The configuration of axes highlight. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'ohlc'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: OHLCItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `OHLCSeries[]` | - | The series to display in the candlestick chart. An array of \[\[OHLCSeries]] objects. Currently, only one OHLC series is supported. If would like to display more than one OHLC series, open an issue at https\://github.com/mui/mui-x explaining your use case. | +| seriesConfig | `{ ohlc: ChartSeriesTypeConfig<'ohlc'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `CandlestickChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `CandlestickChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `OHLCItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_CandlestickPlot + +### Unstable_FunnelChart + +**Unstable_FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarChart + +**Unstable_RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarDataProvider + +**Unstable_RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### useAnimate + +Hook to customize the animation of an element. +Animates a ref from `initialProps` to `props`. + +**useAnimate Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------- | :------ | :----------------------- | +| props | `{}` | - | The props to animate to. | +| \_\_1 | `UseAnimateParams<{}, Element, {}>` | - | - | + +**useAnimate Return Value:** + +an object containing a ref that should be passed to the element to animate and the transformed props. +If `skip` is true, the transformed props are the `props` to animate to; if it is false, the transformed props are the +`initialProps`. + +The animated props are only accessible in `applyProps`. The props returned from this hook are not animated. + +When an animation starts, an interpolator is created using `createInterpolator`. +On every animation frame: + +1. The interpolator is called to get the interpolated props; +2. `transformProps` is called to transform the interpolated props; +3. `applyProps` is called to apply the transformed props to the element. + +If `props` change while an animation is progress, the animation will continue towards the new `props`. + +The animation can be skipped by setting `skip` to true. If a transition is in progress, it will immediately end +and `applyProps` be called with the final value. If there isn't a transition in progress, a new one won't be +started and `applyProps` will not be called. + +```tsx +type ReturnValue = UseAnimateReturn; +``` + +### useAnimateArea + +Animates an area of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateArea Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateAreaParams` | - | - | + +**useAnimateArea Return Value:** + +```tsx +type ReturnValue = UseAnimatedAreaReturn; +``` + +### useAnimateBar + +Animates a bar from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to its +final position. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBar Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------- | :------ | :---------- | +| props | `UseAnimateBarParams` | - | - | + +**useAnimateBar Return Value:** + +```tsx +type ReturnValue = UseAnimateBarReturnValue; +``` + +### useAnimateBarLabel + +Animates a bar label from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to the +center of the bar it belongs to. +The label is horizontally centered within the bar when the layout is vertical, and vertically centered for laid out +horizontally. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBarLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------- | :------ | :---------- | +| props | `UseAnimateBarLabelParams` | - | - | + +**useAnimateBarLabel Return Value:** + +```tsx +type ReturnValue = UseAnimateBarLabelReturn; +``` + +### useAnimateLine + +Animates a line of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateLine Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateLineParams` | - | - | + +**useAnimateLine Return Value:** + +```tsx +type ReturnValue = UseAnimatedReturnValue; +``` + +### useAnimatePieArc + +Animates a slice of a pie chart by increasing the start and end angles from the middle angle to their final values. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArc Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------- | :------ | :---------- | +| props | `UseAnimatePieArcParams` | - | - | + +**useAnimatePieArc Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcReturnValue; +``` + +### useAnimatePieArcLabel + +Animates the label of pie slice from its middle point to the centroid of the slice. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArcLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------- | :------ | :---------- | +| props | `UseAnimatePieArcLabelParams` | - | - | + +**useAnimatePieArcLabel Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcLabelReturn; +``` + +### useAnimateRangeBar + +Animates a range bar from its center outwards. +The animation only happens in the direction of the numerical axis (x-axis for vertical layout, y-axis for horizontal layout). +The other direction remains constant during the animation. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateRangeBar Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------- | :------ | :---------- | +| props | `UseAnimateRangeBarParams` | - | - | + +**useAnimateRangeBar Return Value:** + +```tsx +type ReturnValue = UseAnimateRangeBarReturnValue; +``` + +### useAxesTooltip + +Returns the axes to display in the tooltip and the series item related to them. + +**useAxesTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| params | `UseAxesTooltipParams` | - | - | + +**useAxesTooltip Return Value:** + +```tsx +type ReturnValue = + | UseAxesTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'radar' | 'heatmap' | 'funnel' | 'rangeBar' | 'ohlc', + string | number | Date + >[] + | null; +``` + +### useBarSeries + +Get access to the internal state of bar series. + +**useBarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useBarSeries Return Value:** + +the bar series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + stackOffset?: StackOffsetType; + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + barLabelPlacement?: 'center' | 'outside'; + stack?: string; + stackOrder?: StackOrderType; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + layout: 'horizontal' | 'vertical'; + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useBarSeriesContext + +Get access to the internal state of bar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useBarSeriesContext Return Value:** + +the bar series + +```tsx +type ReturnValue = SeriesProcessorResult<'bar'> | undefined; +``` + +### useBrush + +Get the current brush state. + +- `start` is the starting point of the brush selection. +- `current` is the current point of the brush selection. + +**useBrush Return Value:** + +`{ start, current }` - The brush state. + +```tsx +type ReturnValue = { start: { x: number; y: number }; current: { x: number; y: number } } | null; +``` + +### useChartApiContext + +The `useChartApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProvider` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject>; +``` + +### useChartCartesianAxis + +**useChartCartesianAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartCartesianAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartClosestPoint + +**useChartClosestPoint Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartClosestPoint Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartGradientId + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +For a gradient that respects the coordinates of the object on which it is applied, use `useChartGradientIdObjectBound` instead. + +**useChartGradientId Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientId Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartGradientIdObjectBound + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +This gradient differs from `useChartGradientId` in that it respects the coordinates of the object on which it is applied. + +**useChartGradientIdObjectBound Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientIdObjectBound Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartHighlight + +**useChartHighlight Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartHighlight Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartId + +Get the unique identifier of the chart. + +**useChartId Return Value:** + +chartId if it exists. + +```tsx +type ReturnValue = string | undefined; +``` + +### useChartInteraction + +**useChartInteraction Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartInteraction Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartPolarAxis + +**useChartPolarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartPolarAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartPremiumApiRef + +Hook that instantiates a \[\[ChartPremiumApiRef]]. +The chart type needs to be given as the generic parameter to narrow down the API to the specific chart type. + +**useChartPremiumApiRef Return Value:** + +```tsx +type ReturnValue = React.RefObject< + | ChartPremiumApi< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition', + ChartAnyPluginSignature[] + > + | undefined +>; +``` + +### useChartProApiContext + +The `useChartProApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProviderPro` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartProApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartProApiRef + +Hook that instantiates a \[\[ChartProApiRef]]. +The chart type needs to be given as the generic parameter to narrow down the API to the specific chart type. + +**useChartProApiRef Return Value:** + +```tsx +type ReturnValue = React.RefObject< + | ChartProApi< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition', + ChartAnyPluginSignature[] + > + | undefined +>; +``` + +### useChartProExport + +**useChartProExport Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProExport Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartProZoom + +**useChartProZoom Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProZoom Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartRootRef + +Get the ref for the root chart element. + +**useChartRootRef Return Value:** + +The root chart element ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLayerContainerRef + +Get the ref for the chart surface element. + +**useChartsLayerContainerRef Return Value:** + +The chart surface ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLocalization + +**useChartsLocalization Return Value:** + +```tsx +type ReturnValue = ChartsLocalizationContextValue; +``` + +### useChartTooltip + +**useChartTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartTooltip Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartVisibilityManager + +**useChartVisibilityManager Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------------------ | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartVisibilityManager Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartZAxis + +**useChartZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartZAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useDataset + +Get access to the dataset used to populate series and axes data. + +**useDataset Return Value:** + +The dataset array if provided, otherwise undefined. + +```tsx +type ReturnValue = Readonly[]> | undefined; +``` + +### useDrawingArea + +Get the drawing area dimensions and coordinates. The drawing area is the area where the chart is rendered. + +It includes the left, top, width, height, bottom, and right dimensions. + +**useDrawingArea Return Value:** + +The drawing area dimensions. + +```tsx +type ReturnValue = ChartDrawingArea; +``` + +### useFocusedItem + +Get the focused item from keyboard navigation. + +**useFocusedItem Return Value:** + +```tsx +type ReturnValue = FocusedItemIdentifier | null; +``` + +### useFunnelSeries + +Get access to the internal state of funnel series. + +**useFunnelSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useFunnelSeries Return Value:** + +the funnel series + +```tsx +type ReturnValue = DefaultizedFunnelSeriesType | undefined; +``` + +### useFunnelSeriesContext + +Get access to the internal state of funnel series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useFunnelSeriesContext Return Value:** + +the funnel series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useGaugeState + +**useGaugeState Return Value:** + +```tsx +type ReturnValue = { + value: number | null; + valueMin: number; + valueMax: number; + startAngle: number; + endAngle: number; + innerRadius: number; + outerRadius: number; + cornerRadius: number; + cx: number; + cy: number; + maxRadius: number; + valueAngle: number | null; +}; +``` + +### useHeatmapSeries + +Get access to the internal state of heatmap series. + +**useHeatmapSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useHeatmapSeries Return Value:** + +the heatmap series + +```tsx +type ReturnValue = DefaultizedHeatmapSeriesType | undefined; +``` + +### useHeatmapSeriesContext + +Get access to the internal state of heatmap series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useHeatmapSeriesContext Return Value:** + +the heatmap series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useIsZoomInteracting + +Get access to the zoom state. + +**useIsZoomInteracting Return Value:** + +Inform the zoom is interacting. + +```tsx +type ReturnValue = boolean; +``` + +### useItemHighlightState + +A hook to check the highlighted state of the item. +This function already calculates that an item is not faded if it is highlighted. + +If you need fine control over the state, use the `useItemHighlightStateGetter` hook instead. + +**useItemHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :------ | :------------------- | +| item | `UseItemHighlightedParams<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>` | - | is the item to check | + +**useItemHighlightState Return Value:** + +the state of the item + +```tsx +type ReturnValue = HighlightState; +``` + +### useItemHighlightStateGetter + +A hook to get a callback that returns the highlight state of an item. + +If you're interested by a single item, consider using `useItemHighlightState`. + +**useItemHighlightStateGetter Return Value:** + +callback to get the highlight state of an item. + +```tsx +type ReturnValue = ( + item: + | SankeyItemIdentifier + | { type: 'bar'; seriesId: string; dataIndex?: number } + | { type: 'line'; seriesId: string; dataIndex?: number } + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | { type: 'pie'; seriesId: string; dataIndex?: number } + | { type: 'radar'; seriesId: string; dataIndex?: number } + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | { type: 'rangeBar'; seriesId: string; dataIndex?: number } + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | null, +) => HighlightState; +``` + +### useItemTooltip + +Returns a config object when the tooltip contains a single item to display. +Some specific charts like radar need more complex structure. Use specific hook like `useRadarItemTooltip` for them. + +**useItemTooltip Return Value:** + +The tooltip item config + +```tsx +type ReturnValue = UseItemTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'pie' | 'heatmap' | 'funnel' | 'sankey' | 'rangeBar' | 'ohlc' +> | null; +``` + +### useLegend + +Get the legend items to display. + +This hook is used by the `ChartsLegend` component. And will return the legend items formatted for display. + +An alternative is to use the `useSeries` hook and format the legend items yourself. + +**useLegend Return Value:** + +legend data + +| Property | Type | Description | +| :------- | :------------------------- | :---------- | +| items | `SeriesLegendItemParams[]` | - | + +### useLineSeries + +Get access to the internal state of line series. + +**useLineSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useLineSeries Return Value:** + +the line series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + baseline?: number | 'min' | 'max'; + stackOffset?: StackOffsetType; + stack?: string; + stackOrder?: StackOrderType; + area?: boolean; + curve?: CurveType; + strictStepCurve?: boolean; + showMark?: boolean | ((params: ShowMarkParams) => boolean); + shape?: MarkShape; + disableHighlight?: boolean; + connectNulls?: boolean; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useLineSeriesContext + +Get access to the internal state of line series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useLineSeriesContext Return Value:** + +the line series + +```tsx +type ReturnValue = SeriesProcessorResult<'line'> | undefined; +``` + +### useOHLCSeries + +Get access to the internal state of OHLC series. + +**useOHLCSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useOHLCSeries Return Value:** + +the OHLC series + +```tsx +type ReturnValue = DefaultizedOHLCSeriesType | undefined; +``` + +### useOHLCSeriesContext + +Get access to the internal state of OHLC series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useOHLCSeriesContext Return Value:** + +the OHLC series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### usePieSeries + +Get access to the internal state of pie series. + +**usePieSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**usePieSeries Return Value:** + +the pie series + +```tsx +type ReturnValue = DefaultizedPieSeriesType | undefined; +``` + +### usePieSeriesContext + +Get access to the internal state of pie series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**usePieSeriesContext Return Value:** + +the pie series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadarAxis + +Returns an array with one item per metric with the different points to label. + +**useRadarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| params | `UseRadarAxisParams` | - | - | + +**useRadarAxis Return Value:** + +```tsx +type ReturnValue = { + metric: string; + angle: number; + center: { x: number; y: number }; + labels: { x: number; y: number; value: number | Date; formattedValue: string }[]; +} | null; +``` + +### useRadarItemTooltip + +Contains an object per value with their content and the label of the associated metric. + +**useRadarItemTooltip Return Value:** + +The tooltip item configs + +```tsx +type ReturnValue = UseRadarItemTooltipReturnValue | null; +``` + +### useRadarSeries + +Get access to the internal state of radar series. + +**useRadarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useRadarSeries Return Value:** + +the radar series + +```tsx +type ReturnValue = DefaultizedRadarSeriesType | undefined; +``` + +### useRadarSeriesContext + +Get access to the internal state of radar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useRadarSeriesContext Return Value:** + +the radar series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadiusAxes + +Get all the radius axes for polar charts. + +Returns all radial axes configured in polar charts along with their IDs. +Radius axes are used in charts like `RadarChart` to define radial positioning and scaling. + +**useRadiusAxes Return Value:** + +An object containing: + +- `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `radiusAxisIds`: An array of all radius axis IDs in the chart + +| Property | Type | Description | +| :------------ | :--------------------------------------------- | :---------- | +| radiusAxis | `DefaultizedAxisConfig` | - | +| radiusAxisIds | `string[]` | - | + +### useRadiusAxis + +Get a specific radius axis or the default radius axis for polar charts. + +Returns the configuration and scale for a radial axis in polar charts. +The radius axis controls the radial distance of data points from the center of the circle. + +**useRadiusAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's radius axis configurationUndefined to get the default (first) radius axis | + +**useRadiusAxis Return Value:** + +The radius axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRadiusAxisProps + > + | undefined; +``` + +### useRadiusScale + +Get the radius scale. + +**useRadiusScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `radiusAxis` propUndefined to get the default radius axis | + +**useRadiusScale Return Value:** + +The radius axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useRangeBarSeries + +Get access to the internal state of range bar series. + +**useRangeBarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useRangeBarSeries Return Value:** + +the range bar series + +```tsx +type ReturnValue = DefaultizedRangeBarSeriesType | undefined; +``` + +### useRangeBarSeriesContext + +Get access to the internal state of range bar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useRangeBarSeriesContext Return Value:** + +the range bar series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRotationAxes + +Get all the rotation axes for polar charts. + +Returns all rotation axes configured in polar charts along with their IDs. +Rotation axes are used in charts like `RadarChart` to define angular positioning. + +**useRotationAxes Return Value:** + +An object containing: + +- `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `rotationAxisIds`: An array of all rotation axis IDs in the chart + +| Property | Type | Description | +| :-------------- | :----------------------------------------------- | :---------- | +| rotationAxis | `DefaultizedAxisConfig` | - | +| rotationAxisIds | `string[]` | - | + +### useRotationAxis + +Get a specific rotation axis or the default rotation axis for polar charts. + +Returns the configuration and scale for a rotation axis in polar charts. +The rotation axis controls the angular positioning of data points around the circle. + +**useRotationAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's rotation axis configurationUndefined to get the default (first) rotation axis | + +**useRotationAxis Return Value:** + +The rotation axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRotationAxisProps + > + | undefined; +``` + +### useRotationScale + +Get the rotation scale. + +**useRotationScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `rotationAxis` propUndefined to get the default rotation axis | + +**useRotationScale Return Value:** + +The rotation axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useScatterSeries + +Get access to the internal state of scatter series. + +**useScatterSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useScatterSeries Return Value:** + +the scatter series + +```tsx +type ReturnValue = DefaultizedScatterSeriesType | undefined; +``` + +### useScatterSeriesContext + +Get access to the internal state of scatter series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useScatterSeriesContext Return Value:** + +the scatter series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useSeries + +Get access to the internal state of series. +Structured by type of series: +{ seriesType?: { series: { id1: precessedValue, ... }, seriesOrder: \[id1, ...] } } + +**useSeries Return Value:** + +FormattedSeries series + +```tsx +type ReturnValue = ProcessedSeries; +``` + +### useXAxes + +Get all the x-axes. + +Returns all X axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useXAxes Return Value:** + +An object containing: + +- `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `xAxisIds`: An array of all X axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| xAxis | `ComputedAxisConfig` | - | +| xAxisIds | `AxisId[]` | - | + +### useXAxis + +Get a specific X axis or the default X axis. + +**useXAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXAxis Return Value:** + +The configuration for a single X axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsXAxisProps +>; +``` + +### useXAxisCoordinates + +Get the coordinates of the given X axis. The coordinates are relative to the SVG's origin. + +**useXAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisCoordinates Return Value:** + +The coordinates of the X axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useXAxisTicks + +Returns the ticks for the given X axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useXAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useXColorScale + +Get the X axis color scale. + +**useXColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useXColorScale Return Value:** + +The color scale for the specified X axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useXScale + +Get the X scale. + +**useXScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXScale Return Value:** + +The X axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useYAxes + +Get all the y-axes. + +Returns all Y axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useYAxes Return Value:** + +An object containing: + +- `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `yAxisIds`: An array of all Y axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| yAxis | `ComputedAxisConfig` | - | +| yAxisIds | `AxisId[]` | - | + +### useYAxis + +Get a specific Y axis or the default Y axis. + +**useYAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYAxis Return Value:** + +The configuration for a single Y axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsYAxisProps +>; +``` + +### useYAxisCoordinates + +Returns the coordinates of the given Y axis. The coordinates are relative to the SVG's origin. + +**useYAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisCoordinates Return Value:** + +The coordinates of the Y axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useYAxisTicks + +Returns the ticks for the given Y axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useYAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useYColorScale + +Get the Y axis color scale. + +**useYColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useYColorScale Return Value:** + +The color scale for the specified Y axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useYScale + +Get the Y scale. + +**useYScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYScale Return Value:** + +The Y axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useZAxes + +**useZAxes Return Value:** + +| Property | Type | Description | +| :------- | :----------------------- | :---------- | +| zAxis | `DefaultizedZAxisConfig` | - | +| zAxisIds | `AxisId[]` | - | + +### useZAxis + +**useZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :--------- | :----------------- | :------ | :---------- | +| identifier | `number \| string` | - | - | + +**useZAxis Return Value:** + +```tsx +type ReturnValue = ZAxisDefaultized; +``` + +### useZColorScale + +Get the Z axis color scale. + +**useZColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useZColorScale Return Value:** + +The color scale for the specified Z axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### yellowPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +## Additional Types + +### AllSeriesType + +```typescript +type AllSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | MakeOptional[] + | number[] + | FunnelValueType[] + | SankeyData + | (RangeBarValueType | null)[] + | (OHLCValueType | null)[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter> + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null) + | SeriesValueFormatter + | ((value: number | null, context: { dataIndex: number; field: OHLCField }) => string | null); + /** The id of this series. */ + id?: SeriesId; +}; +``` + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AXIS_LABEL_DEFAULT_HEIGHT + +```typescript +type AXIS_LABEL_DEFAULT_HEIGHT = 20; +``` + +### axisClasses + +```typescript +type axisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### AxisConfig + +Use this type for advanced typing. For basic usage, use `XAxis`, `YAxis`, `RotationAxis` or `RadiusAxis`. + +```typescript +type AxisConfig = { offset?: number } & CommonAxisConfig & { min?: NumberValue; max?: NumberValue } | {} & Omit, 'axisId'> & Partial | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig }, 'scale'>> & AxisSideConfig & TickParams & AxisConfigExtension +``` + +### AxisCoordinates + +```typescript +type AxisCoordinates = { left: number; top: number; right: number; bottom: number }; +``` + +### AxisItemIdentifier + +Identifies a data point within an axis. + +```typescript +type AxisItemIdentifier = { + /** The axis id. */ + axisId: AxisId; + /** The data index. */ + dataIndex: number; +}; +``` + +### AxisValueFormatterContext + +```typescript +type AxisValueFormatterContext< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', +> = + | { location: 'legend' } + | { + location: 'tooltip' | 'zoom-slider-tooltip'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + } + | { + location: 'tick'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + defaultTickLabel: string; + tickNumber?: number; + }; +``` + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BAR_CHART_PREMIUM_PLUGINS + +```typescript +type BAR_CHART_PREMIUM_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BAR_CHART_PRO_PLUGINS + +```typescript +type BAR_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartPremiumPluginSignatures + +```typescript +type BarChartPremiumPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartPremiumProps + +````typescript +type BarChartPremiumProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartPremiumSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartPremiumSlotProps; + /** Callback fired when a bar or range bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] or [[RangeBarSeries]] objects. + */ + series: (RangeBarSeriesType | BarSeries)[]; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartPremiumSlotProps + +```typescript +type BarChartPremiumSlotProps = { + bar?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + barLabel?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartPremiumSlots + +```typescript +type BarChartPremiumSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### BarChartProPluginSignatures + +```typescript +type BarChartProPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartProProps + +````typescript +type BarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartProSlotProps + +```typescript +type BarChartProSlotProps = { + bar?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + barLabel?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartProSlots + +```typescript +type BarChartProSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'label' | 'root' | 'series' | 'element' | 'seriesLabels' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + seriesId: string; + dataIndex: number; + color: string; + classes?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarItemIdentifier + +An object that allows to identify a single bar. +Used for item interaction + +```typescript +type BarItemIdentifier = { type: 'bar'; seriesId: string; dataIndex: number }; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +### BarSeriesType + +```typescript +type BarSeriesType = { + type: 'bar'; + /** Data associated to each bar. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize?: number; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### BarValueType + +```typescript +type BarValueType = number; +``` + +### blueberryTwilightPaletteDark + +```typescript +type blueberryTwilightPaletteDark = string[]; +``` + +### blueberryTwilightPaletteLight + +```typescript +type blueberryTwilightPaletteLight = string[]; +``` + +### bluePaletteDark + +```typescript +type bluePaletteDark = string[]; +``` + +### bluePaletteLight + +```typescript +type bluePaletteLight = string[]; +``` + +### CandlestickChartProps + +````typescript +type CandlestickChartProps = { + /** + * The series to display in the candlestick chart. + * An array of [[OHLCSeries]] objects. + * + * Currently, only one OHLC series is supported. If would like to display more than one OHLC + * series, open an issue at https://github.com/mui/mui-x explaining your use case. + */ + series: OHLCSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line', y: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: CandlestickChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: CandlestickChartSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: OHLCItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: OHLCItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { ohlc: ChartSeriesTypeConfig<'ohlc'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'ohlc'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'ohlc'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### CandlestickChartSlotProps + +```typescript +type CandlestickChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### CandlestickChartSlots + +```typescript +type CandlestickChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### CandlestickPlotProps + +```typescript +type CandlestickPlotProps = {}; +``` + +### CartesianChartSeriesType + +```typescript +type CartesianChartSeriesType = + | 'bar' + | 'line' + | 'scatter' + | 'heatmap' + | 'funnel' + | 'rangeBar' + | 'ohlc'; +``` + +### CategoryAxis + +```typescript +type CategoryAxis = { + /** + * The categories to be displayed on the axis. + * The order of the categories is the order in which they are displayed. + */ + categories?: string[]; + /** + * The position of the axis. + * - 'left' - The axis is positioned on the left side of the chart. + * - 'right' - The axis is positioned on the right side of the chart. + * - 'top' - The axis is positioned on the top side of the chart. + * - 'bottom' - The axis is positioned on the bottom side of the chart. + * - 'none' - The axis is not displayed. + */ + position?: 'left' | 'right' | 'top' | 'bottom' | 'none'; + /** + * The size of the axis. + * - If the axis is horizontal, the size is the height of the axis. + * - If the axis is vertical, the size is the width of the axis. + * - If set to `'auto'`, the size is automatically calculated based on tick label measurements. + */ + size?: number | 'auto'; + scaleType?: 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### ChartApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartApi< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'composition' | undefined = undefined, + TSignatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### chartAxisZoomSliderThumbClasses + +```typescript +type chartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClasses + +```typescript +type ChartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClassKey + +```typescript +type ChartAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartAxisZoomSliderTrackClasses + +```typescript +type chartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClasses + +```typescript +type ChartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClassKey + +```typescript +type ChartAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartBaseButtonProps + +```typescript +type ChartBaseButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; +``` + +### ChartBaseCommonProps + +```typescript +type ChartBaseCommonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +}; +``` + +### ChartBaseIconButtonProps + +```typescript +type ChartBaseIconButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; +}; +``` + +### ChartBaseIconProps + +```typescript +type ChartBaseIconProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +``` + +### ChartDrawingArea + +```typescript +type ChartDrawingArea = { + /** The gap between the left border of the SVG and the drawing area. */ + left: number; + /** The gap between the top border of the SVG and the drawing area. */ + top: number; + /** The gap between the bottom border of the SVG and the drawing area. */ + bottom: number; + /** The gap between the right border of the SVG and the drawing area. */ + right: number; + /** The width of the drawing area. */ + width: number; + /** The height of the drawing area. */ + height: number; +}; +``` + +### ChartPremiumApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartPremiumApi< + ChartType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition' + | undefined = undefined, + Signatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### ChartProApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartProApi< + ChartType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition' + | undefined = undefined, + Signatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### ChartsAxisClasses + +```typescript +type ChartsAxisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### ChartsAxisClassKey + +```typescript +type ChartsAxisClassKey = + | 'line' + | 'label' + | 'tick' + | 'bottom' + | 'left' + | 'right' + | 'top' + | 'root' + | 'tickContainer' + | 'tickLabel' + | 'directionX' + | 'directionY'; +``` + +### ChartsAxisData + +The data format returned by onAxisClick. + +```typescript +type ChartsAxisData = { + /** The index in the axis' data property. */ + dataIndex: number; + /** Tha value associated to the axis item. */ + axisValue: number | Date | string; + /** The mapping of series ids to their value for this particular axis index. */ + seriesValues: Record; +}; +``` + +### chartsAxisHighlightClasses + +```typescript +type chartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClasses + +```typescript +type ChartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClassKey + +```typescript +type ChartsAxisHighlightClassKey = 'root'; +``` + +### ChartsAxisHighlightPath + +```typescript +type ChartsAxisHighlightPath = StyledComponent< + MUIStyledCommonProps & { ownerState: { axisHighlight: ChartsAxisHighlightType } }, + Pick< + React.SVGProps, + | 'string' + | 'id' + | 'min' + | 'max' + | 'type' + | 'color' + | 'scale' + | 'className' + | 'offset' + | 'end' + | 'height' + | 'x' + | 'style' + | 'width' + | 'ref' + | 'dominantBaseline' + | 'suppressHydrationWarning' + | 'lang' + | 'media' + | 'method' + | 'name' + | 'nonce' + | 'part' + | 'slot' + | 'target' + | 'role' + | 'tabIndex' + | 'crossOrigin' + | 'accentHeight' + | 'accumulate' + | 'additive' + | 'alignmentBaseline' + | 'allowReorder' + | 'alphabetic' + | 'amplitude' + | 'arabicForm' + | 'ascent' + | 'attributeName' + | 'attributeType' + | 'autoReverse' + | 'azimuth' + | 'baseFrequency' + | 'baselineShift' + | 'baseProfile' + | 'bbox' + | 'begin' + | 'bias' + | 'by' + | 'calcMode' + | 'capHeight' + | 'clip' + | 'clipPath' + | 'clipPathUnits' + | 'clipRule' + | 'colorInterpolation' + | 'colorInterpolationFilters' + | 'colorProfile' + | 'colorRendering' + | 'contentScriptType' + | 'contentStyleType' + | 'cursor' + | 'cx' + | 'cy' + | 'd' + | 'decelerate' + | 'descent' + | 'diffuseConstant' + | 'direction' + | 'display' + | 'divisor' + | 'dur' + | 'dx' + | 'dy' + | 'edgeMode' + | 'elevation' + | 'enableBackground' + | 'exponent' + | 'externalResourcesRequired' + | 'fill' + | 'fillOpacity' + | 'fillRule' + | 'filter' + | 'filterRes' + | 'filterUnits' + | 'floodColor' + | 'floodOpacity' + | 'focusable' + | 'fontFamily' + | 'fontSize' + | 'fontSizeAdjust' + | 'fontStretch' + | 'fontStyle' + | 'fontVariant' + | 'fontWeight' + | 'format' + | 'fr' + | 'from' + | 'fx' + | 'fy' + | 'g1' + | 'g2' + | 'glyphName' + | 'glyphOrientationHorizontal' + | 'glyphOrientationVertical' + | 'glyphRef' + | 'gradientTransform' + | 'gradientUnits' + | 'hanging' + | 'horizAdvX' + | 'horizOriginX' + | 'href' + | 'ideographic' + | 'imageRendering' + | 'in2' + | 'in' + | 'intercept' + | 'k1' + | 'k2' + | 'k3' + | 'k4' + | 'k' + | 'kernelMatrix' + | 'kernelUnitLength' + | 'kerning' + | 'keyPoints' + | 'keySplines' + | 'keyTimes' + | 'lengthAdjust' + | 'letterSpacing' + | 'lightingColor' + | 'limitingConeAngle' + | 'local' + | 'markerEnd' + | 'markerHeight' + | 'markerMid' + | 'markerStart' + | 'markerUnits' + | 'markerWidth' + | 'mask' + | 'maskContentUnits' + | 'maskUnits' + | 'mathematical' + | 'mode' + | 'numOctaves' + | 'opacity' + | 'operator' + | 'order' + | 'orient' + | 'orientation' + | 'origin' + | 'overflow' + | 'overlinePosition' + | 'overlineThickness' + | 'paintOrder' + | 'panose1' + | 'path' + | 'pathLength' + | 'patternContentUnits' + | 'patternTransform' + | 'patternUnits' + | 'pointerEvents' + | 'points' + | 'pointsAtX' + | 'pointsAtY' + | 'pointsAtZ' + | 'preserveAlpha' + | 'preserveAspectRatio' + | 'primitiveUnits' + | 'r' + | 'radius' + | 'refX' + | 'refY' + | 'renderingIntent' + | 'repeatCount' + | 'repeatDur' + | 'requiredExtensions' + | 'requiredFeatures' + | 'restart' + | 'result' + | 'rotate' + | 'rx' + | 'ry' + | 'seed' + | 'shapeRendering' + | 'slope' + | 'spacing' + | 'specularConstant' + | 'specularExponent' + | 'speed' + | 'spreadMethod' + | 'startOffset' + | 'stdDeviation' + | 'stemh' + | 'stemv' + | 'stitchTiles' + | 'stopColor' + | 'stopOpacity' + | 'strikethroughPosition' + | 'strikethroughThickness' + | 'stroke' + | 'strokeDasharray' + | 'strokeDashoffset' + | 'strokeLinecap' + | 'strokeLinejoin' + | 'strokeMiterlimit' + | 'strokeOpacity' + | 'strokeWidth' + | 'surfaceScale' + | 'systemLanguage' + | 'tableValues' + | 'targetX' + | 'targetY' + | 'textAnchor' + | 'textDecoration' + | 'textLength' + | 'textRendering' + | 'to' + | 'transform' + | 'u1' + | 'u2' + | 'underlinePosition' + | 'underlineThickness' + | 'unicode' + | 'unicodeBidi' + | 'unicodeRange' + | 'unitsPerEm' + | 'vAlphabetic' + | 'values' + | 'vectorEffect' + | 'version' + | 'vertAdvY' + | 'vertOriginX' + | 'vertOriginY' + | 'vHanging' + | 'vIdeographic' + | 'viewBox' + | 'viewTarget' + | 'visibility' + | 'vMathematical' + | 'widths' + | 'wordSpacing' + | 'writingMode' + | 'x1' + | 'x2' + | 'xChannelSelector' + | 'xHeight' + | 'xlinkActuate' + | 'xlinkArcrole' + | 'xlinkHref' + | 'xlinkRole' + | 'xlinkShow' + | 'xlinkTitle' + | 'xlinkType' + | 'xmlBase' + | 'xmlLang' + | 'xmlns' + | 'xmlnsXlink' + | 'xmlSpace' + | 'y1' + | 'y2' + | 'y' + | 'yChannelSelector' + | 'z' + | 'zoomAndPan' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + >, + {} +>; +``` + +### ChartsAxisHighlightProps + +```typescript +type ChartsAxisHighlightProps = { x?: ChartsAxisHighlightType; y?: ChartsAxisHighlightType }; +``` + +### ChartsAxisHighlightType + +```typescript +type ChartsAxisHighlightType = 'none' | 'line' | 'band'; +``` + +### ChartsAxisProps + +```typescript +type ChartsAxisProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsAxisSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsAxisSlotProps; +}; +``` + +### ChartsAxisSlotProps + +```typescript +type ChartsAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsAxisSlots + +```typescript +type ChartsAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsAxisTooltipContentClasses + +```typescript +type ChartsAxisTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsAxisTooltipContentProps + +```typescript +type ChartsAxisTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; + /** + * The sort in which series items are displayed in the tooltip. + * When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### chartsAxisZoomSliderThumbClasses + +```typescript +type chartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClasses + +```typescript +type ChartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClassKey + +```typescript +type ChartsAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartsAxisZoomSliderTrackClasses + +```typescript +type chartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClasses + +```typescript +type ChartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClassKey + +```typescript +type ChartsAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartsBaseSlots + +```typescript +type ChartsBaseSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### ChartsClipPathProps + +```typescript +type ChartsClipPathProps = { + /** The id of the clip path. */ + id: string; + /** + * Offset, in pixels, of the clip path rectangle from the drawing area. + * + * A positive value will move the rectangle outside the drawing area. + */ + offset?: { top?: number; right?: number; bottom?: number; left?: number }; +}; +``` + +### ChartsColor + +```typescript +type ChartsColor = string | ChartsColorCallback; +``` + +### ChartsColorPalette + +```typescript +type ChartsColorPalette = string[] | ChartsColorPaletteCallback; +``` + +### ChartsContainerPremiumProps + +```typescript +type ChartsContainerPremiumProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsContainerPremiumSlotProps + +```typescript +type ChartsContainerPremiumSlotProps = {}; +``` + +### ChartsContainerPremiumSlots + +```typescript +type ChartsContainerPremiumSlots = {}; +``` + +### ChartsContainerProProps + +```typescript +type ChartsContainerProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsDataProviderPremiumProps + +```typescript +type ChartsDataProviderPremiumProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderPremiumSlotProps + +```typescript +type ChartsDataProviderPremiumSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderPremiumSlots + +```typescript +type ChartsDataProviderPremiumSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### ChartsDataProviderProProps + +```typescript +type ChartsDataProviderProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProps + +```typescript +type ChartsDataProviderProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartPolarAxisSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartInteractionSignature, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + UseChartClosestPointSignature, + UseChartKeyboardNavigationSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProSlotProps + +```typescript +type ChartsDataProviderProSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderProSlots + +```typescript +type ChartsDataProviderProSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### ChartsDataProviderSlotProps + +```typescript +type ChartsDataProviderSlotProps = { + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ChartsDataProviderSlots + +```typescript +type ChartsDataProviderSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### chartsGridClasses + +```typescript +type chartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClasses + +```typescript +type ChartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClassKey + +```typescript +type ChartsGridClassKey = 'line' | 'root' | 'horizontalLine' | 'verticalLine'; +``` + +### ChartsGridProps + +```typescript +type ChartsGridProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Displays vertical grid. */ + vertical?: boolean; + /** Displays horizontal grid. */ + horizontal?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### ChartsIconSlots + +```typescript +type ChartsIconSlots = {}; +``` + +### ChartsItemTooltipContentClasses + +```typescript +type ChartsItemTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsItemTooltipContentProps + +```typescript +type ChartsItemTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; +}; +``` + +### ChartsLabel + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabel = unknown; +``` + +### ChartsLabelClasses + +```typescript +type ChartsLabelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsLabelCustomMarkProps + +```typescript +type ChartsLabelCustomMarkProps = { + className?: string; + /** Color of the series this mark refers to. */ + color?: string; +}; +``` + +### ChartsLabelGradientClasses + +```typescript +type ChartsLabelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### ChartsLabelMark + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabelMark = unknown; +``` + +### ChartsLabelMarkClasses + +```typescript +type ChartsLabelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### ChartsLabelMarkProps + +```typescript +type ChartsLabelMarkProps = { + /** + * The type of the mark. + * @default 'square' + */ + type?: ChartsLabelMarkType; + /** + * The mark will be rendered as a combination of a line and the specified mark type. + * The line will be rendered first, followed by the mark. + * Only used if `type='line+mark'`. + */ + markShape?: MarkShape; + /** The color of the mark. */ + color?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLabelProps + +```typescript +type ChartsLabelProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLegendClasses + +```typescript +type ChartsLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### ChartsLegendPosition + +```typescript +type ChartsLegendPosition = { + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; +}; +``` + +### ChartsLegendProps + +```typescript +type ChartsLegendProps = { + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * If `true`, clicking on a legend item will toggle the visibility of the corresponding series. + * @default false + */ + toggleVisibilityOnClick?: boolean; + className?: string; + sx?: SxProps; + tabIndex?: number; +}; +``` + +### ChartsLegendSlotExtension + +```typescript +type ChartsLegendSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsLegendSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsLegendSlotProps; +}; +``` + +### ChartsLegendSlotProps + +```typescript +type ChartsLegendSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; +}; +``` + +### ChartsLegendSlots + +```typescript +type ChartsLegendSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; +}; +``` + +### ChartsLocalizationProviderProps + +```typescript +type ChartsLocalizationProviderProps = { + children?: React.ReactNode; + /** Localized text for chart components. */ + localeText?: Partial; +}; +``` + +### ChartsPieSorting + +```typescript +type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number); +``` + +### ChartsReferenceLineClasses + +```typescript +type ChartsReferenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### ChartsReferenceLineClassKey + +```typescript +type ChartsReferenceLineClassKey = 'line' | 'label' | 'root' | 'horizontal' | 'vertical'; +``` + +### ChartsReferenceLineProps + +```typescript +type ChartsReferenceLineProps = ( + | { x?: undefined; y: string | number | Date } + | { y?: undefined; x: string | number | Date } +) & { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### ChartsRendererProps + +```typescript +type ChartsRendererProps = { + dimensions: { id: string; label: string; data: (string | number | Date | null)[] }[]; + values: { id: string; label: string; data: (number | null)[] }[]; + chartType: string; + configuration: Record; + onRender?: ( + type: string, + props: Record, + Component: React.ComponentType, + ) => React.ReactNode; +}; +``` + +### chartsSurfaceClasses + +```typescript +type chartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceClasses + +```typescript +type ChartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceProps + +```typescript +type ChartsSurfaceProps = { + className?: string; + sx?: SxProps; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; +}; +``` + +### ChartsTextProps + +```typescript +type ChartsTextProps = { + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** Text displayed. */ + text: string; + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### ChartsTextStyle + +```typescript +type ChartsTextStyle = { + angle?: number; + /** + * The text baseline + * @default 'central' + */ + dominantBaseline?: ChartsTextBaseline; + /** + * The text anchor + * @default 'middle' + */ + textAnchor?: ChartsTextAnchor; +}; +``` + +### ChartsToolbarImageExportOptions + +```typescript +type ChartsToolbarImageExportOptions = { + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; + /** + * The quality of the image to be exported between 0 and 1. This is only applicable for lossy formats, such as + * 'image/jpeg' and 'image/webp'. 'image/png' does not support this option. + * @default 0.9 + */ + quality?: number; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * The format of the image to be exported. + * Browsers are required to support 'image/png'. Some browsers also support 'image/jpeg' and 'image/webp'. + * If the provided `type` is not supported by the browser, it will default to 'image/png'. + * @default 'image/png' + */ + type: string; +}; +``` + +### ChartsToolbarImageExportTriggerProps + +```typescript +type ChartsToolbarImageExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartsToolbarImageExportOptions; +}; +``` + +### ChartsToolbarPrintExportOptions + +```typescript +type ChartsToolbarPrintExportOptions = { + /** + * If `true`, this export option will be removed from the ChartsToolbarExport menu. + * @default false + */ + disableToolbarButton?: boolean; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartsToolbarPrintExportTriggerProps + +```typescript +type ChartsToolbarPrintExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartPrintExportOptions; +}; +``` + +### ChartsToolbarProProps + +```typescript +type ChartsToolbarProProps = { + printOptions?: ChartsToolbarPrintExportOptions; + imageExportOptions?: ChartsToolbarImageExportOptions[]; +}; +``` + +### ChartsToolbarProSlotProps + +```typescript +type ChartsToolbarProSlotProps = { + /** Props for the toolbar component. */ + toolbar?: Partial; +}; +``` + +### ChartsToolbarProSlots + +```typescript +type ChartsToolbarProSlots = { + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipCell + +```typescript +type ChartsTooltipCell = StyledComponent< + Pick< + TypographyOwnProps & + CommonProps & + Omit< + React.DetailedHTMLProps, HTMLSpanElement>, + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'children' + | 'variant' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + >, + | 'id' + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'ref' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + | 'content' + | 'translate' + | 'hidden' + | 'variant' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + > & + MUIStyledCommonProps & { component?: React.ElementType }, + {}, + {} +>; +``` + +### chartsTooltipClasses + +```typescript +type chartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClasses + +```typescript +type ChartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClassKey + +```typescript +type ChartsTooltipClassKey = 'root' | 'paper' | 'table' | 'row' | 'cell' | 'mark' | 'axisValueCell'; +``` + +### ChartsTooltipContainerClasses + +```typescript +type ChartsTooltipContainerClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipContainerProps + +```typescript +type ChartsTooltipContainerProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + children?: React.ReactNode; +}; +``` + +### ChartsTooltipContainerSlotProps + +```typescript +type ChartsTooltipContainerSlotProps = {}; +``` + +### ChartsTooltipContainerSlots + +```typescript +type ChartsTooltipContainerSlots = {}; +``` + +### ChartsTooltipPaper + +```typescript +type ChartsTooltipPaper = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLDivElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipProps + +```typescript +type ChartsTooltipProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'axis' | 'none' | 'item'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * Defines the sort order in which series items are displayed in the axis tooltip. + * When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. + * Only applies when `trigger='axis'`. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### ChartsTooltipRow + +```typescript +type ChartsTooltipRow = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableRowElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipSlotProps + +```typescript +type ChartsTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial>; +}; +``` + +### ChartsTooltipSlots + +```typescript +type ChartsTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ChartsTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipTable + +```typescript +type ChartsTooltipTable = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'width' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'border' + | 'bgcolor' + | 'hidden' + | 'title' + | 'summary' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'cellPadding' + | 'cellSpacing' + | 'frame' + | 'rules' + >, + {} +>; +``` + +### ChartsTypeFeatureFlags + +```typescript +type ChartsTypeFeatureFlags = {}; +``` + +### ChartsXAxisProps + +```typescript +type ChartsXAxisProps = { + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsXAxisSlotProps + +```typescript +type ChartsXAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsXAxisSlots + +```typescript +type ChartsXAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsXReferenceLineProps + +```typescript +type ChartsXReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The x value associated with the reference line. + * If defined the reference line will be vertical. + */ + x: TValue; +}; +``` + +### ChartsYAxisProps + +```typescript +type ChartsYAxisProps = { + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsYAxisSlotProps + +```typescript +type ChartsYAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsYAxisSlots + +```typescript +type ChartsYAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsYReferenceLineProps + +```typescript +type ChartsYReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The y value associated with the reference line. + * If defined the reference line will be horizontal. + */ + y: TValue; +}; +``` + +### cheerfulFiestaPaletteDark + +```typescript +type cheerfulFiestaPaletteDark = string[]; +``` + +### cheerfulFiestaPaletteLight + +```typescript +type cheerfulFiestaPaletteLight = string[]; +``` + +### ColorLegendSelector + +```typescript +type ColorLegendSelector = { + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### ComputedPieRadius + +Props received when the parent components has done the percentage conversion. + +```typescript +type ComputedPieRadius = { + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### configurationOptions + +```typescript +type configurationOptions = { + [key: string]: { + label: string; + icon: (props: any) => React.ReactNode; + customization: GridChartsConfigurationSection[]; + dimensionsLabel?: string; + valuesLabel?: string; + maxDimensions?: number; + maxValues?: number; + }; +}; +``` + +### continuousColorLegendClasses + +```typescript +type continuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendClasses + +```typescript +type ContinuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendProps + +```typescript +type ContinuousColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * The label to display at the minimum side of the gradient. + * Can either be a string, or a function. + * @default formattedValue + */ + minLabel?: string | LabelFormatter; + /** + * The label to display at the maximum side of the gradient. + * Can either be a string, or a function. + * If not defined, the formatted maximal value is display. + * @default formattedValue + */ + maxLabel?: string | LabelFormatter; + /** + * The id for the gradient to use. + * If not provided, it will use the generated gradient from the axis configuration. + * The `gradientId` will be used as `fill="url(#gradientId)"`. + * @default auto-generated id + */ + gradientId?: string; + /** + * Where to position the labels relative to the gradient. + * @default 'end' + */ + labelPosition?: 'start' | 'end' | 'extremes'; + /** + * If `true`, the gradient and labels will be reversed. + * @default false + */ + reverse?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; + /** + * The thickness of the gradient + * @default 12 + */ + thickness?: number; +}; +``` + +### ContinuousScaleName + +```typescript +type ContinuousScaleName = 'linear' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc'; +``` + +### CurveType + +The type of curve to use for the line. +Read more about curves at +[line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + +```typescript +type CurveType = + | 'catmullRom' + | 'linear' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepBefore' + | 'stepAfter' + | 'bumpY' + | 'bumpX'; +``` + +### cyanPaletteDark + +```typescript +type cyanPaletteDark = string[]; +``` + +### cyanPaletteLight + +```typescript +type cyanPaletteLight = string[]; +``` + +### DEFAULT_AXIS_SIZE_HEIGHT + +```typescript +type DEFAULT_AXIS_SIZE_HEIGHT = 25; +``` + +### DEFAULT_AXIS_SIZE_WIDTH + +```typescript +type DEFAULT_AXIS_SIZE_WIDTH = 45; +``` + +### DEFAULT_MARGINS + +```typescript +type DEFAULT_MARGINS = { top: number; bottom: number; left: number; right: number }; +``` + +### DEFAULT_RADIUS_AXIS_KEY + +```typescript +type DEFAULT_RADIUS_AXIS_KEY = 'DEFAULT_RADIUS_AXIS_KEY'; +``` + +### DEFAULT_ROTATION_AXIS_KEY + +```typescript +type DEFAULT_ROTATION_AXIS_KEY = 'DEFAULT_ROTATION_AXIS_KEY'; +``` + +### DEFAULT_X_AXIS_KEY + +```typescript +type DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY'; +``` + +### DEFAULT_Y_AXIS_KEY + +```typescript +type DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY'; +``` + +### DefaultizedBarSeriesType + +```typescript +type DefaultizedBarSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; +}; +``` + +### DefaultizedFunnelSeriesType + +```typescript +type DefaultizedFunnelSeriesType = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### DefaultizedHeatmapSeriesType + +```typescript +type DefaultizedHeatmapSeriesType = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### DefaultizedLineSeriesType + +```typescript +type DefaultizedLineSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedOHLCSeriesType + +```typescript +type DefaultizedOHLCSeriesType = { + hidden: boolean; + /** The color of the candle body when the close price is greater than or equal to the open price. */ + upColor: string; + /** The color of the candle body when the close price is less than the open price. */ + downColor: string; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + type: 'ohlc'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** The id of this series. */ + id: string; + /** The OHLC data points. */ + data: (OHLCValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedPieSeriesType + +```typescript +type DefaultizedPieSeriesType = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### DefaultizedPieValueType + +```typescript +type DefaultizedPieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; + color: string; + formattedValue: string; + hidden: boolean; +}; +``` + +### DefaultizedRadarSeriesType + +```typescript +type DefaultizedRadarSeriesType = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedRangeBarSeriesType + +```typescript +type DefaultizedRangeBarSeriesType = { + hidden: boolean; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + type: 'rangeBar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The id of this series. */ + id: string; + /** Data associated to each range bar. */ + data: (RangeBarValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; +}; +``` + +### DefaultizedScatterSeriesType + +```typescript +type DefaultizedScatterSeriesType = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### DefaultizedSeriesType + +```typescript +type DefaultizedSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: CommonHighlightScope | SankeyHighlightScope; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | number[] + | (RangeBarValueType | null)[] + | (OHLCValueType | null)[] + | DefaultizedPieValueType[] + | MakeRequired[] + | SankeyLayout; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null) + | SeriesValueFormatter + | ((value: number | null, context: { dataIndex: number; field: OHLCField }) => string | null) + | SeriesValueFormatter; +}; +``` + +### defaultSeriesConfigPremium + +```typescript +type defaultSeriesConfigPremium = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + rangeBar: ChartSeriesTypeConfig<'rangeBar'>; + ohlc: ChartSeriesTypeConfig<'ohlc'>; +}; +``` + +### defaultSeriesConfigPro + +```typescript +type defaultSeriesConfigPro = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; +}; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### FadeOptions + +```typescript +type FadeOptions = 'none' | 'series' | 'global'; +``` + +### FocusedItemIdentifier + +```typescript +type FocusedItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### FUNNEL_CHART_PLUGINS + +```typescript +type FUNNEL_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### FunnelChartPluginSignatures + +```typescript +type FunnelChartPluginSignatures = FunnelChartPluginSignatures; +``` + +### FunnelChartProps + +````typescript +type FunnelChartProps = { + /** + * The series to display in the funnel chart. + * An array of [[FunnelSeries]] objects. + */ + series: FunnelSeries[]; + /** + * The configuration of the category axis. + * @default { position: 'none' } + */ + categoryAxis?: CategoryAxis; + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: FunnelItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: FunnelItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The gap, in pixels, between funnel sections. + * @default 0 + */ + gap?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { funnel: ChartSeriesTypeConfig<'funnel'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all funnel elements at the current position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'funnel'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'funnel'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +```` + +### FunnelChartSlotExtension + +```typescript +type FunnelChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +``` + +### FunnelChartSlotProps + +```typescript +type FunnelChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### FunnelChartSlots + +```typescript +type FunnelChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### funnelClasses + +```typescript +type funnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClasses + +```typescript +type FunnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClassKey + +```typescript +type FunnelClassKey = 'root' | 'section' | 'sectionLabel' | 'sectionFilled' | 'sectionOutlined'; +``` + +### FunnelCurveType + +```typescript +type FunnelCurveType = 'linear' | 'linear-sharp' | 'step' | 'bump' | 'pyramid' | 'step-pyramid'; +``` + +### FunnelDataPoints + +```typescript +type FunnelDataPoints = Record<'x' | 'y', number> & { useBandWidth: boolean; stackOffset: number }; +``` + +### FunnelItem + +```typescript +type FunnelItem = { + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number; +}; +``` + +### FunnelItemId + +```typescript +type FunnelItemId = string | number; +``` + +### FunnelItemIdentifier + +An object that allows to identify a funnel item. +Used for item interaction + +```typescript +type FunnelItemIdentifier = { + type: 'funnel'; + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; +}; +``` + +### FunnelLabelOptions + +```typescript +type FunnelLabelOptions = { + /** + * The position of the label. + * @default { vertical: 'middle', horizontal: 'center' } + */ + position?: Position; + /** + * The text anchor of the label. Affects the horizontal alignment of the text. + * + * Default value depends on the position. + */ + textAnchor?: 'start' | 'middle' | 'end'; + /** + * The dominant baseline of the label. Affects the vertical alignment of the text. + * + * Default value depends on the position. + */ + dominantBaseline?: + | 'auto' + | 'baseline' + | 'hanging' + | 'middle' + | 'central' + | 'text-after-edge' + | 'text-before-edge'; + /** + * The offset of the label from the anchor point. + * If a single number is provided, the offset will be applied in both directions. + * @default 0 + */ + offset?: number | { x?: number; y?: number }; +}; +``` + +### FunnelPlotProps + +```typescript +type FunnelPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotExtension + +```typescript +type FunnelPlotSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotProps + +```typescript +type FunnelPlotSlotProps = { + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; +}; +``` + +### FunnelPlotSlots + +```typescript +type FunnelPlotSlots = { + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### FunnelScaleName + +```typescript +type FunnelScaleName = Exclude< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + 'point' +>; +``` + +### FunnelSection + +```typescript +type FunnelSection = unknown; +``` + +### FunnelSectionLabel + +```typescript +type FunnelSectionLabel = unknown; +``` + +### FunnelSeries + +```typescript +type FunnelSeries = { + /** The id of this series. */ + id?: SeriesId; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + type?: 'funnel'; +}; +``` + +### FunnelSeriesType + +```typescript +type FunnelSeriesType = { + type: 'funnel'; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### FunnelValueType + +```typescript +type FunnelValueType = { + /** A unique identifier of the funnel section. */ + id?: FunnelItemId; + /** The value of the funnel section. */ + value: number; + /** The label to display on the tooltip, funnel section, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'section') => string | undefined); + /** The color of the funnel section */ + color?: string; + /** + * Defines the mark type for the funnel item. + * @default 'square' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### gaugeClasses + +```typescript +type gaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClasses + +```typescript +type GaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClassKey + +```typescript +type GaugeClassKey = 'root' | 'valueArc' | 'referenceArc' | 'valueText'; +``` + +### GaugeContainerProps + +```typescript +type GaugeContainerProps = { + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; +}; +``` + +### GaugeFormatterParams + +```typescript +type GaugeFormatterParams = { value: number | null; valueMin: number; valueMax: number }; +``` + +### GaugeProps + +```typescript +type GaugeProps = { + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; + text?: string | ((params: GaugeFormatterParams) => string | null); +}; +``` + +### GaugeValueTextProps + +```typescript +type GaugeValueTextProps = { + text?: string | ((params: GaugeFormatterParams) => string | null); + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### greenPaletteDark + +```typescript +type greenPaletteDark = string[]; +``` + +### greenPaletteLight + +```typescript +type greenPaletteLight = string[]; +``` + +### GridChartsConfigurationOptions + +```typescript +type GridChartsConfigurationOptions = { + [key: string]: { + label: string; + icon: (props: any) => React.ReactNode; + customization: GridChartsConfigurationSection[]; + dimensionsLabel?: string; + valuesLabel?: string; + maxDimensions?: number; + maxValues?: number; + }; +}; +``` + +### GridChartsConfigurationSection + +```typescript +type GridChartsConfigurationSection = { + id: string; + label: string; + controls: { [key: string]: GridChartsConfigurationControl }; +}; +``` + +### HEATMAP_PLUGINS + +```typescript +type HEATMAP_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### HeatmapCellOwnerState + +```typescript +type HeatmapCellOwnerState = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + value: number; +}; +``` + +### HeatmapCellProps + +```typescript +type HeatmapCellProps = { + x: number; + y: number; + width: number; + height: number; + ownerState: HeatmapCellOwnerState; +}; +``` + +### heatmapClasses + +```typescript +type heatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClasses + +```typescript +type HeatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClassKey + +```typescript +type HeatmapClassKey = 'root' | 'series' | 'highlighted' | 'faded' | 'cell'; +``` + +### HeatmapItemIdentifier + +An object that allows to identify a single cell. +Used for item interaction + +```typescript +type HeatmapItemIdentifier = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; +}; +``` + +### HeatmapItemIdentifierWithData + +The cell identifier with the associated data value. + +```typescript +type HeatmapItemIdentifierWithData = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; + /** The value of the cell. Null if there is no data associated. */ + value: number | null; +}; +``` + +### HeatmapPlotProps + +```typescript +type HeatmapPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapPlotSlotProps; +}; +``` + +### HeatmapPlotSlotProps + +```typescript +type HeatmapPlotSlotProps = { cell?: Partial }; +``` + +### HeatmapPlotSlots + +```typescript +type HeatmapPlotSlots = { + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; +}; +``` + +### HeatmapPluginSignatures + +```typescript +type HeatmapPluginSignatures = HeatmapPluginSignatures; +``` + +### HeatmapPremiumProps + +```typescript +type HeatmapPremiumProps = { + /** + * The type of renderer to use for the heatmap plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `webgl`: Renders heatmap cells using WebGL for better performance, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/heatmap/#performance + */ + renderer?: 'svg-single' | 'webgl'; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The series to display in the bar chart. + * An array of [[HeatmapSeries]] objects. + */ + series: HeatmapSeries[]; + /** + * The configuration of the tooltip. + * @see + */ + tooltip?: ChartsTooltipProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: HeatmapItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: HeatmapItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** The callback fired when an item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + item: SeriesItemIdentifierWithType< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + ) => void; + apiRef?: React.RefObject | undefined>; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +``` + +### HeatmapPremiumSlotProps + +```typescript +type HeatmapPremiumSlotProps = { + tooltip?: Partial; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + cell?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### HeatmapPremiumSlots + +```typescript +type HeatmapPremiumSlots = { + /** + * Custom component for the tooltip. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the legend. + * @default ContinuousColorLegendProps + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### HeatmapProps + +```typescript +type HeatmapProps = { + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The series to display in the bar chart. + * An array of [[HeatmapSeries]] objects. + */ + series: HeatmapSeries[]; + /** + * The configuration of the tooltip. + * @see + */ + tooltip?: ChartsTooltipProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: HeatmapItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: HeatmapItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** The callback fired when an item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + item: SeriesItemIdentifierWithType< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + ) => void; + apiRef?: React.RefObject | undefined>; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +``` + +### HeatmapSeries + +```typescript +type HeatmapSeries = { + /** The id of this series. */ + id?: SeriesId; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + type?: 'heatmap'; +}; +``` + +### HeatmapSeriesType + +```typescript +type HeatmapSeriesType = { + type: 'heatmap'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The id of this series. */ + id?: SeriesId; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### HeatmapSlotProps + +```typescript +type HeatmapSlotProps = { + tooltip?: Partial; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + cell?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### HeatmapSlots + +```typescript +type HeatmapSlots = { + /** + * Custom component for the tooltip. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the legend. + * @default ContinuousColorLegendProps + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### HeatmapTooltipClasses + +```typescript +type HeatmapTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentClasses + +```typescript +type HeatmapTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentProps + +```typescript +type HeatmapTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### HeatmapTooltipProps + +```typescript +type HeatmapTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer'; +}; +``` + +### HeatmapTooltipSlotProps + +```typescript +type HeatmapTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial; +}; +``` + +### HeatmapTooltipSlots + +```typescript +type HeatmapTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### HeatmapValueType + +```typescript +type HeatmapValueType = HeatmapValueType; +``` + +### HighlightItemIdentifier + +Identifies an highlighted item or series. + +```typescript +type HighlightItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightItemIdentifierWithType + +```typescript +type HighlightItemIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightOptions + +```typescript +type HighlightOptions = 'none' | 'item' | 'series'; +``` + +### HighlightScope + +```typescript +type HighlightScope = CommonHighlightScope | SankeyHighlightScope; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` + +### ItemTooltip + +```typescript +type ItemTooltip< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | RangeBarValueType + | OHLCValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### labelClasses + +```typescript +type labelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### labelGradientClasses + +```typescript +type labelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### labelMarkClasses + +```typescript +type labelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### legendClasses + +```typescript +type legendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### LegendItemContext + +```typescript +type LegendItemContext = SeriesLegendItemContext | PiecewiseColorLegendItemContext; +``` + +### LegendItemParams + +```typescript +type LegendItemParams = { + /** The type of the series */ + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + markType: ChartsLabelMarkType | undefined; + /** The identifier of the series */ + seriesId?: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The minimum value of the category */ + minValue?: number | Date | null; + /** The maximum value of the category */ + maxValue?: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LINE_CHART_PRO_PLUGINS + +```typescript +type LINE_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProPluginSignatures + +```typescript +type LineChartProPluginSignatures = LineChartProPluginSignatures; +``` + +### LineChartProProps + +````typescript +type LineChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartProSlotProps + +```typescript +type LineChartProSlotProps = { + line?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + area?: SlotComponentPropsFromProps; + mark?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + lineHighlight?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### LineChartProSlots + +```typescript +type LineChartProSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'line' + | 'area' + | 'mark' + | 'highlight' + | 'markAnimate' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LineItemIdentifier + +An object that allows to identify a single line. +Used for item interaction + +```typescript +type LineItemIdentifier = { + type: 'line'; + seriesId: string; + /** `dataIndex` can be `undefined` if the mouse is over the area and not a specific item. */ + dataIndex?: number; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### LineSeriesType + +```typescript +type LineSeriesType = { + type: 'line'; + /** Data associated to the line. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### mangoFusionPaletteDark + +```typescript +type mangoFusionPaletteDark = string[]; +``` + +### mangoFusionPaletteLight + +```typescript +type mangoFusionPaletteLight = string[]; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + seriesId: string; + classes?: Partial; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +### MarkShape + +```typescript +type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; +``` + +### NumberValue + +```typescript +type NumberValue = NumberValue; +``` + +### OHLCField + +The OHLC fields that can be formatted individually. + +```typescript +type OHLCField = 'open' | 'high' | 'low' | 'close'; +``` + +### OHLCFormattedValue + +The structured formatted tooltip value for OHLC series. + +```typescript +type OHLCFormattedValue = { + open: string | null; + high: string | null; + low: string | null; + close: string | null; +}; +``` + +### OHLCItemIdentifier + +An object that allows to identify a single bar. +Used for item interaction + +```typescript +type OHLCItemIdentifier = { type: 'ohlc'; seriesId: string; dataIndex: number }; +``` + +### OHLCSeries + +```typescript +type OHLCSeries = { + /** The id of this series. */ + id?: SeriesId; + /** The OHLC data points. */ + data?: (OHLCValueType | null)[]; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** + * The color of the candle body when the close price is greater than or equal to the open price. + * @default (mode) => mode === 'dark' ? '#66bb6a' : '#2e7d32' + */ + upColor?: ChartsColor; + /** + * The color of the candle body when the close price is less than the open price. + * @default (mode) => mode === 'dark' ? '#f44336' : '#d32f2f' + */ + downColor?: ChartsColor; + type?: 'ohlc'; +}; +``` + +### OHLCSeriesType + +```typescript +type OHLCSeriesType = { + type: 'ohlc'; + /** The OHLC data points. */ + data?: (OHLCValueType | null)[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** + * The color of the candle body when the close price is greater than or equal to the open price. + * @default (mode) => mode === 'dark' ? '#66bb6a' : '#2e7d32' + */ + upColor?: ChartsColor; + /** + * The color of the candle body when the close price is less than the open price. + * @default (mode) => mode === 'dark' ? '#f44336' : '#d32f2f' + */ + downColor?: ChartsColor; + /** The id of this series. */ + id?: SeriesId; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### OHLCTooltipValue + +The structured tooltip value for OHLC series. + +```typescript +type OHLCTooltipValue = { open: string; high: string; low: string; close: string }; +``` + +### OHLCValueType + +Type representing the values of a single OHLC element. +The array contains four numbers in the following order: +\[open, high, low, close]. + +```typescript +type OHLCValueType = OHLCValueType; +``` + +### orangePaletteDark + +```typescript +type orangePaletteDark = string[]; +``` + +### orangePaletteLight + +```typescript +type orangePaletteLight = string[]; +``` + +### OrdinalTimeTicks + +```typescript +type OrdinalTimeTicks = (TickFrequencyDefinition | TickFrequency)[]; +``` + +### PIE_CHART_PLUGINS + +```typescript +type PIE_CHART_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### PIE_CHART_PRO_PLUGINS + +```typescript +type PIE_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### PieArcLabelPlotProps + +```typescript +type PieArcLabelPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcLabelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcLabelPlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcLabelPlotSlotProps + +```typescript +type PieArcLabelPlotSlotProps = { pieArcLabel?: Partial }; +``` + +### PieArcLabelPlotSlots + +```typescript +type PieArcLabelPlotSlots = { pieArcLabel?: React.JSXElementConstructor }; +``` + +### PieArcLabelProps + +```typescript +type PieArcLabelProps = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + classes?: Partial; + startAngle: number; + endAngle: number; + arcLabelRadius: number; + cornerRadius: number; + paddingAngle: number; + skipAnimation: boolean; + formattedArcLabel?: string | null; + hidden?: boolean; +}; +``` + +### PieArcOwnerState + +```typescript +type PieArcOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; +}; +``` + +### PieArcPlotProps + +```typescript +type PieArcPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcPlotSlotProps; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcPlotSlotProps + +```typescript +type PieArcPlotSlotProps = { pieArc?: Partial }; +``` + +### PieArcPlotSlots + +```typescript +type PieArcPlotSlots = { pieArc?: React.JSXElementConstructor }; +``` + +### PieArcProps + +```typescript +type PieArcProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; + cornerRadius: number; + endAngle: number; + innerRadius: number; + onClick?: (event: React.MouseEvent) => void; + outerRadius: number; + paddingAngle: number; + startAngle: number; + /** If `true`, the animation is disabled. */ + skipAnimation?: boolean; + /** + * If `true`, the default event handlers are disabled. + * Those are used, for example, to display a tooltip or highlight the arc on hover. + */ + skipInteraction?: boolean; +}; +``` + +### piecewiseColorLegendClasses + +```typescript +type piecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendClasses + +```typescript +type PiecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendItemContext + +```typescript +type PiecewiseColorLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'piecewiseColor'; + /** The minimum value of the category */ + minValue: number | Date | null; + /** The maximum value of the category */ + maxValue: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### PiecewiseColorLegendProps + +```typescript +type PiecewiseColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * Format the legend labels. + * @returns The displayed label, `''` to skip the label but show the color mark, or `null` to skip it entirely. + */ + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + /** + * Where to position the labels relative to the color marks. + * @default 'extremes' + */ + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### PiecewiseLabelFormatterParams + +```typescript +type PiecewiseLabelFormatterParams = { + /** The index of the entry. */ + index: number; + /** The length of the entries array. */ + length: number; + /** The min value of the piece. `null` is infinite. */ + min: number | Date | null; + /** The max value of the piece. `null` is infinite. */ + max: number | Date | null; + /** The formatted min value of the piece. `null` is infinite. */ + formattedMin: string | null; + /** The formatted max value of the piece. `null` is infinite. */ + formattedMax: string | null; +}; +``` + +### PieChartPluginSignatures + +```typescript +type PieChartPluginSignatures = PieChartPluginSignatures; +``` + +### PieChartProPluginSignatures + +```typescript +type PieChartProPluginSignatures = PieChartProPluginSignatures; +``` + +### PieChartProProps + +````typescript +type PieChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; +}; +```` + +### PieChartProps + +````typescript +type PieChartProps = { + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartSlotProps; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### PieChartProSlotProps + +```typescript +type PieChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + pieArc?: Partial; + pieArcLabel?: Partial; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### PieChartProSlots + +```typescript +type PieChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### PieChartSlotProps + +```typescript +type PieChartSlotProps = { + pieArc?: Partial; + pieArcLabel?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### PieChartSlots + +```typescript +type PieChartSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### pieClasses + +```typescript +type pieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClasses + +```typescript +type PieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClassKey + +```typescript +type PieClassKey = + | 'root' + | 'arc' + | 'series' + | 'arcLabel' + | 'animate' + | 'seriesLabels' + | 'focusIndicator'; +``` + +### PieItemId + +```typescript +type PieItemId = string | number; +``` + +### PieItemIdentifier + +An object that allows to identify a single pie slice. +Used for item interaction + +```typescript +type PieItemIdentifier = { type: 'pie'; seriesId: string; dataIndex: number }; +``` + +### PiePlotProps + +```typescript +type PiePlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: PiePlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PiePlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; +}; +``` + +### PiePlotSlotProps + +```typescript +type PiePlotSlotProps = { pieArc?: Partial; pieArcLabel?: Partial }; +``` + +### PiePlotSlots + +```typescript +type PiePlotSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; +}; +``` + +### PieSeries + +```typescript +type PieSeries = MakeOptional>, 'type'>; +``` + +### PieSeriesLayout + +Layout information computed from the pie series and the drawing area. + +```typescript +type PieSeriesLayout = { + /** The pie center coordinate in px. */ + center: { x: number; y: number }; + /** + * The pie radius in px. + * Computed based on the drawing area and the center placement. + */ + radius: { + /** + * The maximum available radius in px. + * Correspond to radius='100%'. + */ + available: number; + /** The pie inner radius in px, except if overridden by item state (highlight/faded). */ + inner: number; + /** The pie outer radius in px, except if overridden by item state (highlight/faded). */ + outer: number; + /** The pie label radius in px, except if overridden by item state (highlight/faded). */ + label: number; + }; +}; +``` + +### PieSeriesType + +```typescript +type PieSeriesType = { + type: 'pie'; + data: TData[]; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### PieValueType + +```typescript +type PieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### pinkPaletteDark + +```typescript +type pinkPaletteDark = string[]; +``` + +### pinkPaletteLight + +```typescript +type pinkPaletteLight = string[]; +``` + +### Position + +```typescript +type Position = { + /** The vertical position. */ + vertical?: 'top' | 'middle' | 'bottom'; + /** The horizontal position. */ + horizontal?: 'start' | 'center' | 'end'; +}; +``` + +### PropsFromSlot + +```typescript +type PropsFromSlot = + | P + | React.ComponentProps< + NonNullable | React.ElementType | null | undefined> + >; +``` + +### purplePaletteDark + +```typescript +type purplePaletteDark = string[]; +``` + +### purplePaletteLight + +```typescript +type purplePaletteLight = string[]; +``` + +### RADAR_CHART_PRO_PLUGINS + +```typescript +type RADAR_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### RADAR_PLUGINS + +```typescript +type RADAR_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, +]; +``` + +### RadarAxisHighlightProps + +```typescript +type RadarAxisHighlightProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial< + Pick + >; +}; +``` + +### RadarAxisProps + +```typescript +type RadarAxisProps = { + /** + * Defines how label align with the axis. + * - 'horizontal': labels stay horizontal and their placement change with the axis angle. + * - 'rotated': labels are rotated 90deg relatively to their axis. + * @default 'horizontal' + */ + labelOrientation?: 'horizontal' | 'rotated'; + /** The labels text anchor or a function returning the text anchor for a given axis angle (in degree). */ + textAnchor?: + | 'start' + | 'middle' + | 'end' + | 'inherit' + | ((angle: number) => 'start' | 'end' | 'middle' | 'inherit' | undefined); + /** The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). */ + dominantBaseline?: + | 'auto' + | 'use-script' + | 'no-change' + | 'reset-size' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'central' + | 'middle' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | (( + angle: number, + ) => + | 'auto' + | 'middle' + | 'alphabetic' + | 'hanging' + | 'ideographic' + | 'mathematical' + | 'central' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | 'use-script' + | 'no-change' + | 'reset-size' + | undefined); + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial>; + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### RadarChartPluginSignatures + +```typescript +type RadarChartPluginSignatures = RadarChartPluginSignatures; +``` + +### RadarChartProPluginSignatures + +```typescript +type RadarChartProPluginSignatures = RadarChartProPluginSignatures; +``` + +### RadarChartProProps + +````typescript +type RadarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** A CSS class name applied to the root element. */ + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; +}; +```` + +### RadarChartProps + +````typescript +type RadarChartProps = { + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; +}; +```` + +### RadarChartProSlotProps + +```typescript +type RadarChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### RadarChartProSlots + +```typescript +type RadarChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### RadarChartSlotProps + +```typescript +type RadarChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### RadarChartSlots + +```typescript +type RadarChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### radarClasses + +```typescript +type radarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClasses + +```typescript +type RadarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClassKey + +```typescript +type RadarClassKey = + | 'axisLine' + | 'axisLabel' + | 'axisRoot' + | 'gridRadial' + | 'gridDivider' + | 'gridStripe' + | 'seriesRoot' + | 'seriesArea' + | 'seriesMark' + | 'axisHighlightRoot' + | 'axisHighlightLine' + | 'axisHighlightDot'; +``` + +### RadarDataProviderProps + +```typescript +type RadarDataProviderProps< + TSignatures extends ChartAnyPluginSignature[] = RadarChartPluginSignatures, +> = { + /** Array of plugins used to add features to the chart. */ + plugins?: [] | [ChartPlugin]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** Slots to customize charts' components. */ + slots?: Partial; + /** The props for the slots. */ + slotProps?: Partial; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: + | string + | number + | bigint + | boolean + | ReactElement + | Iterable + | React.ReactPortal + | Promise + | null; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: number | Partial; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: {}; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; +}; +``` + +### RadarGridProps + +```typescript +type RadarGridProps = { + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; +}; +``` + +### RadarItemIdentifier + +An object that allows to identify either a radar series or a radar point (if dataIndex is defined). +Used for item interaction + +```typescript +type RadarItemIdentifier = { type: 'radar'; seriesId: string; dataIndex?: number }; +``` + +### RadarSeries + +```typescript +type RadarSeries = { + /** The id of this series. */ + id?: SeriesId; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + type?: 'radar'; +}; +``` + +### RadarSeriesAreaProps + +```typescript +type RadarSeriesAreaProps = { + /** Callback fired when an area is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesMarksProps + +```typescript +type RadarSeriesMarksProps = { + /** Callback fired when a mark is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesPlotProps + +```typescript +type RadarSeriesPlotProps = { + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesType + +```typescript +type RadarSeriesType = { + type: 'radar'; + data: number[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### RadiusAxis + +```typescript +type RadiusAxis = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * The minimal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + min?: number; + /** + * The maximal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + max?: number; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The minimal radius. */ + minRadius?: number; + /** The maximal radius. */ + maxRadius?: number; + colorMap?: ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### rainbowSurgePaletteDark + +```typescript +type rainbowSurgePaletteDark = string[]; +``` + +### rainbowSurgePaletteLight + +```typescript +type rainbowSurgePaletteLight = string[]; +``` + +### rangeBarClasses + +```typescript +type rangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClasses + +```typescript +type RangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClassKey + +```typescript +type RangeBarClassKey = 'root' | 'series' | 'seriesLabels'; +``` + +### RangeBarItemIdentifier + +An object that allows to identify a range bar. +Used for item interaction + +```typescript +type RangeBarItemIdentifier = { type: 'rangeBar'; seriesId: string; dataIndex: number }; +``` + +### RangeBarPlotProps + +```typescript +type RangeBarPlotProps = { + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + barItemIdentifier: RangeBarItemIdentifier, + ) => void; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RangeBarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: RangeBarPlotSlots; +}; +``` + +### RangeBarPlotSlotProps + +```typescript +type RangeBarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### RangeBarPlotSlots + +```typescript +type RangeBarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### RangeBarSeries + +```typescript +type RangeBarSeries = { + type: 'rangeBar'; + /** Data associated to each range bar. */ + data?: (RangeBarValueType | null)[]; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### RangeBarSeriesType + +```typescript +type RangeBarSeriesType = { + type: 'rangeBar'; + /** Data associated to each range bar. */ + data?: (RangeBarValueType | null)[]; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### RangeBarValueType + +\[start, end] + +```typescript +type RangeBarValueType = RangeBarValueType; +``` + +### redPaletteDark + +```typescript +type redPaletteDark = string[]; +``` + +### redPaletteLight + +```typescript +type redPaletteLight = string[]; +``` + +### referenceLineClasses + +```typescript +type referenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### RotationAxis + +```typescript +type RotationAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The start angle (in deg). */ + startAngle?: number; + /** The end angle (in deg). */ + endAngle?: number; + /** The gap between the axis and the label. */ + labelGap?: number; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### ScaleName + +```typescript +type ScaleName = 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### SCATTER_CHART_PLUGINS + +```typescript +type SCATTER_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### SCATTER_CHART_PRO_PLUGINS + +```typescript +type SCATTER_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### ScatterChartPluginSignatures + +```typescript +type ScatterChartPluginSignatures = ScatterChartPluginSignatures; +``` + +### ScatterChartProPluginSignatures + +```typescript +type ScatterChartProPluginSignatures = ScatterChartProPluginSignatures; +``` + +### ScatterChartProProps + +````typescript +type ScatterChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### ScatterChartProps + +````typescript +type ScatterChartProps = { + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartSlotProps; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; +}; +```` + +### ScatterChartProSlotProps + +```typescript +type ScatterChartProSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + scatter?: Partial; + marker?: ScatterMarkerProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ScatterChartProSlots + +```typescript +type ScatterChartProSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### ScatterChartSlotProps + +```typescript +type ScatterChartSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + scatter?: Partial; + marker?: ScatterMarkerProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ScatterChartSlots + +```typescript +type ScatterChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### scatterClasses + +```typescript +type scatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClasses + +```typescript +type ScatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClassKey + +```typescript +type ScatterClassKey = 'marker' | 'root' | 'series' | 'focusedMark'; +``` + +### ScatterItemIdentifier + +An object that allows to identify a single scatter item. +Used for item interaction + +```typescript +type ScatterItemIdentifier = { type: 'scatter'; seriesId: string; dataIndex: number }; +``` + +### ScatterMarkerProps + +```typescript +type ScatterMarkerProps = { + /** The series ID. */ + seriesId: string; + /** The index of the data point. */ + dataIndex: number; + /** The x coordinate of the data point. */ + x: number; + /** The y coordinate of the data point. */ + y: number; + /** The fill color of the marker. */ + color: string; + /** The size of the marker. */ + size: number; + /** If `true`, the marker is highlighted. */ + isHighlighted: boolean; + /** If `true`, the marker is faded. */ + isFaded: boolean; + /** Callback fired when clicking on a scatter item. */ + onClick?: (event: React.MouseEvent) => void; +}; +``` + +### ScatterMarkerSlotExtension + +```typescript +type ScatterMarkerSlotExtension = { + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterMarkerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterMarkerSlots; +}; +``` + +### ScatterMarkerSlotProps + +```typescript +type ScatterMarkerSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterMarkerSlots + +```typescript +type ScatterMarkerSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterPlotProps + +```typescript +type ScatterPlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterPlotSlotProps; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + classes?: Partial; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; +}; +``` + +### ScatterPlotSlotProps + +```typescript +type ScatterPlotSlotProps = { scatter?: Partial; marker?: ScatterMarkerProps }; +``` + +### ScatterPlotSlots + +```typescript +type ScatterPlotSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterProps + +```typescript +type ScatterProps = { + series: DefaultizedScatterSeriesType; + xScale: D3Scale; + yScale: D3Scale; + color: string; + /** + * Function to get the color of a scatter item given its data index. + * The data index argument is optional. If not provided, the color for the entire series is returned. + * If provided, the color for the specific scatter item is returned. + */ + colorGetter: (dataIndex?: number) => string; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; + classes?: Partial; + slots?: ScatterSlots; + slotProps?: ScatterSlotProps; +}; +``` + +### ScatterSeries + +```typescript +type ScatterSeries = MakeOptional; +``` + +### ScatterSeriesType + +```typescript +type ScatterSeriesType = { + type: 'scatter'; + data?: ScatterValueType[]; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize?: number; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + preview?: { markerSize?: number }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### ScatterSlotProps + +```typescript +type ScatterSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterSlots + +```typescript +type ScatterSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterValueType + +```typescript +type ScatterValueType = { + x: number; + y: number; + z?: any; + /** A unique identifier for the scatter point */ + id?: string | number; +}; +``` + +### SeriesId + +The unique identifier of a series. + +```typescript +type SeriesId = string; +``` + +### SeriesItem + +```typescript +type SeriesItem< + T extends 'bar' | 'line' | 'scatter' | 'radar' | 'heatmap' | 'funnel' | 'rangeBar' | 'ohlc', +> = { + seriesId: string; + color: string; + value: + | { open: number; high: number; low: number; close: number } + | number + | HeatmapValueType + | ScatterValueType + | RangeBarValueType + | OHLCValueType + | MakeRequired + | null; + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string; + formattedLabel: string | null; + markType: ChartsLabelMarkType | undefined; + markShape: MarkShape | undefined; +}; +``` + +### SeriesItemIdentifier + +```typescript +type SeriesItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { seriesId: string }; +``` + +### SeriesItemIdentifierWithData + +```typescript +type SeriesItemIdentifierWithData< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### SeriesItemIdentifierWithType + +```typescript +type SeriesItemIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### SeriesLegendItemContext + +```typescript +type SeriesLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'series'; + /** The identifier of the series */ + seriesId: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### SeriesLegendItemParams + +```typescript +type SeriesLegendItemParams = { + /** The identifier of the series */ + seriesId: string; + /** The type of the series */ + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + markType: ChartsLabelMarkType | undefined; + markShape?: MarkShape; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### ShowMarkParams + +```typescript +type ShowMarkParams = { + /** The item index. */ + index: number; + /** The x coordinate in the SVG. */ + x: number; + /** The y coordinate in the SVG. */ + y: number; + /** The item position value. It likely comes from the axis `data` property. */ + position: AxisValue; + /** The item value. It comes from the series `data` property. */ + value: number; +}; +``` + +### SparkLineChartProps + +````typescript +type SparkLineChartProps = { + /** + * The xAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + xAxis?: XAxis; + /** + * The yAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + yAxis?: YAxis; + axisHighlight?: ChartsAxisHighlightProps; + /** + * Type of plot used. + * @default 'line' + */ + plotType?: 'bar' | 'line'; + /** Data to plot. */ + data: number[]; + /** + * Formatter used by the tooltip. + * @default (value: number | null) => (value === null ? '' : value.toString()) + * @returns the formatted value. + */ + valueFormatter?: (value: number | null) => string; + /** + * Set to `true` to enable the tooltip in the sparkline. + * @default false + */ + showTooltip?: boolean; + /** + * Set to `true` to highlight the value. + * With line, it shows a point. + * With bar, it shows a highlight band. + * @default false + */ + showHighlight?: boolean; + /** + * Set to `true` to fill spark line area. + * Has no effect if plotType='bar'. + * @default false + */ + area?: boolean; + /** @default 'linear' */ + curve?: CurveType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + * @default 5 + */ + margin?: Partial | number; + /** + * Overridable component slots. + * @default {} + */ + slots?: SparkLineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SparkLineChartSlotProps; + /** + * Color used to colorize the sparkline. + * @default rainbowSurgePalette[0] + */ + color?: ChartsColor; + /** + * When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. + * @default false + */ + disableClipping?: boolean; + /** + * The clipped area offset in pixels. + * + * This prevents partial clipping of lines when they are drawn on the edge of the drawing area. + * @default { top: 1, right: 1, bottom: 1, left: 1 } + */ + clipAreaOffset?: { top?: number; right?: number; bottom?: number; left?: number }; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | BarItemIdentifier + | Omit + | LineItemIdentifier + | Omit + | ScatterItemIdentifier + | Omit + | PieItemIdentifier + | Omit + | RadarItemIdentifier + | Omit + | HeatmapItemIdentifier + | Omit + | FunnelItemIdentifier + | Omit + | SankeyItemIdentifier + | Omit + | Omit + | RangeBarItemIdentifier + | Omit + | OHLCItemIdentifier + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: ( + tooltipItem: + | BarItemIdentifier + | LineItemIdentifier + | ScatterItemIdentifier + | PieItemIdentifier + | RadarItemIdentifier + | HeatmapItemIdentifier + | FunnelItemIdentifier + | SankeyItemIdentifier + | RangeBarItemIdentifier + | OHLCItemIdentifier + | null, + ) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'rangeBar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'rangeBar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: + | SankeyItemIdentifier + | { type: 'bar'; seriesId: string; dataIndex?: number } + | { type: 'line'; seriesId: string; dataIndex?: number } + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | { type: 'pie'; seriesId: string; dataIndex?: number } + | { type: 'radar'; seriesId: string; dataIndex?: number } + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | { type: 'rangeBar'; seriesId: string; dataIndex?: number } + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * Callback fired when clicking close to an item. + * This is only available for scatter plot for now. + */ + onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + radar: ChartSeriesTypeConfig<'radar'>; + heatmap: ChartSeriesTypeConfig<'heatmap'>; + funnel: ChartSeriesTypeConfig<'funnel'>; + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + rangeBar: ChartSeriesTypeConfig<'rangeBar'>; + ohlc: ChartSeriesTypeConfig<'ohlc'>; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'rangeBar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'rangeBar'; + } + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + )[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'rangeBar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'rangeBar'; + } + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'rangeBar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'rangeBar'; + } + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** If true, the hit area interaction is disabled and falls back to hover events. */ + disableHitArea?: boolean; +}; +```` + +### SparkLineChartSlotProps + +```typescript +type SparkLineChartSlotProps = { + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SparkLineChartSlots + +```typescript +type SparkLineChartSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### StackableChartSeriesType + +```typescript +type StackableChartSeriesType = 'bar' | 'line'; +``` + +### StackOffsetType + +```typescript +type StackOffsetType = 'expand' | 'diverging' | 'none' | 'silhouette' | 'wiggle'; +``` + +### StackOrderType + +```typescript +type StackOrderType = 'appearance' | 'ascending' | 'descending' | 'insideOut' | 'none' | 'reverse'; +``` + +### strawberrySkyPaletteDark + +```typescript +type strawberrySkyPaletteDark = string[]; +``` + +### strawberrySkyPaletteLight + +```typescript +type strawberrySkyPaletteLight = string[]; +``` + +### TickFrequency + +The predefined tick frequencies for time ordinal axes. + +- 'years': displays the year, placing ticks at the start of each year +- 'quarterly': displays the month, placing ticks at the start of each quarter +- 'months': displays the month, placing ticks at the start of each month +- 'biweekly': displays the day, placing ticks every two weeks +- 'weeks': displays the day, placing ticks at the start of each week +- 'days': displays the day, placing ticks at the start of each day +- 'hours': displays the hour and minutes, placing ticks at the start of each hour + +```typescript +type TickFrequency = 'years' | 'quarterly' | 'months' | 'biweekly' | 'weeks' | 'days' | 'hours'; +``` + +### TickFrequencyDefinition + +Definition of a tick frequency for time ordinal axes. + +```typescript +type TickFrequencyDefinition = { + /** + * Returns the number of ticks in the given date range for this tick frequency. + * @returns The number of ticks in the [from, to] range. + */ + getTickNumber: (from: Date, to: Date) => number; + /** + * Decides if the current date should be shown as a tick. + * @returns Whether the current date is a tick or not. + */ + isTick: (prev: Date, value: Date) => boolean; + /** + * Format the tick value for display. + * @returns The formatted date string. + */ + format: (date: Date) => string; +}; +``` + +### TickItem + +```typescript +type TickItem = { + /** + * The value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + value?: any; + /** + * The formatted value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + formattedValue?: string; + /** + * The offset in pixels relative to the SVG origin. + * For an x-axis, it is relative to the left side of the SVG. + * For a y-axis, it is relative to the top side of the SVG. + */ + offset: number; + /** + * The offset in pixels relative to the tick position. + * For an x-axis, a positive value means the label is shifted to the right of the tick. + * For a y-axis, a positive value means the label is shifted downwards from the tick. + */ + labelOffset: number; +}; +``` + +### UseAnimateParams + +```typescript +type UseAnimateParams = { + /** + * Function that returns the interpolation function for animating props. + * @returns + * Interpolation function that takes a time value between 0 and 1 and returns the interpolated + * props at time t. This function is called on every frame of the animation. + */ + createInterpolator: (lastProps: Props, newProps: Props) => (t: number) => Props; + /** + * Transforms the interpolated props to be passed to `applyProps`, which usually means transforming them to element + * attributes, e.g., transforming an array of points into a `d` attribute for a path. + * @returns The transformed props. + */ + transformProps: (props: Props) => T; + /** + * Applies the transformed props to the element. Usually this will be a call to `element.setAttribute("x", x)` or + * to `element.style.width = width` so that updating the element does not go through the React lifecycle (i.e., not + * causing a re-render), with the objective of improving performance. + * + * This function is called on every frame of the animation. + */ + applyProps: (element: Elem, props: T) => void; + /** If `true`, the animation will be skipped and the final props will be applied immediately. */ + skip?: boolean; + /** Initial props to animate from. If not provided, defaults to the props passed as the first argument of `useAnimate`. */ + initialProps?: Props; + /** Optional ref to merge with the ref returned from this hook. */ + ref?: React.Ref; +}; +``` + +### UseAnimateReturn + +```typescript +type UseAnimateReturn = { + /** Ref to be passed to the element to animate. */ + ref: React.Ref; +}; +``` + +### UseAxesTooltipParams + +```typescript +type UseAxesTooltipParams = { + /** + * The axis directions to consider. + * If not defined, all directions are considered + */ + directions?: ('x' | 'y' | 'rotation')[]; +}; +``` + +### UseAxesTooltipReturnValue + +```typescript +type UseAxesTooltipReturnValue = { axisDirection: 'x' | 'y' | 'radius' | 'rotation'; +mainAxis: { /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ +id: AxisId; +/** The data used by `'band'` and `'point'` scales. */ +data?: any[]; +/** The key used to retrieve `data` from the `dataset` prop. */ +dataKey?: string; +/** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ +valueGetter?: ((item: DatasetElementType) => any); +colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string); type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'piecewise'; thresholds: (number | Date)[]; colors: string[]; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) }; +/** + * Formats the axis value. + * @returns The string to display. + */ +valueFormatter?: ((value: any, context: AxisValueFormatterContext) => string); +/** The label of the axis. */ +label?: string; +/** A CSS class name applied to the root element. */ +className?: string; +/** + * If true, the axis line is disabled. + * @default false + */ +disableLine?: boolean; +/** + * If true, the ticks are disabled. + * @default false + */ +disableTicks?: boolean; +/** The style applied to ticks text. */ +tickLabelStyle?: ChartsTextStyle; +/** The style applied to the axis label. */ +labelStyle?: ChartsTextStyle; +/** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ +tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); +/** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ +tickSpacing?: number; +/** + * The size of the ticks. + * @default 6 + */ +tickSize?: number; +/** Override or extend the styles applied to the component. */ +classes?: Partial; +/** + * Overridable component slots. + * @default {} + */ +slots?: Partial; +/** + * The props used for each component slot. + * @default {} + */ +slotProps?: Partial; +sx?: SxProps; +/** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMaxStep?: number; +/** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMinStep?: number; +/** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ +tickNumber?: number; +/** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ +tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; +/** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ +tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; +/** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ +tickLabelPlacement?: 'middle' | 'tick'; +/** If `true`, hide this value in the tooltip */ +hideTooltip?: boolean; +/** If `true`, Reverse the axis scaleBand. */ +reverse?: boolean; +/** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ +domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); +/** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ +ignoreTooltip?: boolean; +zoom?: boolean | ZoomOptions | false & DefaultizedZoomOptions | true & DefaultizedZoomOptions | { minStart?: number; maxEnd?: number; step?: number; minSpan?: number; maxSpan?: number; panning?: boolean; filterMode?: ZoomFilterMode; slider?: ZoomSliderOptions; axisId: AxisId; axisDirection: 'x' | 'y'; slider: DefaultedZoomSliderOptions; reverse: boolean; minStart: number; maxEnd: number; step: number; minSpan: number; maxSpan: number; panning: boolean; filterMode: ZoomFilterMode }; +/** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ +offset?: number; +scaleType: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +scale: ScaleBand<{ toString: function toString() { [native code] } }> | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; +colorScale?: ScaleOrdinal | ScaleOrdinal | ScaleSequential | ScaleThreshold | ScaleThreshold; +/** Indicate if the axis should be consider by a tooltip with `trigger='axis'`. */ +triggerTooltip?: boolean }; +axisId: AxisId; +axisValue: AxisValueT; +axisFormattedValue: string; +dataIndex: number; +seriesItems: SeriesItem[] } +``` + +### UseBarSeriesContextReturnValue + +```typescript +type UseBarSeriesContextReturnValue = SeriesProcessorResult<'bar'>; +``` + +### UseBarSeriesReturnValue + +```typescript +type UseBarSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UseChartCartesianAxisSignature + +```typescript +type UseChartCartesianAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartCartesianAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartCartesianAxisDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartCartesianAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature, UseChartBrushSignature]; +}; +``` + +### UseChartClosestPointSignature + +```typescript +type UseChartClosestPointSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVoronoiParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVoronoiDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVoronoiInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVoronoiState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [ + UseChartInteractionSignature, + UseChartHighlightSignature, + UseChartTooltipSignature, + ]; +}; +``` + +### UseChartHighlightSignature + +```typescript +type UseChartHighlightSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartHighlightParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartHighlightDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartHighlightInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartHighlightState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartInteractionSignature + +```typescript +type UseChartInteractionSignature = { + /** The raw properties that can be passed to the plugin. */ + params: {}; + /** The params after being processed with the default values. */ + defaultizedParams: {}; + /** An imperative api available for internal use. */ + instance: UseChartInteractionInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartInteractionState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartPolarAxisSignature + +```typescript +type UseChartPolarAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartPolarAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartPolarAxisParameters; + /** An imperative api available for internal use. */ + instance: UseChartPolarAxisInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartPolarAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature]; +}; +``` + +### UseChartProExportSignature + +```typescript +type UseChartProExportSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProExportParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProExportParameters; + /** An imperative api available for internal use. */ + instance: UseChartProExportInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProExportState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProExportPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartProZoomSignature + +```typescript +type UseChartProZoomSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProZoomParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProZoomDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartProZoomInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProZoomState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProZoomPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature, UseChartBrushSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartTooltipSignature + +```typescript +type UseChartTooltipSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartTooltipParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartTooltipDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartTooltipInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartTooltipState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartVisibilityManagerInstance + +```typescript +type UseChartVisibilityManagerInstance< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** Hide an item by its identifier. */ + hideItem: hideItem; + /** Show an item by its identifier. */ + showItem: showItem; + /** Toggle the visibility of an item by its identifier. */ + toggleItemVisibility: toggleItemVisibility; +}; +``` + +### UseChartVisibilityManagerParameters + +````typescript +type UseChartVisibilityManagerParameters< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: (hiddenItems: VisibilityIdentifierWithType[]) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: (VisibilityIdentifierWithType | VisibilityIdentifier)[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | VisibilityIdentifierWithType + | VisibilityIdentifier + )[]; +}; +```` + +### UseChartVisibilityManagerSignature + +```typescript +type UseChartVisibilityManagerSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVisibilityManagerParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVisibilityManagerDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVisibilityManagerInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVisibilityManagerState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartZAxisSignature + +```typescript +type UseChartZAxisSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartZAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartZAxisParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartZAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseFunnelSeriesContextReturnValue + +```typescript +type UseFunnelSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseFunnelSeriesReturnValue + +```typescript +type UseFunnelSeriesReturnValue = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### UseHeatmapSeriesContextReturnValue + +```typescript +type UseHeatmapSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseHeatmapSeriesReturnValue + +```typescript +type UseHeatmapSeriesReturnValue = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### UseItemTooltipReturnValue + +```typescript +type UseItemTooltipReturnValue< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | RangeBarValueType + | OHLCValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### UseLineSeriesContextReturnValue + +```typescript +type UseLineSeriesContextReturnValue = SeriesProcessorResult<'line'>; +``` + +### UseLineSeriesReturnValue + +```typescript +type UseLineSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UseOHLCSeriesContextReturnValue + +```typescript +type UseOHLCSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseOHLCSeriesReturnValue + +```typescript +type UseOHLCSeriesReturnValue = { + hidden: boolean; + /** The color of the candle body when the close price is greater than or equal to the open price. */ + upColor: string; + /** The color of the candle body when the close price is less than the open price. */ + downColor: string; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + type: 'ohlc'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** The id of this series. */ + id: string; + /** The OHLC data points. */ + data: (OHLCValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### UsePieSeriesContextReturnValue + +```typescript +type UsePieSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UsePieSeriesReturnValue + +```typescript +type UsePieSeriesReturnValue = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### UseRadarAxisParams + +```typescript +type UseRadarAxisParams = { + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### UseRadarItemTooltipReturnValue + +```typescript +type UseRadarItemTooltipReturnValue = { + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; + values: ItemTooltipValue<'radar'>[]; +}; +``` + +### UseRadarSeriesContextReturnValue + +```typescript +type UseRadarSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseRadarSeriesReturnValue + +```typescript +type UseRadarSeriesReturnValue = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### UseRangeBarSeriesContextReturnValue + +```typescript +type UseRangeBarSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseRangeBarSeriesReturnValue + +```typescript +type UseRangeBarSeriesReturnValue = { + hidden: boolean; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + type: 'rangeBar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The id of this series. */ + id: string; + /** Data associated to each range bar. */ + data: (RangeBarValueType | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; +}; +``` + +### UseScatterSeriesContextReturnValue + +```typescript +type UseScatterSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseScatterSeriesReturnValue + +```typescript +type UseScatterSeriesReturnValue = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### VisibilityIdentifier + +```typescript +type VisibilityIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type?: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId?: string; + seriesId: string; +}; +``` + +### VisibilityIdentifierWithType + +```typescript +type VisibilityIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc', +> = { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; +}; +``` + +### XAxis + +```typescript +type XAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### YAxis + +```typescript +type YAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'left' | 'right' | 'none'; + zoom?: boolean | ZoomOptions; + /** + * The width of the axis. + * Set to `'auto'` to automatically calculate the width based on tick label measurements. + * @default 65 if an axis label is provided, 45 otherwise. + */ + width?: number | 'auto'; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### yellowPaletteDark + +```typescript +type yellowPaletteDark = string[]; +``` + +### yellowPaletteLight + +```typescript +type yellowPaletteLight = string[]; +``` + +### ZoomData + +```typescript +type ZoomData = { + /** The id of the zoomed axis. */ + axisId: AxisId; + /** The starting percentage of the zoom range. In the range of 0 to 100. */ + start: number; + /** The ending percentage of the zoom range. In the range of 0 to 100. */ + end: number; +}; +``` + +### ZoomFilterMode + +```typescript +type ZoomFilterMode = 'keep' | 'discard'; +``` + +### ZoomOptions + +```typescript +type ZoomOptions = { + /** + * The starting percentage of the zoom range. In the range of 0 to 100. + * @default 0 + */ + minStart?: number; + /** + * The ending percentage of the zoom range. In the range of 0 to 100. + * @default 100 + */ + maxEnd?: number; + /** + * The step size of the zooming function. Defines the granularity of the zoom. + * @default 5 + */ + step?: number; + /** + * Restricts the minimum span size in the range of 0 to 100. + * + * If the span size is smaller than the minSpan, the span will be resized to the minSpan. + * @default 10 + */ + minSpan?: number; + /** + * Restricts the maximum span size in the range of 0 to 100. + * + * If the span size is larger than the maxSpan, the span will be resized to the maxSpan. + * @default 100 + */ + maxSpan?: number; + /** + * Set to `false` to disable panning. Useful when you want to pan programmatically, + * or to show only a specific section of the chart. + * @default true + */ + panning?: boolean; + /** + * Defines how to filter the axis data when it is outside of the zoomed range of this axis. + * + * - `keep`: The data outside the zoomed range is kept. And the other axes will stay the same. + * - `discard`: The data outside the zoomed range is discarded for the other axes. + * The other axes will be adjusted to fit the zoomed range. + * @default 'keep' + */ + filterMode?: ZoomFilterMode; + /** Configures the zoom slider. The slider is an element that shows the zoomed range and allows its manipulation. */ + slider?: ZoomSliderOptions; +}; +``` + +### ZoomSliderOptions + +```typescript +type ZoomSliderOptions = { + /** If `true`, the slider will be shown. */ + enabled?: boolean; + /** + * The size reserved for the zoom slider. The actual size of the slider might be smaller, so + * increasing this value effectively increases the margin around the slider. + * This means the height for the x-axis and the width for the y-axis. + * @default 48 if preview is enabled, 28 otherwise. + */ + size?: number; + /** + * Defines when the tooltip with the zoom values should be shown. + * - 'always': The tooltip is always shown. + * - 'hover': The tooltip is shown when hovering over the track or thumb. + * - 'never': The tooltip is never shown. + * @default 'hover' + */ + showTooltip?: ZoomSliderShowTooltip; + /** + * If `true`, a preview of the chart will be shown in the slider. + * Can also be an object to configure which series are shown in the preview. + */ + preview?: boolean | ZoomSliderPreviewOptions; +}; +``` + +### ZoomSliderShowTooltip + +```typescript +type ZoomSliderShowTooltip = 'always' | 'hover' | 'never'; +``` + +## External Types + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; +}) => { + identifier: { type: 'pie'; seriesId: string; dataIndex: number }; + color: string; + label: string | undefined; + value: unknown; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { pie?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; + seriesLayout: { pie?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + type: 'pie'; + data: unknown; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id?: string | undefined; + valueFormatter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + color?: string | undefined; + colorGetter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => unknown; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: { + type: 'pie'; + seriesId: string; + dataIndex: number; +}) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: { type: 'pie'; seriesId: string; dataIndex: number }) => { + type: 'pie'; + seriesId: string; + dataIndex: number; +}; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = ( + state: unknown, + point: { x: number; y: number }, +) => { type: 'pie'; seriesId: string; dataIndex: number } | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | null + | undefined, + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number | undefined } | null, +) => unknown; +``` + +### SeriesValueFormatter + +```typescript +type SeriesValueFormatter = (value: number, context: { dataIndex: number }) => string | null; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### Exclude + +```typescript +type Exclude = 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### hideItem + +```typescript +type hideItem = (identifier: unknown) => void; +``` + +### showItem + +```typescript +type showItem = (identifier: unknown) => void; +``` + +### toggleItemVisibility + +```typescript +type toggleItemVisibility = ( + identifier: + | unknown + | { + type: + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc'; + seriesId: string; + }, +) => void; +``` + +### TriggerOptions + +```typescript +type TriggerOptions = 'item' | 'axis' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.bar-series.ts b/docs/pages/x/api/charts/types.bar-series.ts new file mode 100644 index 0000000000000..7ac1436a66c36 --- /dev/null +++ b/docs/pages/x/api/charts/types.bar-series.ts @@ -0,0 +1,4 @@ +import { BarSeries } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesBarSeries = createTypes(import.meta.url, BarSeries); diff --git a/docs/pages/x/api/charts/types.candlestick-chart.md b/docs/pages/x/api/charts/types.candlestick-chart.md new file mode 100644 index 0000000000000..3af385699704c --- /dev/null +++ b/docs/pages/x/api/charts/types.candlestick-chart.md @@ -0,0 +1,1358 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.candlestick-chart.md' + +## API Reference + +### Unstable_CandlestickChart + +Demos: + +- [Candlestick](https://mui.com/x/react-charts/candlestick/) + +API: + +- [Unstable_CandlestickChart API](https://mui.com/x/api/charts/candlestick/) + +**Unstable_CandlestickChart Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line', y: 'line' }` | The configuration of axes highlight. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'ohlc'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: OHLCItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `OHLCSeries[]` | - | The series to display in the candlestick chart. An array of \[\[OHLCSeries]] objects. Currently, only one OHLC series is supported. If would like to display more than one OHLC series, open an issue at https\://github.com/mui/mui-x explaining your use case. | +| seriesConfig | `{ ohlc: ChartSeriesTypeConfig<'ohlc'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `CandlestickChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `CandlestickChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `OHLCItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_CandlestickPlot + +## Additional Types + +### CandlestickChartProps + +````typescript +type CandlestickChartProps = { + /** + * The series to display in the candlestick chart. + * An array of [[OHLCSeries]] objects. + * + * Currently, only one OHLC series is supported. If would like to display more than one OHLC + * series, open an issue at https://github.com/mui/mui-x explaining your use case. + */ + series: OHLCSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line', y: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: CandlestickChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: CandlestickChartSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { ohlc: ChartSeriesTypeConfig<'ohlc'> }; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: OHLCItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: OHLCItemIdentifier | null) => void; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'ohlc'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'ohlc'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### CandlestickChartSlotProps + +```typescript +type CandlestickChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### CandlestickChartSlots + +```typescript +type CandlestickChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### CandlestickPlotProps + +```typescript +type CandlestickPlotProps = {}; +``` + +### OHLCSeries + +```typescript +type OHLCSeries = { + /** The id of this series. */ + id?: SeriesId; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** The OHLC data points. */ + data?: (OHLCValueType | null)[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'ohlc' + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'heatmap' + | 'funnel' + | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** + * The color of the candle body when the close price is greater than or equal to the open price. + * @default (mode) => mode === 'dark' ? '#66bb6a' : '#2e7d32' + */ + upColor?: ChartsColor; + /** + * The color of the candle body when the close price is less than the open price. + * @default (mode) => mode === 'dark' ? '#f44336' : '#d32f2f' + */ + downColor?: ChartsColor; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + type?: 'ohlc'; +}; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### OHLCField + +```typescript +type OHLCField = 'open' | 'high' | 'low' | 'close'; +``` diff --git a/docs/pages/x/api/charts/types.candlestick-chart.ts b/docs/pages/x/api/charts/types.candlestick-chart.ts new file mode 100644 index 0000000000000..54d9e230500d1 --- /dev/null +++ b/docs/pages/x/api/charts/types.candlestick-chart.ts @@ -0,0 +1,4 @@ +import { CandlestickChart } from '@mui/x-charts-premium/CandlestickChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesCandlestickChart = createTypes(import.meta.url, CandlestickChart); diff --git a/docs/pages/x/api/charts/types.candlestick-plot.md b/docs/pages/x/api/charts/types.candlestick-plot.md new file mode 100644 index 0000000000000..bea99fb73a683 --- /dev/null +++ b/docs/pages/x/api/charts/types.candlestick-plot.md @@ -0,0 +1,1358 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.candlestick-plot.md' + +## API Reference + +### Unstable_CandlestickChart + +Demos: + +- [Candlestick](https://mui.com/x/react-charts/candlestick/) + +API: + +- [Unstable_CandlestickChart API](https://mui.com/x/api/charts/candlestick/) + +**Unstable_CandlestickChart Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line', y: 'line' }` | The configuration of axes highlight. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'ohlc'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } \| VisibilityIdentifier<'ohlc'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: OHLCItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `OHLCSeries[]` | - | The series to display in the candlestick chart. An array of \[\[OHLCSeries]] objects. Currently, only one OHLC series is supported. If would like to display more than one OHLC series, open an issue at https\://github.com/mui/mui-x explaining your use case. | +| seriesConfig | `{ ohlc: ChartSeriesTypeConfig<'ohlc'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `CandlestickChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `CandlestickChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `OHLCItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_CandlestickPlot + +## Additional Types + +### CandlestickChartProps + +````typescript +type CandlestickChartProps = { + /** + * The series to display in the candlestick chart. + * An array of [[OHLCSeries]] objects. + * + * Currently, only one OHLC series is supported. If would like to display more than one OHLC + * series, open an issue at https://github.com/mui/mui-x explaining your use case. + */ + series: OHLCSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line', y: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: CandlestickChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: CandlestickChartSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { ohlc: ChartSeriesTypeConfig<'ohlc'> }; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: OHLCItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: OHLCItemIdentifier | null) => void; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'ohlc'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'ohlc'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'ohlc'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'ohlc'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'ohlc'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'ohlc'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'ohlc' } + | VisibilityIdentifier<'ohlc'> + )[]; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### CandlestickChartSlotProps + +```typescript +type CandlestickChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### CandlestickChartSlots + +```typescript +type CandlestickChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'time' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### CandlestickPlotProps + +```typescript +type CandlestickPlotProps = {}; +``` + +### OHLCSeries + +```typescript +type OHLCSeries = { + /** The id of this series. */ + id?: SeriesId; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** The OHLC data points. */ + data?: (OHLCValueType | null)[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { dataIndex: number; field: OHLCField }, + ) => string | null; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'ohlc' + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'heatmap' + | 'funnel' + | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** + * A function to transform the dataset item into an OHLC value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => OHLCValueType | null; + /** + * The keys used to retrieve data from the dataset. + * When provided, all of `open`, `high`, `low`, and `close` must be specified. + */ + datasetKeys?: { open: string; high: string; low: string; close: string }; + /** + * The color of the candle body when the close price is greater than or equal to the open price. + * @default (mode) => mode === 'dark' ? '#66bb6a' : '#2e7d32' + */ + upColor?: ChartsColor; + /** + * The color of the candle body when the close price is less than the open price. + * @default (mode) => mode === 'dark' ? '#f44336' : '#d32f2f' + */ + downColor?: ChartsColor; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + type?: 'ohlc'; +}; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### OHLCField + +```typescript +type OHLCField = 'open' | 'high' | 'low' | 'close'; +``` diff --git a/docs/pages/x/api/charts/types.candlestick-plot.ts b/docs/pages/x/api/charts/types.candlestick-plot.ts new file mode 100644 index 0000000000000..ed17f9fd70d9b --- /dev/null +++ b/docs/pages/x/api/charts/types.candlestick-plot.ts @@ -0,0 +1,4 @@ +import { CandlestickPlot } from '@mui/x-charts-premium/CandlestickChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesCandlestickPlot = createTypes(import.meta.url, CandlestickPlot); diff --git a/docs/pages/x/api/charts/types.chart-image-export-options.md b/docs/pages/x/api/charts/types.chart-image-export-options.md new file mode 100644 index 0000000000000..5b9d9adf3f07a --- /dev/null +++ b/docs/pages/x/api/charts/types.chart-image-export-options.md @@ -0,0 +1,35002 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.chart-image-export-options.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarChartPro + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### blueberryTwilightPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### bluePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsAxis Props:** + +| Prop | Type | Default | Description | +| :-------- | :-------------------- | :------ | :-------------------------------------- | +| slotProps | `ChartsAxisSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsAxisSlots` | `{}` | Overridable component slots. | + +### ChartsAxisHighlight + +Demos: + +- [Custom components](https://mui.com/x/react-charts/components/) + +API: + +- [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/) + +**ChartsAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :--- | :------------------------ | :------ | :---------- | +| x | `ChartsAxisHighlightType` | - | - | +| y | `ChartsAxisHighlightType` | - | - | + +### ChartsAxisTooltipContent + +**ChartsAxisTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | The sort in which series items are displayed in the tooltip. When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. | +| sx | `SxProps` | - | - | + +### ChartsBrushOverlay + +Component that renders visual feedback during brush interaction + +**ChartsBrushOverlay Props:** + +| Prop | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------- | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsClipPath + +API: + +- [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/) + +**ChartsClipPath Props:** + +| Prop | Type | Default | Description | +| :----- | :----------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| offset | `{ top?: number; right?: number; bottom?: number; left?: number }` | - | Offset, in pixels, of the clip path rectangle from the drawing area. A positive value will move the rectangle outside the drawing area. | +| id\* | `string` | - | The id of the clip path. | + +### ChartsColorCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### ChartsColorPaletteCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsContainerPro + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPro` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/) + +**ChartsContainerPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsDataProvider + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/react-charts/composition/) + +API: + +- [ChartsDataProvider API](https://mui.com/x/api/charts/charts-data-provider/) + +**ChartsDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsDataProviderPro + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPro API](https://mui.com/x/api/charts/charts-data-provider-pro/) + +**ChartsDataProviderPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsGrid + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsGrid API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsGrid Props:** + +| Prop | Type | Default | Description | +| :--------- | :--------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| horizontal | `boolean` | - | Displays horizontal grid. | +| vertical | `boolean` | - | Displays vertical grid. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsItemTooltipContent + +**ChartsItemTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sx | `SxProps` | - | - | + +### ChartsLegend + +**ChartsLegend Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :----------------------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | - | The direction of the legend layout. The default depends on the chart. | +| onItemClick | `((event: React.MouseEvent, legendItem: SeriesLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| toggleVisibilityOnClick | `boolean` | `false` | If `true`, clicking on a legend item will toggle the visibility of the corresponding series. | +| className | `string` | - | - | + +### ChartsLoadingOverlay + +**ChartsLoadingOverlay Props:** + +| Prop | Type | Default | Description | +| :--- | :--------------- | :------ | :---------- | +| sx | `SxProps` | - | - | + +### ChartsLocalizationProvider + +Demos: + +- [localization](https://mui.com/x/react-charts/localization/) + +API: + +- [ChartsLocalizationProvider API](https://mui.com/x/api/charts/charts-localization-provider/) + +**ChartsLocalizationProvider Props:** + +| Prop | Type | Default | Description | +| :--------- | :-------------------------- | :------ | :----------------------------------- | +| localeText | `Partial` | - | Localized text for chart components. | +| children | `React.ReactNode` | - | - | + +### ChartsNoDataOverlay + +**ChartsNoDataOverlay Props:** + +| Prop | Type | Default | Description | +| :--- | :--------------- | :------ | :---------- | +| sx | `SxProps` | - | - | + +### ChartsOverlay + +**ChartsOverlay Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------- | :------ | :----------------------------------------- | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| slotProps | `ChartsOverlaySlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsOverlaySlots` | `{}` | Overridable component slots. | + +### ChartsReferenceLine + +**ChartsReferenceLine Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------- | :--------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | +| label | `string` | - | The label to display along the reference line. | +| axisId | `AxisId` | ``The `id` of the first defined axis.`` | The id of the axis used for the reference value. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| labelAlign | `'start' \| 'middle' \| 'end'` | `'middle'` | The alignment if the label is in the chart drawing area. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the label. | +| lineStyle | `React.CSSProperties` | - | The style applied to the line. | +| spacing | `number \| { x?: number; y?: number }` | `{ x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line.` | Additional space around the label in px. Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. | +| x | `string \| number \| Date` | - | The x value associated with the reference line. If defined the reference line will be vertical. | +| y | `string \| number \| Date` | - | The y value associated with the reference line. If defined the reference line will be horizontal. | + +### ChartsSurface + +A helper component that combines `` and `` to provide a surface for drawing charts. +If you need more control over the layers, you can use `` and `` separately. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsSurface API](https://mui.com/x/api/charts/charts-surface/) + +**ChartsSurface Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------- | :------ | :----------------------------------------------------------------------------------------- | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsText + +Helper component to manage multiline text in SVG + +**ChartsText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :---------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text\* | `string` | - | Text displayed. | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### ChartsToolbarImageExportTrigger + +A button that triggers an image export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarImageExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartsToolbarImageExportOptions` | - | The options to apply on the image export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPrintExportTrigger + +A button that triggers a print export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarPrintExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartPrintExportOptions` | - | The options to apply on the Print export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPro + +The chart toolbar component for the pro package. + +**ChartsToolbarPro Props:** + +| Prop | Type | Default | Description | +| :----------------- | :---------------------------------- | :------ | :---------- | +| imageExportOptions | `ChartsToolbarImageExportOptions[]` | - | - | +| printOptions | `ChartsToolbarPrintExportOptions` | - | - | + +### ChartsToolbarZoomInTrigger + +A button that zooms the chart in. +It renders the `baseButton` slot. + +**ChartsToolbarZoomInTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarZoomOutTrigger + +A button that zooms the chart out. +It renders the `baseButton` slot. + +**ChartsToolbarZoomOutTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsTooltip + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | Defines the sort order in which series items are displayed in the axis tooltip. When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. Only applies when `trigger='axis'`. | +| trigger | `'axis' \| 'none' \| 'item'` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### ChartsTooltipContainer + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltipContainer Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `TriggerOptions` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | +| children | `React.ReactNode` | - | - | + +### ChartsWrapper + +Wrapper for the charts components. +Its main purpose is to position the HTML legend in the correct place. + +**ChartsWrapper Props:** + +| Prop | Type | Default | Description | +| :--------------- | :---------------- | :--------------------------------------------------------------- | :----------------------------------------------- | +| extendVertically | `boolean` | `` `false` if the `height` prop is set. And `true` otherwise. `` | If `true`, the chart wrapper set `height: 100%`. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| legendDirection | `Direction` | `'horizontal'` | The direction of the legend. | +| legendPosition | `Position` | `{ horizontal: 'center', vertical: 'bottom' }` | The position of the legend. | +| sx | `SxProps` | - | - | +| children\* | `React.ReactNode` | - | - | + +### ChartsXAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/) + +**ChartsXAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'x'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelMinGap | `number` | `4` | The minimum gap in pixels between two tick labels. If two tick labels are closer than this minimum gap, one of them will be hidden. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsYAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/) + +**ChartsYAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'y'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsZoomSlider + +Renders the zoom slider for all x and y axes that have it enabled. + +### ChartZoomSlider + +### cheerfulFiestaPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ContinuousColorLegend + +**ContinuousColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------------------------------------- | :--------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| gradientId | `string` | `auto-generated id` | The id for the gradient to use. If not provided, it will use the generated gradient from the axis configuration. The `gradientId` will be used as `fill="url(#gradientId)"`. | +| labelPosition | `'start' \| 'end' \| 'extremes'` | `'end'` | Where to position the labels relative to the gradient. | +| maxLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the maximum side of the gradient. Can either be a string, or a function. If not defined, the formatted maximal value is display. | +| minLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the minimum side of the gradient. Can either be a string, or a function. | +| reverse | `boolean` | `false` | If `true`, the gradient and labels will be reversed. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| thickness | `number` | `12` | The thickness of the gradient | +| className | `string` | - | - | + +### cyanPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### defaultOnBeforeExport + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| iframe | `HTMLIFrameElement` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = void; +``` + +### FocusedBar + +### FocusedFunnelSection + +### FocusedHeatmapCell + +### FocusedLineMark + +### FocusedPieArc + +**FocusedPieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color | `string` | - | - | +| cornerRadius | `number` | - | - | +| innerRadius | `number` | - | - | +| outerRadius | `number` | - | - | +| paddingAngle | `number` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | + +### FocusedRadarMark + +### FocusedSankeyLink + +### FocusedSankeyNode + +### FocusedScatterMark + +### FunnelChart + +**FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### FunnelPlot + +**FunnelPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| slotProps | `FunnelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### Gauge + +**Gauge Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| classes | `Partial` | - | - | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeContainer + +**GaugeContainer Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeReferenceArc + +### GaugeValueArc + +**GaugeValueArc Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------- | :------ | :---------- | +| skipAnimation | `boolean` | - | - | + +### GaugeValueText + +**GaugeValueText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### getPieCoordinates + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------------------- | :------ | :---------- | +| series | `LegendItemParams` | - | - | +| drawing | `LegendItemParams` | - | - | + +**Return Value:** + +| Property | Type | Description | +| :---------------- | :------- | :---------- | +| `cx` | `number` | - | +| `cy` | `number` | - | +| `availableRadius` | `number` | - | + +### getValueToPositionMapper + +For a given scale return a function that map value to their position. +Useful when dealing with specific scale such as band. + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------------------- | :------ | :--------------- | +| scale | `D3Scale<{ toString: function toString() { [native code] } }, Range>` | - | The scale to use | + +**Return Value:** + +A function that map value to their position + +```tsx +type ReturnValue = (value: any) => number; +``` + +### greenPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Heatmap + +**Heatmap Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, item: SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>) => void)` | - | The callback fired when an item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: HeatmapItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `HeatmapSeries[]` | - | The series to display in the bar chart. An array of \[\[HeatmapSeries]] objects. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| slotProps | `HeatmapSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltip | `ChartsTooltipProps` | - | The configuration of the tooltip. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `HeatmapItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### HeatmapCell + +Demos: + +- [Heatmap](https://mui.com/x/react-charts/heatmap/) + +API: + +- [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/) + +**HeatmapCell Props:** + +| Prop | Type | Default | Description | +| :----------- | :---------------------- | :------ | :---------- | +| height\* | `number` | - | - | +| ownerState\* | `HeatmapCellOwnerState` | - | - | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### HeatmapData + +**Constructor Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| data | `HeatmapValueType[]` | - | - | + +**Methods:** + +```typescript +function getValue(xIndex: number, yIndex: number): number | null; +``` + +### HeatmapPlot + +**HeatmapPlot Props:** + +| Prop | Type | Default | Description | +| :----------- | :--------------------- | :------ | :------------------------------------------------ | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| slotProps | `HeatmapPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### HeatmapTooltip + +**HeatmapTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### HeatmapTooltipContent + +**HeatmapTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineChartPro + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### mangoFusionPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +### orangePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### PieArc + +**PieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| dataIndex\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| innerRadius\* | `number` | - | - | +| isFaded\* | `boolean` | - | - | +| isFocused\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| outerRadius\* | `number` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | +| startAngle\* | `number` | - | - | + +### PieArcLabel + +**PieArcLabel Props:** + +| Prop | Type | Default | Description | +| :---------------- | :-------------------- | :------ | :---------- | +| hidden | `boolean` | - | - | +| arcLabelRadius\* | `number` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| formattedArcLabel | `string \| null` | - | - | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| startAngle\* | `number` | - | - | + +### PieArcLabelPlot + +**PieArcLabelPlot Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabel | `'formattedValue' \| 'label' \| 'value' \| ((item: { id?: PieItemId; color: string; labelMarkType?: ChartsLabelMarkType; value: number; formattedValue: string; hidden: boolean; label?: string }) => string)` | - | The label displayed into the arc. | +| arcLabelMinAngle | `number` | `0` | The minimal angle required to display the arc label. | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcLabelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcLabelPlotSlots` | `{}` | Overridable component slots. | + +### PieArcPlot + +**PieArcPlot Props:** + +| Prop | Type | Default | Description | +| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcPlotSlots` | `{}` | Overridable component slots. | + +### piecewiseColorDefaultLabelFormatter + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| params | `PiecewiseLabelFormatterParams` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### PiecewiseColorLegend + +**PiecewiseColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------- | :------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :------------------------------------------------------------------ | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| labelFormatter | `((params: PiecewiseLabelFormatterParams) => string \| null)` | - | Format the legend labels. | +| labelPosition | `'start' \| 'end' \| 'extremes' \| 'inline-start' \| 'inline-end'` | `'extremes'` | Where to position the labels relative to the color marks. | +| onItemClick | `((event: React.MouseEvent, legendItem: PiecewiseColorLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| className | `string` | - | - | + +### PieChart + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PieChart API](https://mui.com/x/api/charts/pie-chart/) + +**PieChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PieChartPro + +**PieChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PiePlot + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PiePlot API](https://mui.com/x/api/charts/pie-plot/) + +**PiePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------- | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PiePlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PiePlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### pinkPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### purplePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### RadarAxis + +**RadarAxis Props:** + +| Prop | Type | Default | Description | +| :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| angle | `number` | - | The absolute rotation angle of the metrics (in degree) If not defined the metric angle will be used. | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| divisions | `number` | `1` | The number of divisions with label. | +| dominantBaseline | `'auto' \| 'use-script' \| 'no-change' \| 'reset-size' \| 'ideographic' \| 'alphabetic' \| 'hanging' \| 'mathematical' \| 'central' \| 'middle' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| ((angle: number) => 'auto' \| 'middle' \| 'alphabetic' \| 'hanging' \| 'ideographic' \| 'mathematical' \| 'central' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| 'use-script' \| 'no-change' \| 'reset-size' \| undefined)` | - | The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). | +| labelOrientation | `'horizontal' \| 'rotated'` | `'horizontal'` | Defines how label align with the axis. 'horizontal': labels stay horizontal and their placement change with the axis angle.'rotated': labels are rotated 90deg relatively to their axis. | +| metric | `string` | - | The metric to get. If `undefined`, the hook returns `null` | +| textAnchor | `'start' \| 'middle' \| 'end' \| 'inherit' \| ((angle: number) => 'start' \| 'end' \| 'middle' \| 'inherit' \| undefined)` | - | The labels text anchor or a function returning the text anchor for a given axis angle (in degree). | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarAxisHighlight + +**RadarAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarChart + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarChartPro + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartProSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarDataProvider + +**RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### RadarGrid + +**RadarGrid Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------ | :------------------------------------------------------------------------------------- | :-------------------------------------------------------- | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | + +### RadarMetricLabels + +### RadarSeriesArea + +**RadarSeriesArea Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesMarks + +**RadarSeriesMarks Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesPlot + +**RadarSeriesPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### rainbowSurgePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### redPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### SankeyChart + +Sankey Chart component + +Displays a Sankey diagram, visualizing flows between nodes where the width +of the links is proportional to the flow quantity. + +Demos: + +- [Sankey Chart](https://mui.com/x/react-charts/sankey/) + +API: + +- [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/) + +**SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyDataProvider + +Orchestrates the data providers for the sankey chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +**SankeyDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The highlighted item. Used when the highlight is controlled. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeriesType[]` | - | - | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyLinkLabelPlot + +**SankeyLinkLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyLinkPlot + +**SankeyLinkPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodeLabelPlot + +**SankeyNodeLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodePlot + +**SankeyNodePlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyPlot + +Renders a Sankey diagram plot. + +**SankeyPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| className | `string` | - | A CSS class name applied to the root element. | + +### SankeyTooltip + +**SankeyTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### SankeyTooltipContent + +**SankeyTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### Scatter + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [Scatter API](https://mui.com/x/api/charts/scatter/) + +**Scatter Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| colorGetter\* | `((dataIndex?: number) => string)` | - | Function to get the color of a scatter item given its data index. The data index argument is optional. If not provided, the color for the entire series is returned. If provided, the color for the specific scatter item is returned. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| series\* | `DefaultizedScatterSeriesType` | - | - | +| slotProps | `ScatterSlotProps` | - | - | +| slots | `ScatterSlots` | - | - | +| xScale\* | `D3Scale` | - | - | +| yScale\* | `D3Scale` | - | - | + +### ScatterChart + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterChartPro + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterMarker + +**ScatterMarker Props:** + +| Prop | Type | Default | Description | +| :-------------- | :------------------------------------------------------------ | :------ | :---------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | Callback fired when clicking on a scatter item. | +| color\* | `string` | - | The fill color of the marker. | +| dataIndex\* | `number` | - | The index of the data point. | +| isFaded\* | `boolean` | - | If `true`, the marker is faded. | +| isHighlighted\* | `boolean` | - | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | The series ID. | +| size\* | `number` | - | The size of the marker. | +| x\* | `number` | - | The x coordinate of the data point. | +| y\* | `number` | - | The y coordinate of the data point. | + +### ScatterPlot + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/) + +**ScatterPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :---------------------------------------------------------------------------------------------------------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| classes | `Partial` | - | - | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| slotProps | `ScatterPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### SparkLineChart + +Demos: + +- [SparkLine](https://mui.com/x/react-charts/sparkline/) + +API: + +- [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/) + +**SparkLineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| area | `boolean` | `false` | Set to `true` to fill spark line area. Has no effect if plotType='bar'. | +| axisHighlight | `ChartsAxisHighlightProps` | - | - | +| baseline | `number \| 'min' \| 'max'` | `0` | The value of the line at the base of the series area. `'min'` the area will fill the space **under** the line.`'max'` the area will fill the space **above** the line.`number` the area will fill the space between this value and the line | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| clipAreaOffset | `{ top?: number; right?: number; bottom?: number; left?: number }` | `{ top: 1, right: 1, bottom: 1, left: 1 }` | The clipped area offset in pixels. This prevents partial clipping of lines when they are drawn on the edge of the drawing area. | +| color | `ChartsColor` | `rainbowSurgePalette[0]` | Color used to colorize the sparkline. | +| curve | `CurveType` | `'linear'` | - | +| data\* | `number[]` | - | Data to plot. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClipping | `boolean` | `false` | When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. | +| disableHitArea | `boolean` | - | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| VisibilityIdentifier)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| { type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| VisibilityIdentifier)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | `5` | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| { type: 'bar'; seriesId: string; dataIndex?: number } \| { type: 'line'; seriesId: string; dataIndex?: number } \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| { type: 'pie'; seriesId: string; dataIndex?: number } \| { type: 'radar'; seriesId: string; dataIndex?: number } \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking close to an item. This is only available for scatter plot for now. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| LineItemIdentifier \| ScatterItemIdentifier \| PieItemIdentifier \| RadarItemIdentifier \| HeatmapItemIdentifier \| FunnelItemIdentifier \| SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plotType | `'bar' \| 'line'` | `'line'` | Type of plot used. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'>; line: ChartSeriesTypeConfig<'line'>; scatter: ChartSeriesTypeConfig<'scatter'>; pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> }; radar: ChartSeriesTypeConfig<'radar'>; heatmap: ChartSeriesTypeConfig<'heatmap'>; funnel: ChartSeriesTypeConfig<'funnel'>; sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showHighlight | `boolean` | `false` | Set to `true` to highlight the value. With line, it shows a point. With bar, it shows a highlight band. | +| showTooltip | `boolean` | `false` | Set to `true` to enable the tooltip in the sparkline. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `SparkLineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SparkLineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| LineItemIdentifier \| LegendItemParams \| ScatterItemIdentifier \| LegendItemParams \| PieItemIdentifier \| LegendItemParams \| RadarItemIdentifier \| LegendItemParams \| HeatmapItemIdentifier \| LegendItemParams \| FunnelItemIdentifier \| LegendItemParams \| SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| valueFormatter | `((value: number \| null) => string)` | `(value: number \| null) => (value === null ? '' : value.toString())` | Formatter used by the tooltip. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `XAxis` | - | The xAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| yAxis | `YAxis` | - | The yAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### strawberrySkyPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Unstable_FunnelChart + +**Unstable_FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarChart + +**Unstable_RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarDataProvider + +**Unstable_RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### Unstable_SankeyChart + +**Unstable_SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### useAnimate + +Hook to customize the animation of an element. +Animates a ref from `initialProps` to `props`. + +**useAnimate Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------- | :------ | :----------------------- | +| props | `{}` | - | The props to animate to. | +| \_\_1 | `UseAnimateParams<{}, Element, {}>` | - | - | + +**useAnimate Return Value:** + +an object containing a ref that should be passed to the element to animate and the transformed props. +If `skip` is true, the transformed props are the `props` to animate to; if it is false, the transformed props are the +`initialProps`. + +The animated props are only accessible in `applyProps`. The props returned from this hook are not animated. + +When an animation starts, an interpolator is created using `createInterpolator`. +On every animation frame: + +1. The interpolator is called to get the interpolated props; +2. `transformProps` is called to transform the interpolated props; +3. `applyProps` is called to apply the transformed props to the element. + +If `props` change while an animation is progress, the animation will continue towards the new `props`. + +The animation can be skipped by setting `skip` to true. If a transition is in progress, it will immediately end +and `applyProps` be called with the final value. If there isn't a transition in progress, a new one won't be +started and `applyProps` will not be called. + +```tsx +type ReturnValue = UseAnimateReturn; +``` + +### useAnimateArea + +Animates an area of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateArea Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateAreaParams` | - | - | + +**useAnimateArea Return Value:** + +```tsx +type ReturnValue = UseAnimatedAreaReturn; +``` + +### useAnimateBar + +Animates a bar from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to its +final position. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBar Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------- | :------ | :---------- | +| props | `UseAnimateBarParams` | - | - | + +**useAnimateBar Return Value:** + +```tsx +type ReturnValue = UseAnimateBarReturnValue; +``` + +### useAnimateBarLabel + +Animates a bar label from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to the +center of the bar it belongs to. +The label is horizontally centered within the bar when the layout is vertical, and vertically centered for laid out +horizontally. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBarLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------- | :------ | :---------- | +| props | `UseAnimateBarLabelParams` | - | - | + +**useAnimateBarLabel Return Value:** + +```tsx +type ReturnValue = UseAnimateBarLabelReturn; +``` + +### useAnimateLine + +Animates a line of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateLine Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateLineParams` | - | - | + +**useAnimateLine Return Value:** + +```tsx +type ReturnValue = UseAnimatedReturnValue; +``` + +### useAnimatePieArc + +Animates a slice of a pie chart by increasing the start and end angles from the middle angle to their final values. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArc Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------- | :------ | :---------- | +| props | `UseAnimatePieArcParams` | - | - | + +**useAnimatePieArc Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcReturnValue; +``` + +### useAnimatePieArcLabel + +Animates the label of pie slice from its middle point to the centroid of the slice. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArcLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------- | :------ | :---------- | +| props | `UseAnimatePieArcLabelParams` | - | - | + +**useAnimatePieArcLabel Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcLabelReturn; +``` + +### useAxesTooltip + +Returns the axes to display in the tooltip and the series item related to them. + +**useAxesTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| params | `UseAxesTooltipParams` | - | - | + +**useAxesTooltip Return Value:** + +```tsx +type ReturnValue = + | UseAxesTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'radar' | 'heatmap' | 'funnel', + string | number | Date + >[] + | null; +``` + +### useBarSeries + +Get access to the internal state of bar series. + +**useBarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useBarSeries Return Value:** + +the bar series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + stackOffset?: StackOffsetType; + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + barLabelPlacement?: 'center' | 'outside'; + stack?: string; + stackOrder?: StackOrderType; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + layout: 'horizontal' | 'vertical'; + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useBarSeriesContext + +Get access to the internal state of bar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useBarSeriesContext Return Value:** + +the bar series + +```tsx +type ReturnValue = SeriesProcessorResult<'bar'> | undefined; +``` + +### useBrush + +Get the current brush state. + +- `start` is the starting point of the brush selection. +- `current` is the current point of the brush selection. + +**useBrush Return Value:** + +`{ start, current }` - The brush state. + +```tsx +type ReturnValue = { start: { x: number; y: number }; current: { x: number; y: number } } | null; +``` + +### useChartApiContext + +The `useChartApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProvider` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject>; +``` + +### useChartCartesianAxis + +**useChartCartesianAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartCartesianAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartClosestPoint + +**useChartClosestPoint Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartClosestPoint Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartGradientId + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +For a gradient that respects the coordinates of the object on which it is applied, use `useChartGradientIdObjectBound` instead. + +**useChartGradientId Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientId Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartGradientIdObjectBound + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +This gradient differs from `useChartGradientId` in that it respects the coordinates of the object on which it is applied. + +**useChartGradientIdObjectBound Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientIdObjectBound Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartHighlight + +**useChartHighlight Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartHighlight Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartId + +Get the unique identifier of the chart. + +**useChartId Return Value:** + +chartId if it exists. + +```tsx +type ReturnValue = string | undefined; +``` + +### useChartInteraction + +**useChartInteraction Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartInteraction Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartPolarAxis + +**useChartPolarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartPolarAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartProApiContext + +The `useChartProApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProviderPro` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartProApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartProApiRef + +Hook that instantiates a \[\[ChartProApiRef]]. +The chart type needs to be given as the generic parameter to narrow down the API to the specific chart type. + +**useChartProApiRef Return Value:** + +```tsx +type ReturnValue = React.RefObject< + | ChartProApi< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition', + ChartAnyPluginSignature[] + > + | undefined +>; +``` + +### useChartProExport + +**useChartProExport Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProExport Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartProZoom + +**useChartProZoom Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProZoom Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartRootRef + +Get the ref for the root chart element. + +**useChartRootRef Return Value:** + +The root chart element ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLayerContainerRef + +Get the ref for the chart surface element. + +**useChartsLayerContainerRef Return Value:** + +The chart surface ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLocalization + +**useChartsLocalization Return Value:** + +```tsx +type ReturnValue = ChartsLocalizationContextValue; +``` + +### useChartTooltip + +**useChartTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartTooltip Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartVisibilityManager + +**useChartVisibilityManager Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------------------ | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartVisibilityManager Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartZAxis + +**useChartZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartZAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useDataset + +Get access to the dataset used to populate series and axes data. + +**useDataset Return Value:** + +The dataset array if provided, otherwise undefined. + +```tsx +type ReturnValue = Readonly[]> | undefined; +``` + +### useDrawingArea + +Get the drawing area dimensions and coordinates. The drawing area is the area where the chart is rendered. + +It includes the left, top, width, height, bottom, and right dimensions. + +**useDrawingArea Return Value:** + +The drawing area dimensions. + +```tsx +type ReturnValue = ChartDrawingArea; +``` + +### useFocusedItem + +Get the focused item from keyboard navigation. + +**useFocusedItem Return Value:** + +```tsx +type ReturnValue = FocusedItemIdentifier | null; +``` + +### useFunnelSeries + +Get access to the internal state of funnel series. + +**useFunnelSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useFunnelSeries Return Value:** + +the funnel series + +```tsx +type ReturnValue = DefaultizedFunnelSeriesType | undefined; +``` + +### useFunnelSeriesContext + +Get access to the internal state of funnel series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useFunnelSeriesContext Return Value:** + +the funnel series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useGaugeState + +**useGaugeState Return Value:** + +```tsx +type ReturnValue = { + value: number | null; + valueMin: number; + valueMax: number; + startAngle: number; + endAngle: number; + innerRadius: number; + outerRadius: number; + cornerRadius: number; + cx: number; + cy: number; + maxRadius: number; + valueAngle: number | null; +}; +``` + +### useHeatmapSeries + +Get access to the internal state of heatmap series. + +**useHeatmapSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useHeatmapSeries Return Value:** + +the heatmap series + +```tsx +type ReturnValue = DefaultizedHeatmapSeriesType | undefined; +``` + +### useHeatmapSeriesContext + +Get access to the internal state of heatmap series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useHeatmapSeriesContext Return Value:** + +the heatmap series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useIsZoomInteracting + +Get access to the zoom state. + +**useIsZoomInteracting Return Value:** + +Inform the zoom is interacting. + +```tsx +type ReturnValue = boolean; +``` + +### useItemHighlightState + +A hook to check the highlighted state of the item. +This function already calculates that an item is not faded if it is highlighted. + +If you need fine control over the state, use the `useItemHighlightStateGetter` hook instead. + +**useItemHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------------- | :------ | :------------------- | +| item | `UseItemHighlightedParams<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | is the item to check | + +**useItemHighlightState Return Value:** + +the state of the item + +```tsx +type ReturnValue = HighlightState; +``` + +### useItemHighlightStateGetter + +A hook to get a callback that returns the highlight state of an item. + +If you're interested by a single item, consider using `useItemHighlightState`. + +**useItemHighlightStateGetter Return Value:** + +callback to get the highlight state of an item. + +```tsx +type ReturnValue = (item: any | null) => HighlightState; +``` + +### useItemTooltip + +Returns a config object when the tooltip contains a single item to display. +Some specific charts like radar need more complex structure. Use specific hook like `useRadarItemTooltip` for them. + +**useItemTooltip Return Value:** + +The tooltip item config + +```tsx +type ReturnValue = UseItemTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'pie' | 'heatmap' | 'funnel' | 'sankey' +> | null; +``` + +### useLegend + +Get the legend items to display. + +This hook is used by the `ChartsLegend` component. And will return the legend items formatted for display. + +An alternative is to use the `useSeries` hook and format the legend items yourself. + +**useLegend Return Value:** + +legend data + +| Property | Type | Description | +| :------- | :------------------------- | :---------- | +| items | `SeriesLegendItemParams[]` | - | + +### useLineSeries + +Get access to the internal state of line series. + +**useLineSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useLineSeries Return Value:** + +the line series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + baseline?: number | 'min' | 'max'; + stackOffset?: StackOffsetType; + stack?: string; + stackOrder?: StackOrderType; + area?: boolean; + curve?: CurveType; + strictStepCurve?: boolean; + showMark?: boolean | ((params: ShowMarkParams) => boolean); + shape?: MarkShape; + disableHighlight?: boolean; + connectNulls?: boolean; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useLineSeriesContext + +Get access to the internal state of line series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useLineSeriesContext Return Value:** + +the line series + +```tsx +type ReturnValue = SeriesProcessorResult<'line'> | undefined; +``` + +### usePieSeries + +Get access to the internal state of pie series. + +**usePieSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**usePieSeries Return Value:** + +the pie series + +```tsx +type ReturnValue = DefaultizedPieSeriesType | undefined; +``` + +### usePieSeriesContext + +Get access to the internal state of pie series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**usePieSeriesContext Return Value:** + +the pie series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadarAxis + +Returns an array with one item per metric with the different points to label. + +**useRadarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| params | `UseRadarAxisParams` | - | - | + +**useRadarAxis Return Value:** + +```tsx +type ReturnValue = { + metric: string; + angle: number; + center: { x: number; y: number }; + labels: { x: number; y: number; value: number | Date; formattedValue: string }[]; +} | null; +``` + +### useRadarItemTooltip + +Contains an object per value with their content and the label of the associated metric. + +**useRadarItemTooltip Return Value:** + +The tooltip item configs + +```tsx +type ReturnValue = UseRadarItemTooltipReturnValue | null; +``` + +### useRadarSeries + +Get access to the internal state of radar series. + +**useRadarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useRadarSeries Return Value:** + +the radar series + +```tsx +type ReturnValue = DefaultizedRadarSeriesType | undefined; +``` + +### useRadarSeriesContext + +Get access to the internal state of radar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useRadarSeriesContext Return Value:** + +the radar series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadiusAxes + +Get all the radius axes for polar charts. + +Returns all radial axes configured in polar charts along with their IDs. +Radius axes are used in charts like `RadarChart` to define radial positioning and scaling. + +**useRadiusAxes Return Value:** + +An object containing: + +- `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `radiusAxisIds`: An array of all radius axis IDs in the chart + +| Property | Type | Description | +| :------------ | :--------------------------------------------- | :---------- | +| radiusAxis | `DefaultizedAxisConfig` | - | +| radiusAxisIds | `string[]` | - | + +### useRadiusAxis + +Get a specific radius axis or the default radius axis for polar charts. + +Returns the configuration and scale for a radial axis in polar charts. +The radius axis controls the radial distance of data points from the center of the circle. + +**useRadiusAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's radius axis configurationUndefined to get the default (first) radius axis | + +**useRadiusAxis Return Value:** + +The radius axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRadiusAxisProps + > + | undefined; +``` + +### useRadiusScale + +Get the radius scale. + +**useRadiusScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `radiusAxis` propUndefined to get the default radius axis | + +**useRadiusScale Return Value:** + +The radius axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useRotationAxes + +Get all the rotation axes for polar charts. + +Returns all rotation axes configured in polar charts along with their IDs. +Rotation axes are used in charts like `RadarChart` to define angular positioning. + +**useRotationAxes Return Value:** + +An object containing: + +- `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `rotationAxisIds`: An array of all rotation axis IDs in the chart + +| Property | Type | Description | +| :-------------- | :----------------------------------------------- | :---------- | +| rotationAxis | `DefaultizedAxisConfig` | - | +| rotationAxisIds | `string[]` | - | + +### useRotationAxis + +Get a specific rotation axis or the default rotation axis for polar charts. + +Returns the configuration and scale for a rotation axis in polar charts. +The rotation axis controls the angular positioning of data points around the circle. + +**useRotationAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's rotation axis configurationUndefined to get the default (first) rotation axis | + +**useRotationAxis Return Value:** + +The rotation axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRotationAxisProps + > + | undefined; +``` + +### useRotationScale + +Get the rotation scale. + +**useRotationScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `rotationAxis` propUndefined to get the default rotation axis | + +**useRotationScale Return Value:** + +The rotation axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useSankeyLayout + +Get access to the sankey layout. + +**useSankeyLayout Return Value:** + +the sankey layout + +```tsx +type ReturnValue = SankeyLayout | undefined; +``` + +### useSankeyLinkHighlightState + +**useSankeyLinkHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| linkIdentifier | `SankeyLinkIdentifier` | - | - | + +**useSankeyLinkHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeyNodeHighlightState + +**useSankeyNodeHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| nodeIdentifier | `SankeyNodeIdentifier` | - | - | + +**useSankeyNodeHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeySeries + +Get access to the internal state of sankey series. + +**useSankeySeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useSankeySeries Return Value:** + +the sankey series + +```tsx +type ReturnValue = DefaultizedSankeySeriesType | undefined; +``` + +### useSankeySeriesContext + +Get access to the internal state of sankey series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useSankeySeriesContext Return Value:** + +the sankey series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useScatterSeries + +Get access to the internal state of scatter series. + +**useScatterSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useScatterSeries Return Value:** + +the scatter series + +```tsx +type ReturnValue = DefaultizedScatterSeriesType | undefined; +``` + +### useScatterSeriesContext + +Get access to the internal state of scatter series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useScatterSeriesContext Return Value:** + +the scatter series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useSeries + +Get access to the internal state of series. +Structured by type of series: +{ seriesType?: { series: { id1: precessedValue, ... }, seriesOrder: \[id1, ...] } } + +**useSeries Return Value:** + +FormattedSeries series + +```tsx +type ReturnValue = ProcessedSeries; +``` + +### useXAxes + +Get all the x-axes. + +Returns all X axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useXAxes Return Value:** + +An object containing: + +- `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `xAxisIds`: An array of all X axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| xAxis | `ComputedAxisConfig` | - | +| xAxisIds | `AxisId[]` | - | + +### useXAxis + +Get a specific X axis or the default X axis. + +**useXAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXAxis Return Value:** + +The configuration for a single X axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsXAxisProps +>; +``` + +### useXAxisCoordinates + +Get the coordinates of the given X axis. The coordinates are relative to the SVG's origin. + +**useXAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisCoordinates Return Value:** + +The coordinates of the X axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useXAxisTicks + +Returns the ticks for the given X axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useXAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useXColorScale + +Get the X axis color scale. + +**useXColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useXColorScale Return Value:** + +The color scale for the specified X axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useXScale + +Get the X scale. + +**useXScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXScale Return Value:** + +The X axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useYAxes + +Get all the y-axes. + +Returns all Y axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useYAxes Return Value:** + +An object containing: + +- `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `yAxisIds`: An array of all Y axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| yAxis | `ComputedAxisConfig` | - | +| yAxisIds | `AxisId[]` | - | + +### useYAxis + +Get a specific Y axis or the default Y axis. + +**useYAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYAxis Return Value:** + +The configuration for a single Y axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsYAxisProps +>; +``` + +### useYAxisCoordinates + +Returns the coordinates of the given Y axis. The coordinates are relative to the SVG's origin. + +**useYAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisCoordinates Return Value:** + +The coordinates of the Y axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useYAxisTicks + +Returns the ticks for the given Y axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useYAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useYColorScale + +Get the Y axis color scale. + +**useYColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useYColorScale Return Value:** + +The color scale for the specified Y axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useYScale + +Get the Y scale. + +**useYScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYScale Return Value:** + +The Y axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useZAxes + +**useZAxes Return Value:** + +| Property | Type | Description | +| :------- | :----------------------- | :---------- | +| zAxis | `DefaultizedZAxisConfig` | - | +| zAxisIds | `AxisId[]` | - | + +### useZAxis + +**useZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :--------- | :----------------- | :------ | :---------- | +| identifier | `number \| string` | - | - | + +**useZAxis Return Value:** + +```tsx +type ReturnValue = ZAxisDefaultized; +``` + +### useZColorScale + +Get the Z axis color scale. + +**useZColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useZColorScale Return Value:** + +The color scale for the specified Z axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### yellowPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +## Additional Types + +### AllSeriesType + +```typescript +type AllSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | MakeOptional[] + | number[] + | FunnelValueType[] + | SankeyData; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter> + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null); + /** The id of this series. */ + id?: SeriesId; +}; +``` + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AXIS_LABEL_DEFAULT_HEIGHT + +```typescript +type AXIS_LABEL_DEFAULT_HEIGHT = 20; +``` + +### axisClasses + +```typescript +type axisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### AxisConfig + +Use this type for advanced typing. For basic usage, use `XAxis`, `YAxis`, `RotationAxis` or `RadiusAxis`. + +```typescript +type AxisConfig = { offset?: number } & CommonAxisConfig & { min?: NumberValue; max?: NumberValue } | {} & Omit, 'axisId'> & Partial | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig }, 'scale'>> & AxisSideConfig & TickParams & AxisConfigExtension +``` + +### AxisCoordinates + +```typescript +type AxisCoordinates = { left: number; top: number; right: number; bottom: number }; +``` + +### AxisItemIdentifier + +Identifies a data point within an axis. + +```typescript +type AxisItemIdentifier = { + /** The axis id. */ + axisId: AxisId; + /** The data index. */ + dataIndex: number; +}; +``` + +### AxisValueFormatterContext + +```typescript +type AxisValueFormatterContext< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', +> = + | { location: 'legend' } + | { + location: 'tooltip' | 'zoom-slider-tooltip'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + } + | { + location: 'tick'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + defaultTickLabel: string; + tickNumber?: number; + }; +``` + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BAR_CHART_PRO_PLUGINS + +```typescript +type BAR_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartProPluginSignatures + +```typescript +type BarChartProPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartProProps + +````typescript +type BarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartProSlotProps + +```typescript +type BarChartProSlotProps = { + bar?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + barLabel?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartProSlots + +```typescript +type BarChartProSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'label' | 'root' | 'series' | 'element' | 'seriesLabels' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + seriesId: string; + dataIndex: number; + color: string; + classes?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarItemIdentifier + +An object that allows to identify a single bar. +Used for item interaction + +```typescript +type BarItemIdentifier = { type: 'bar'; seriesId: string; dataIndex: number }; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +### BarSeriesType + +```typescript +type BarSeriesType = { + type: 'bar'; + /** Data associated to each bar. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize?: number; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### BarValueType + +```typescript +type BarValueType = number; +``` + +### blueberryTwilightPaletteDark + +```typescript +type blueberryTwilightPaletteDark = string[]; +``` + +### blueberryTwilightPaletteLight + +```typescript +type blueberryTwilightPaletteLight = string[]; +``` + +### bluePaletteDark + +```typescript +type bluePaletteDark = string[]; +``` + +### bluePaletteLight + +```typescript +type bluePaletteLight = string[]; +``` + +### brushOverlayClasses + +```typescript +type brushOverlayClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the brush lines. */ + rect: string; + /** Styles applied when the brush is selecting the x axis. */ + x: string; + /** Styles applied when the brush is selecting the y axis. */ + y: string; +}; +``` + +### BrushOverlayClasses + +```typescript +type BrushOverlayClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the brush lines. */ + rect: string; + /** Styles applied when the brush is selecting the x axis. */ + x: string; + /** Styles applied when the brush is selecting the y axis. */ + y: string; +}; +``` + +### BrushOverlayClassKey + +```typescript +type BrushOverlayClassKey = 'x' | 'y' | 'root' | 'rect'; +``` + +### CartesianChartSeriesType + +```typescript +type CartesianChartSeriesType = 'bar' | 'line' | 'scatter' | 'heatmap' | 'funnel'; +``` + +### CategoryAxis + +```typescript +type CategoryAxis = { + /** + * The categories to be displayed on the axis. + * The order of the categories is the order in which they are displayed. + */ + categories?: string[]; + /** + * The position of the axis. + * - 'left' - The axis is positioned on the left side of the chart. + * - 'right' - The axis is positioned on the right side of the chart. + * - 'top' - The axis is positioned on the top side of the chart. + * - 'bottom' - The axis is positioned on the bottom side of the chart. + * - 'none' - The axis is not displayed. + */ + position?: 'left' | 'right' | 'top' | 'bottom' | 'none'; + /** + * The size of the axis. + * - If the axis is horizontal, the size is the height of the axis. + * - If the axis is vertical, the size is the width of the axis. + * - If set to `'auto'`, the size is automatically calculated based on tick label measurements. + */ + size?: number | 'auto'; + scaleType?: 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### ChartApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartApi< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'composition' | undefined = undefined, + TSignatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### chartAxisZoomSliderThumbClasses + +```typescript +type chartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClasses + +```typescript +type ChartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClassKey + +```typescript +type ChartAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartAxisZoomSliderTrackClasses + +```typescript +type chartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClasses + +```typescript +type ChartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClassKey + +```typescript +type ChartAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartBaseButtonProps + +```typescript +type ChartBaseButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; +``` + +### ChartBaseCommonProps + +```typescript +type ChartBaseCommonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +}; +``` + +### ChartBaseIconButtonProps + +```typescript +type ChartBaseIconButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; +}; +``` + +### ChartBaseIconProps + +```typescript +type ChartBaseIconProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +``` + +### ChartDrawingArea + +```typescript +type ChartDrawingArea = { + /** The gap between the left border of the SVG and the drawing area. */ + left: number; + /** The gap between the top border of the SVG and the drawing area. */ + top: number; + /** The gap between the bottom border of the SVG and the drawing area. */ + bottom: number; + /** The gap between the right border of the SVG and the drawing area. */ + right: number; + /** The width of the drawing area. */ + width: number; + /** The height of the drawing area. */ + height: number; +}; +``` + +### ChartImageExportOptions + +The options to apply on the image export. + +```typescript +type ChartImageExportOptions = { + /** + * The format of the image to be exported. + * Browsers are required to support 'image/png'. Some browsers also support 'image/jpeg' and 'image/webp'. + * If the provided `type` is not supported by the browser, it will default to 'image/png'. + * @default 'image/png' + */ + type?: string; + /** + * The quality of the image to be exported between 0 and 1. This is only applicable for lossy formats, such as + * 'image/jpeg' and 'image/webp'. 'image/png' does not support this option. + * @default 0.9 + */ + quality?: number; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartPrintExportOptions + +The options to apply on the Print export. + +```typescript +type ChartPrintExportOptions = { + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartProApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartProApi< + ChartType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition' + | undefined = undefined, + Signatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### ChartsAxisClasses + +```typescript +type ChartsAxisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### ChartsAxisClassKey + +```typescript +type ChartsAxisClassKey = + | 'line' + | 'label' + | 'tick' + | 'bottom' + | 'left' + | 'right' + | 'top' + | 'root' + | 'tickContainer' + | 'tickLabel' + | 'directionX' + | 'directionY'; +``` + +### ChartsAxisData + +The data format returned by onAxisClick. + +```typescript +type ChartsAxisData = { + /** The index in the axis' data property. */ + dataIndex: number; + /** Tha value associated to the axis item. */ + axisValue: number | Date | string; + /** The mapping of series ids to their value for this particular axis index. */ + seriesValues: Record; +}; +``` + +### chartsAxisHighlightClasses + +```typescript +type chartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClasses + +```typescript +type ChartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClassKey + +```typescript +type ChartsAxisHighlightClassKey = 'root'; +``` + +### ChartsAxisHighlightPath + +```typescript +type ChartsAxisHighlightPath = StyledComponent< + MUIStyledCommonProps & { ownerState: { axisHighlight: ChartsAxisHighlightType } }, + Pick< + React.SVGProps, + | 'string' + | 'id' + | 'min' + | 'max' + | 'type' + | 'color' + | 'scale' + | 'className' + | 'offset' + | 'end' + | 'height' + | 'x' + | 'style' + | 'width' + | 'ref' + | 'dominantBaseline' + | 'suppressHydrationWarning' + | 'lang' + | 'media' + | 'method' + | 'name' + | 'nonce' + | 'part' + | 'slot' + | 'target' + | 'role' + | 'tabIndex' + | 'crossOrigin' + | 'accentHeight' + | 'accumulate' + | 'additive' + | 'alignmentBaseline' + | 'allowReorder' + | 'alphabetic' + | 'amplitude' + | 'arabicForm' + | 'ascent' + | 'attributeName' + | 'attributeType' + | 'autoReverse' + | 'azimuth' + | 'baseFrequency' + | 'baselineShift' + | 'baseProfile' + | 'bbox' + | 'begin' + | 'bias' + | 'by' + | 'calcMode' + | 'capHeight' + | 'clip' + | 'clipPath' + | 'clipPathUnits' + | 'clipRule' + | 'colorInterpolation' + | 'colorInterpolationFilters' + | 'colorProfile' + | 'colorRendering' + | 'contentScriptType' + | 'contentStyleType' + | 'cursor' + | 'cx' + | 'cy' + | 'd' + | 'decelerate' + | 'descent' + | 'diffuseConstant' + | 'direction' + | 'display' + | 'divisor' + | 'dur' + | 'dx' + | 'dy' + | 'edgeMode' + | 'elevation' + | 'enableBackground' + | 'exponent' + | 'externalResourcesRequired' + | 'fill' + | 'fillOpacity' + | 'fillRule' + | 'filter' + | 'filterRes' + | 'filterUnits' + | 'floodColor' + | 'floodOpacity' + | 'focusable' + | 'fontFamily' + | 'fontSize' + | 'fontSizeAdjust' + | 'fontStretch' + | 'fontStyle' + | 'fontVariant' + | 'fontWeight' + | 'format' + | 'fr' + | 'from' + | 'fx' + | 'fy' + | 'g1' + | 'g2' + | 'glyphName' + | 'glyphOrientationHorizontal' + | 'glyphOrientationVertical' + | 'glyphRef' + | 'gradientTransform' + | 'gradientUnits' + | 'hanging' + | 'horizAdvX' + | 'horizOriginX' + | 'href' + | 'ideographic' + | 'imageRendering' + | 'in2' + | 'in' + | 'intercept' + | 'k1' + | 'k2' + | 'k3' + | 'k4' + | 'k' + | 'kernelMatrix' + | 'kernelUnitLength' + | 'kerning' + | 'keyPoints' + | 'keySplines' + | 'keyTimes' + | 'lengthAdjust' + | 'letterSpacing' + | 'lightingColor' + | 'limitingConeAngle' + | 'local' + | 'markerEnd' + | 'markerHeight' + | 'markerMid' + | 'markerStart' + | 'markerUnits' + | 'markerWidth' + | 'mask' + | 'maskContentUnits' + | 'maskUnits' + | 'mathematical' + | 'mode' + | 'numOctaves' + | 'opacity' + | 'operator' + | 'order' + | 'orient' + | 'orientation' + | 'origin' + | 'overflow' + | 'overlinePosition' + | 'overlineThickness' + | 'paintOrder' + | 'panose1' + | 'path' + | 'pathLength' + | 'patternContentUnits' + | 'patternTransform' + | 'patternUnits' + | 'pointerEvents' + | 'points' + | 'pointsAtX' + | 'pointsAtY' + | 'pointsAtZ' + | 'preserveAlpha' + | 'preserveAspectRatio' + | 'primitiveUnits' + | 'r' + | 'radius' + | 'refX' + | 'refY' + | 'renderingIntent' + | 'repeatCount' + | 'repeatDur' + | 'requiredExtensions' + | 'requiredFeatures' + | 'restart' + | 'result' + | 'rotate' + | 'rx' + | 'ry' + | 'seed' + | 'shapeRendering' + | 'slope' + | 'spacing' + | 'specularConstant' + | 'specularExponent' + | 'speed' + | 'spreadMethod' + | 'startOffset' + | 'stdDeviation' + | 'stemh' + | 'stemv' + | 'stitchTiles' + | 'stopColor' + | 'stopOpacity' + | 'strikethroughPosition' + | 'strikethroughThickness' + | 'stroke' + | 'strokeDasharray' + | 'strokeDashoffset' + | 'strokeLinecap' + | 'strokeLinejoin' + | 'strokeMiterlimit' + | 'strokeOpacity' + | 'strokeWidth' + | 'surfaceScale' + | 'systemLanguage' + | 'tableValues' + | 'targetX' + | 'targetY' + | 'textAnchor' + | 'textDecoration' + | 'textLength' + | 'textRendering' + | 'to' + | 'transform' + | 'u1' + | 'u2' + | 'underlinePosition' + | 'underlineThickness' + | 'unicode' + | 'unicodeBidi' + | 'unicodeRange' + | 'unitsPerEm' + | 'vAlphabetic' + | 'values' + | 'vectorEffect' + | 'version' + | 'vertAdvY' + | 'vertOriginX' + | 'vertOriginY' + | 'vHanging' + | 'vIdeographic' + | 'viewBox' + | 'viewTarget' + | 'visibility' + | 'vMathematical' + | 'widths' + | 'wordSpacing' + | 'writingMode' + | 'x1' + | 'x2' + | 'xChannelSelector' + | 'xHeight' + | 'xlinkActuate' + | 'xlinkArcrole' + | 'xlinkHref' + | 'xlinkRole' + | 'xlinkShow' + | 'xlinkTitle' + | 'xlinkType' + | 'xmlBase' + | 'xmlLang' + | 'xmlns' + | 'xmlnsXlink' + | 'xmlSpace' + | 'y1' + | 'y2' + | 'y' + | 'yChannelSelector' + | 'z' + | 'zoomAndPan' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + >, + {} +>; +``` + +### ChartsAxisHighlightProps + +```typescript +type ChartsAxisHighlightProps = { x?: ChartsAxisHighlightType; y?: ChartsAxisHighlightType }; +``` + +### ChartsAxisHighlightType + +```typescript +type ChartsAxisHighlightType = 'none' | 'line' | 'band'; +``` + +### ChartsAxisProps + +```typescript +type ChartsAxisProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsAxisSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsAxisSlotProps; +}; +``` + +### ChartsAxisSlotProps + +```typescript +type ChartsAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsAxisSlots + +```typescript +type ChartsAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsAxisTooltipContentClasses + +```typescript +type ChartsAxisTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsAxisTooltipContentProps + +```typescript +type ChartsAxisTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; + /** + * The sort in which series items are displayed in the tooltip. + * When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### chartsAxisZoomSliderThumbClasses + +```typescript +type chartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClasses + +```typescript +type ChartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClassKey + +```typescript +type ChartsAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartsAxisZoomSliderTrackClasses + +```typescript +type chartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClasses + +```typescript +type ChartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClassKey + +```typescript +type ChartsAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartsBaseSlots + +```typescript +type ChartsBaseSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### ChartsBrushOverlayProps + +```typescript +type ChartsBrushOverlayProps = { + /** A CSS class name applied to the root element. */ + className?: string; +}; +``` + +### ChartsClipPathProps + +```typescript +type ChartsClipPathProps = { + /** The id of the clip path. */ + id: string; + /** + * Offset, in pixels, of the clip path rectangle from the drawing area. + * + * A positive value will move the rectangle outside the drawing area. + */ + offset?: { top?: number; right?: number; bottom?: number; left?: number }; +}; +``` + +### ChartsColor + +```typescript +type ChartsColor = string | ChartsColorCallback; +``` + +### ChartsColorPalette + +```typescript +type ChartsColorPalette = string[] | ChartsColorPaletteCallback; +``` + +### ChartsContainerProProps + +```typescript +type ChartsContainerProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsContainerProSlotProps + +```typescript +type ChartsContainerProSlotProps = {}; +``` + +### ChartsContainerProSlots + +```typescript +type ChartsContainerProSlots = {}; +``` + +### ChartsDataProviderProProps + +```typescript +type ChartsDataProviderProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProps + +```typescript +type ChartsDataProviderProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartClosestPointSignature, + UseChartKeyboardNavigationSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProSlotProps + +```typescript +type ChartsDataProviderProSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderProSlots + +```typescript +type ChartsDataProviderProSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### ChartsDataProviderSlotProps + +```typescript +type ChartsDataProviderSlotProps = { + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ChartsDataProviderSlots + +```typescript +type ChartsDataProviderSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### chartsGridClasses + +```typescript +type chartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClasses + +```typescript +type ChartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClassKey + +```typescript +type ChartsGridClassKey = 'line' | 'root' | 'horizontalLine' | 'verticalLine'; +``` + +### ChartsGridProps + +```typescript +type ChartsGridProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Displays vertical grid. */ + vertical?: boolean; + /** Displays horizontal grid. */ + horizontal?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### ChartsIconSlots + +```typescript +type ChartsIconSlots = {}; +``` + +### ChartsItemTooltipContentClasses + +```typescript +type ChartsItemTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsItemTooltipContentProps + +```typescript +type ChartsItemTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; +}; +``` + +### ChartsLabel + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabel = unknown; +``` + +### ChartsLabelClasses + +```typescript +type ChartsLabelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsLabelCustomMarkProps + +```typescript +type ChartsLabelCustomMarkProps = { + className?: string; + /** Color of the series this mark refers to. */ + color?: string; +}; +``` + +### ChartsLabelGradientClasses + +```typescript +type ChartsLabelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### ChartsLabelMark + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabelMark = unknown; +``` + +### ChartsLabelMarkClasses + +```typescript +type ChartsLabelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### ChartsLabelMarkProps + +```typescript +type ChartsLabelMarkProps = { + /** + * The type of the mark. + * @default 'square' + */ + type?: ChartsLabelMarkType; + /** + * The mark will be rendered as a combination of a line and the specified mark type. + * The line will be rendered first, followed by the mark. + * Only used if `type='line+mark'`. + */ + markShape?: MarkShape; + /** The color of the mark. */ + color?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLabelProps + +```typescript +type ChartsLabelProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLegendClasses + +```typescript +type ChartsLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### ChartsLegendPosition + +```typescript +type ChartsLegendPosition = { + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; +}; +``` + +### ChartsLegendProps + +```typescript +type ChartsLegendProps = { + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * If `true`, clicking on a legend item will toggle the visibility of the corresponding series. + * @default false + */ + toggleVisibilityOnClick?: boolean; + className?: string; + sx?: SxProps; + tabIndex?: number; +}; +``` + +### ChartsLegendSlotExtension + +```typescript +type ChartsLegendSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsLegendSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsLegendSlotProps; +}; +``` + +### ChartsLegendSlotProps + +```typescript +type ChartsLegendSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; +}; +``` + +### ChartsLegendSlots + +```typescript +type ChartsLegendSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; +}; +``` + +### ChartsLocalizationProviderProps + +```typescript +type ChartsLocalizationProviderProps = { + children?: React.ReactNode; + /** Localized text for chart components. */ + localeText?: Partial; +}; +``` + +### ChartsOverlayProps + +```typescript +type ChartsOverlayProps = { + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsOverlaySlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsOverlaySlotProps; +}; +``` + +### ChartsOverlaySlotProps + +```typescript +type ChartsOverlaySlotProps = { + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; +}; +``` + +### ChartsOverlaySlots + +```typescript +type ChartsOverlaySlots = { + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsPieSorting + +```typescript +type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number); +``` + +### ChartsReferenceLineClasses + +```typescript +type ChartsReferenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### ChartsReferenceLineClassKey + +```typescript +type ChartsReferenceLineClassKey = 'line' | 'label' | 'root' | 'horizontal' | 'vertical'; +``` + +### ChartsReferenceLineProps + +```typescript +type ChartsReferenceLineProps = ( + | { x?: undefined; y: string | number | Date } + | { y?: undefined; x: string | number | Date } +) & { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### chartsSurfaceClasses + +```typescript +type chartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceClasses + +```typescript +type ChartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceProps + +```typescript +type ChartsSurfaceProps = { + className?: string; + sx?: SxProps; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; +}; +``` + +### ChartsTextProps + +```typescript +type ChartsTextProps = { + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** Text displayed. */ + text: string; + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### ChartsTextStyle + +```typescript +type ChartsTextStyle = { + angle?: number; + /** + * The text baseline + * @default 'central' + */ + dominantBaseline?: ChartsTextBaseline; + /** + * The text anchor + * @default 'middle' + */ + textAnchor?: ChartsTextAnchor; +}; +``` + +### ChartsToolbarImageExportOptions + +```typescript +type ChartsToolbarImageExportOptions = { + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; + /** + * The quality of the image to be exported between 0 and 1. This is only applicable for lossy formats, such as + * 'image/jpeg' and 'image/webp'. 'image/png' does not support this option. + * @default 0.9 + */ + quality?: number; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * The format of the image to be exported. + * Browsers are required to support 'image/png'. Some browsers also support 'image/jpeg' and 'image/webp'. + * If the provided `type` is not supported by the browser, it will default to 'image/png'. + * @default 'image/png' + */ + type: string; +}; +``` + +### ChartsToolbarImageExportTriggerProps + +```typescript +type ChartsToolbarImageExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartsToolbarImageExportOptions; +}; +``` + +### ChartsToolbarPrintExportOptions + +```typescript +type ChartsToolbarPrintExportOptions = { + /** + * If `true`, this export option will be removed from the ChartsToolbarExport menu. + * @default false + */ + disableToolbarButton?: boolean; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartsToolbarPrintExportTriggerProps + +```typescript +type ChartsToolbarPrintExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartPrintExportOptions; +}; +``` + +### ChartsToolbarProProps + +```typescript +type ChartsToolbarProProps = { + printOptions?: ChartsToolbarPrintExportOptions; + imageExportOptions?: ChartsToolbarImageExportOptions[]; +}; +``` + +### ChartsToolbarProSlotProps + +```typescript +type ChartsToolbarProSlotProps = { + /** Props for the toolbar component. */ + toolbar?: Partial; +}; +``` + +### ChartsToolbarProSlots + +```typescript +type ChartsToolbarProSlots = { + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipCell + +```typescript +type ChartsTooltipCell = StyledComponent< + Pick< + TypographyOwnProps & + CommonProps & + Omit< + React.DetailedHTMLProps, HTMLSpanElement>, + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'children' + | 'variant' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + >, + | 'id' + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'ref' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + | 'content' + | 'translate' + | 'hidden' + | 'variant' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + > & + MUIStyledCommonProps & { component?: React.ElementType }, + {}, + {} +>; +``` + +### chartsTooltipClasses + +```typescript +type chartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClasses + +```typescript +type ChartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClassKey + +```typescript +type ChartsTooltipClassKey = 'root' | 'paper' | 'table' | 'row' | 'cell' | 'mark' | 'axisValueCell'; +``` + +### ChartsTooltipContainerClasses + +```typescript +type ChartsTooltipContainerClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipContainerProps + +```typescript +type ChartsTooltipContainerProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + children?: React.ReactNode; +}; +``` + +### ChartsTooltipContainerSlotProps + +```typescript +type ChartsTooltipContainerSlotProps = {}; +``` + +### ChartsTooltipContainerSlots + +```typescript +type ChartsTooltipContainerSlots = {}; +``` + +### ChartsTooltipPaper + +```typescript +type ChartsTooltipPaper = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLDivElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipProps + +```typescript +type ChartsTooltipProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'axis' | 'none' | 'item'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * Defines the sort order in which series items are displayed in the axis tooltip. + * When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. + * Only applies when `trigger='axis'`. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### ChartsTooltipRow + +```typescript +type ChartsTooltipRow = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableRowElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipSlotProps + +```typescript +type ChartsTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial>; +}; +``` + +### ChartsTooltipSlots + +```typescript +type ChartsTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ChartsTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipTable + +```typescript +type ChartsTooltipTable = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'width' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'border' + | 'bgcolor' + | 'hidden' + | 'title' + | 'summary' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'cellPadding' + | 'cellSpacing' + | 'frame' + | 'rules' + >, + {} +>; +``` + +### ChartsTypeFeatureFlags + +```typescript +type ChartsTypeFeatureFlags = {}; +``` + +### ChartsWrapperOwnerState + +```typescript +type ChartsWrapperOwnerState = { + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * The direction of the legend. + * @default 'horizontal' + */ + legendDirection?: Direction; + /** + * The position of the legend. + * @default { horizontal: 'center', vertical: 'bottom' } + */ + legendPosition?: Position; +}; +``` + +### ChartsWrapperProps + +```typescript +type ChartsWrapperProps = { + /** + * The position of the legend. + * @default { horizontal: 'center', vertical: 'bottom' } + */ + legendPosition?: Position; + /** + * The direction of the legend. + * @default 'horizontal' + */ + legendDirection?: Direction; + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * If `true`, the chart wrapper set `height: 100%`. + * @default `false` if the `height` prop is set. And `true` otherwise. + */ + extendVertically?: boolean; + children: React.ReactNode; + sx?: SxProps; +}; +``` + +### ChartsXAxisProps + +```typescript +type ChartsXAxisProps = { + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsXAxisSlotProps + +```typescript +type ChartsXAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsXAxisSlots + +```typescript +type ChartsXAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsXReferenceLineProps + +```typescript +type ChartsXReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The x value associated with the reference line. + * If defined the reference line will be vertical. + */ + x: TValue; +}; +``` + +### ChartsYAxisProps + +```typescript +type ChartsYAxisProps = { + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsYAxisSlotProps + +```typescript +type ChartsYAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsYAxisSlots + +```typescript +type ChartsYAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsYReferenceLineProps + +```typescript +type ChartsYReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The y value associated with the reference line. + * If defined the reference line will be horizontal. + */ + y: TValue; +}; +``` + +### cheerfulFiestaPaletteDark + +```typescript +type cheerfulFiestaPaletteDark = string[]; +``` + +### cheerfulFiestaPaletteLight + +```typescript +type cheerfulFiestaPaletteLight = string[]; +``` + +### ColorLegendSelector + +```typescript +type ColorLegendSelector = { + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### ComputedPieRadius + +Props received when the parent components has done the percentage conversion. + +```typescript +type ComputedPieRadius = { + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### continuousColorLegendClasses + +```typescript +type continuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendClasses + +```typescript +type ContinuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendProps + +```typescript +type ContinuousColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * The label to display at the minimum side of the gradient. + * Can either be a string, or a function. + * @default formattedValue + */ + minLabel?: string | LabelFormatter; + /** + * The label to display at the maximum side of the gradient. + * Can either be a string, or a function. + * If not defined, the formatted maximal value is display. + * @default formattedValue + */ + maxLabel?: string | LabelFormatter; + /** + * The id for the gradient to use. + * If not provided, it will use the generated gradient from the axis configuration. + * The `gradientId` will be used as `fill="url(#gradientId)"`. + * @default auto-generated id + */ + gradientId?: string; + /** + * Where to position the labels relative to the gradient. + * @default 'end' + */ + labelPosition?: 'start' | 'end' | 'extremes'; + /** + * If `true`, the gradient and labels will be reversed. + * @default false + */ + reverse?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; + /** + * The thickness of the gradient + * @default 12 + */ + thickness?: number; +}; +``` + +### ContinuousScaleName + +```typescript +type ContinuousScaleName = 'linear' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc'; +``` + +### CurveType + +The type of curve to use for the line. +Read more about curves at +[line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + +```typescript +type CurveType = + | 'catmullRom' + | 'linear' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepBefore' + | 'stepAfter' + | 'bumpY' + | 'bumpX'; +``` + +### cyanPaletteDark + +```typescript +type cyanPaletteDark = string[]; +``` + +### cyanPaletteLight + +```typescript +type cyanPaletteLight = string[]; +``` + +### DEFAULT_AXIS_SIZE_HEIGHT + +```typescript +type DEFAULT_AXIS_SIZE_HEIGHT = 25; +``` + +### DEFAULT_AXIS_SIZE_WIDTH + +```typescript +type DEFAULT_AXIS_SIZE_WIDTH = 45; +``` + +### DEFAULT_MARGINS + +```typescript +type DEFAULT_MARGINS = { top: number; bottom: number; left: number; right: number }; +``` + +### DEFAULT_RADIUS_AXIS_KEY + +```typescript +type DEFAULT_RADIUS_AXIS_KEY = 'DEFAULT_RADIUS_AXIS_KEY'; +``` + +### DEFAULT_ROTATION_AXIS_KEY + +```typescript +type DEFAULT_ROTATION_AXIS_KEY = 'DEFAULT_ROTATION_AXIS_KEY'; +``` + +### DEFAULT_X_AXIS_KEY + +```typescript +type DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY'; +``` + +### DEFAULT_Y_AXIS_KEY + +```typescript +type DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY'; +``` + +### DefaultizedBarSeriesType + +```typescript +type DefaultizedBarSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; +}; +``` + +### DefaultizedFunnelSeriesType + +```typescript +type DefaultizedFunnelSeriesType = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### DefaultizedHeatmapSeriesType + +```typescript +type DefaultizedHeatmapSeriesType = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### DefaultizedLineSeriesType + +```typescript +type DefaultizedLineSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedPieSeriesType + +```typescript +type DefaultizedPieSeriesType = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### DefaultizedPieValueType + +```typescript +type DefaultizedPieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; + color: string; + formattedValue: string; + hidden: boolean; +}; +``` + +### DefaultizedRadarSeriesType + +```typescript +type DefaultizedRadarSeriesType = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedSankeySeriesType + +```typescript +type DefaultizedSankeySeriesType = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### DefaultizedScatterSeriesType + +```typescript +type DefaultizedScatterSeriesType = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### DefaultizedSeriesType + +```typescript +type DefaultizedSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: CommonHighlightScope | SankeyHighlightScope; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | number[] + | DefaultizedPieValueType[] + | MakeRequired[] + | SankeyLayout; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null) + | SeriesValueFormatter; +}; +``` + +### defaultSeriesConfigPro + +```typescript +type defaultSeriesConfigPro = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; +}; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### FadeOptions + +```typescript +type FadeOptions = 'none' | 'series' | 'global'; +``` + +### FocusedItemIdentifier + +```typescript +type FocusedItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### FUNNEL_CHART_PLUGINS + +```typescript +type FUNNEL_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### FunnelChartPluginSignatures + +```typescript +type FunnelChartPluginSignatures = FunnelChartPluginSignatures; +``` + +### FunnelChartProps + +````typescript +type FunnelChartProps = { + /** + * The series to display in the funnel chart. + * An array of [[FunnelSeries]] objects. + */ + series: FunnelSeries[]; + /** + * The configuration of the category axis. + * @default { position: 'none' } + */ + categoryAxis?: CategoryAxis; + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: FunnelItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: FunnelItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The gap, in pixels, between funnel sections. + * @default 0 + */ + gap?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { funnel: ChartSeriesTypeConfig<'funnel'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all funnel elements at the current position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'funnel'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'funnel'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +```` + +### FunnelChartSlotExtension + +```typescript +type FunnelChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +``` + +### FunnelChartSlotProps + +```typescript +type FunnelChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### FunnelChartSlots + +```typescript +type FunnelChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### funnelClasses + +```typescript +type funnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClasses + +```typescript +type FunnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClassKey + +```typescript +type FunnelClassKey = 'root' | 'section' | 'sectionLabel' | 'sectionFilled' | 'sectionOutlined'; +``` + +### FunnelCurveType + +```typescript +type FunnelCurveType = 'linear' | 'linear-sharp' | 'step' | 'bump' | 'pyramid' | 'step-pyramid'; +``` + +### FunnelDataPoints + +```typescript +type FunnelDataPoints = Record<'x' | 'y', number> & { useBandWidth: boolean; stackOffset: number }; +``` + +### FunnelItem + +```typescript +type FunnelItem = { + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number; +}; +``` + +### FunnelItemId + +```typescript +type FunnelItemId = string | number; +``` + +### FunnelItemIdentifier + +An object that allows to identify a funnel item. +Used for item interaction + +```typescript +type FunnelItemIdentifier = { + type: 'funnel'; + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; +}; +``` + +### FunnelLabelOptions + +```typescript +type FunnelLabelOptions = { + /** + * The position of the label. + * @default { vertical: 'middle', horizontal: 'center' } + */ + position?: Position; + /** + * The text anchor of the label. Affects the horizontal alignment of the text. + * + * Default value depends on the position. + */ + textAnchor?: 'start' | 'middle' | 'end'; + /** + * The dominant baseline of the label. Affects the vertical alignment of the text. + * + * Default value depends on the position. + */ + dominantBaseline?: + | 'auto' + | 'baseline' + | 'hanging' + | 'middle' + | 'central' + | 'text-after-edge' + | 'text-before-edge'; + /** + * The offset of the label from the anchor point. + * If a single number is provided, the offset will be applied in both directions. + * @default 0 + */ + offset?: number | { x?: number; y?: number }; +}; +``` + +### FunnelPlotProps + +```typescript +type FunnelPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotExtension + +```typescript +type FunnelPlotSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotProps + +```typescript +type FunnelPlotSlotProps = { + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; +}; +``` + +### FunnelPlotSlots + +```typescript +type FunnelPlotSlots = { + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### FunnelScaleName + +```typescript +type FunnelScaleName = Exclude< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + 'point' +>; +``` + +### FunnelSection + +```typescript +type FunnelSection = unknown; +``` + +### FunnelSectionLabel + +```typescript +type FunnelSectionLabel = unknown; +``` + +### FunnelSeries + +```typescript +type FunnelSeries = { + /** The id of this series. */ + id?: SeriesId; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + type?: 'funnel'; +}; +``` + +### FunnelSeriesType + +```typescript +type FunnelSeriesType = { + type: 'funnel'; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### FunnelValueType + +```typescript +type FunnelValueType = { + /** A unique identifier of the funnel section. */ + id?: FunnelItemId; + /** The value of the funnel section. */ + value: number; + /** The label to display on the tooltip, funnel section, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'section') => string | undefined); + /** The color of the funnel section */ + color?: string; + /** + * Defines the mark type for the funnel item. + * @default 'square' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### gaugeClasses + +```typescript +type gaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClasses + +```typescript +type GaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClassKey + +```typescript +type GaugeClassKey = 'root' | 'valueArc' | 'referenceArc' | 'valueText'; +``` + +### GaugeContainerProps + +```typescript +type GaugeContainerProps = { + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; +}; +``` + +### GaugeFormatterParams + +```typescript +type GaugeFormatterParams = { value: number | null; valueMin: number; valueMax: number }; +``` + +### GaugeProps + +```typescript +type GaugeProps = { + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; + text?: string | ((params: GaugeFormatterParams) => string | null); +}; +``` + +### GaugeValueTextProps + +```typescript +type GaugeValueTextProps = { + text?: string | ((params: GaugeFormatterParams) => string | null); + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### greenPaletteDark + +```typescript +type greenPaletteDark = string[]; +``` + +### greenPaletteLight + +```typescript +type greenPaletteLight = string[]; +``` + +### HEATMAP_PLUGINS + +```typescript +type HEATMAP_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### HeatmapCellOwnerState + +```typescript +type HeatmapCellOwnerState = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + value: number; +}; +``` + +### HeatmapCellProps + +```typescript +type HeatmapCellProps = { + x: number; + y: number; + width: number; + height: number; + ownerState: HeatmapCellOwnerState; +}; +``` + +### heatmapClasses + +```typescript +type heatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClasses + +```typescript +type HeatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClassKey + +```typescript +type HeatmapClassKey = 'root' | 'series' | 'highlighted' | 'faded' | 'cell'; +``` + +### HeatmapItemIdentifier + +An object that allows to identify a single cell. +Used for item interaction + +```typescript +type HeatmapItemIdentifier = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; +}; +``` + +### HeatmapItemIdentifierWithData + +The cell identifier with the associated data value. + +```typescript +type HeatmapItemIdentifierWithData = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; + /** The value of the cell. Null if there is no data associated. */ + value: number | null; +}; +``` + +### HeatmapPlotProps + +```typescript +type HeatmapPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapPlotSlotProps; +}; +``` + +### HeatmapPlotSlotProps + +```typescript +type HeatmapPlotSlotProps = { cell?: Partial }; +``` + +### HeatmapPlotSlots + +```typescript +type HeatmapPlotSlots = { + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; +}; +``` + +### HeatmapPluginSignatures + +```typescript +type HeatmapPluginSignatures = HeatmapPluginSignatures; +``` + +### HeatmapProps + +```typescript +type HeatmapProps = { + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The series to display in the bar chart. + * An array of [[HeatmapSeries]] objects. + */ + series: HeatmapSeries[]; + /** + * The configuration of the tooltip. + * @see + */ + tooltip?: ChartsTooltipProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: HeatmapItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: HeatmapItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** The callback fired when an item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + item: SeriesItemIdentifierWithType< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + ) => void; + apiRef?: React.RefObject | undefined>; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +``` + +### HeatmapSeries + +```typescript +type HeatmapSeries = { + /** The id of this series. */ + id?: SeriesId; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + type?: 'heatmap'; +}; +``` + +### HeatmapSeriesType + +```typescript +type HeatmapSeriesType = { + type: 'heatmap'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The id of this series. */ + id?: SeriesId; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### HeatmapSlotProps + +```typescript +type HeatmapSlotProps = { + tooltip?: Partial; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + cell?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### HeatmapSlots + +```typescript +type HeatmapSlots = { + /** + * Custom component for the tooltip. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the legend. + * @default ContinuousColorLegendProps + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### HeatmapTooltipClasses + +```typescript +type HeatmapTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentClasses + +```typescript +type HeatmapTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentProps + +```typescript +type HeatmapTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### HeatmapTooltipProps + +```typescript +type HeatmapTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer'; +}; +``` + +### HeatmapTooltipSlotProps + +```typescript +type HeatmapTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial; +}; +``` + +### HeatmapTooltipSlots + +```typescript +type HeatmapTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### HeatmapValueType + +```typescript +type HeatmapValueType = HeatmapValueType; +``` + +### HighlightItemIdentifier + +Identifies an highlighted item or series. + +```typescript +type HighlightItemIdentifier< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightItemIdentifierWithType + +```typescript +type HighlightItemIdentifierWithType< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightOptions + +```typescript +type HighlightOptions = 'none' | 'item' | 'series'; +``` + +### HighlightScope + +```typescript +type HighlightScope = CommonHighlightScope | SankeyHighlightScope; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` + +### ItemTooltip + +```typescript +type ItemTooltip< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### labelClasses + +```typescript +type labelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### labelGradientClasses + +```typescript +type labelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### labelMarkClasses + +```typescript +type labelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### legendClasses + +```typescript +type legendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### LegendItemContext + +```typescript +type LegendItemContext = SeriesLegendItemContext | PiecewiseColorLegendItemContext; +``` + +### LegendItemParams + +```typescript +type LegendItemParams = { + /** The type of the series */ + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + markType: ChartsLabelMarkType | undefined; + /** The identifier of the series */ + seriesId?: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The minimum value of the category */ + minValue?: number | Date | null; + /** The maximum value of the category */ + maxValue?: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LINE_CHART_PRO_PLUGINS + +```typescript +type LINE_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProPluginSignatures + +```typescript +type LineChartProPluginSignatures = LineChartProPluginSignatures; +``` + +### LineChartProProps + +````typescript +type LineChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartProSlotProps + +```typescript +type LineChartProSlotProps = { + line?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + area?: SlotComponentPropsFromProps; + mark?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + lineHighlight?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### LineChartProSlots + +```typescript +type LineChartProSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'line' + | 'area' + | 'mark' + | 'highlight' + | 'markAnimate' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LineItemIdentifier + +An object that allows to identify a single line. +Used for item interaction + +```typescript +type LineItemIdentifier = { + type: 'line'; + seriesId: string; + /** `dataIndex` can be `undefined` if the mouse is over the area and not a specific item. */ + dataIndex?: number; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### LineSeriesType + +```typescript +type LineSeriesType = { + type: 'line'; + /** Data associated to the line. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### mangoFusionPaletteDark + +```typescript +type mangoFusionPaletteDark = string[]; +``` + +### mangoFusionPaletteLight + +```typescript +type mangoFusionPaletteLight = string[]; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + seriesId: string; + classes?: Partial; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +### MarkShape + +```typescript +type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; +``` + +### NumberValue + +```typescript +type NumberValue = NumberValue; +``` + +### orangePaletteDark + +```typescript +type orangePaletteDark = string[]; +``` + +### orangePaletteLight + +```typescript +type orangePaletteLight = string[]; +``` + +### OrdinalTimeTicks + +```typescript +type OrdinalTimeTicks = (TickFrequencyDefinition | TickFrequency)[]; +``` + +### PIE_CHART_PLUGINS + +```typescript +type PIE_CHART_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### PIE_CHART_PRO_PLUGINS + +```typescript +type PIE_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### PieArcLabelPlotProps + +```typescript +type PieArcLabelPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcLabelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcLabelPlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcLabelPlotSlotProps + +```typescript +type PieArcLabelPlotSlotProps = { pieArcLabel?: Partial }; +``` + +### PieArcLabelPlotSlots + +```typescript +type PieArcLabelPlotSlots = { pieArcLabel?: React.JSXElementConstructor }; +``` + +### PieArcLabelProps + +```typescript +type PieArcLabelProps = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + classes?: Partial; + startAngle: number; + endAngle: number; + arcLabelRadius: number; + cornerRadius: number; + paddingAngle: number; + skipAnimation: boolean; + formattedArcLabel?: string | null; + hidden?: boolean; +}; +``` + +### PieArcOwnerState + +```typescript +type PieArcOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; +}; +``` + +### PieArcPlotProps + +```typescript +type PieArcPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcPlotSlotProps; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcPlotSlotProps + +```typescript +type PieArcPlotSlotProps = { pieArc?: Partial }; +``` + +### PieArcPlotSlots + +```typescript +type PieArcPlotSlots = { pieArc?: React.JSXElementConstructor }; +``` + +### PieArcProps + +```typescript +type PieArcProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; + cornerRadius: number; + endAngle: number; + innerRadius: number; + onClick?: (event: React.MouseEvent) => void; + outerRadius: number; + paddingAngle: number; + startAngle: number; + /** If `true`, the animation is disabled. */ + skipAnimation?: boolean; + /** + * If `true`, the default event handlers are disabled. + * Those are used, for example, to display a tooltip or highlight the arc on hover. + */ + skipInteraction?: boolean; +}; +``` + +### piecewiseColorLegendClasses + +```typescript +type piecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendClasses + +```typescript +type PiecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendItemContext + +```typescript +type PiecewiseColorLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'piecewiseColor'; + /** The minimum value of the category */ + minValue: number | Date | null; + /** The maximum value of the category */ + maxValue: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### PiecewiseColorLegendProps + +```typescript +type PiecewiseColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * Format the legend labels. + * @returns The displayed label, `''` to skip the label but show the color mark, or `null` to skip it entirely. + */ + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + /** + * Where to position the labels relative to the color marks. + * @default 'extremes' + */ + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### PiecewiseLabelFormatterParams + +```typescript +type PiecewiseLabelFormatterParams = { + /** The index of the entry. */ + index: number; + /** The length of the entries array. */ + length: number; + /** The min value of the piece. `null` is infinite. */ + min: number | Date | null; + /** The max value of the piece. `null` is infinite. */ + max: number | Date | null; + /** The formatted min value of the piece. `null` is infinite. */ + formattedMin: string | null; + /** The formatted max value of the piece. `null` is infinite. */ + formattedMax: string | null; +}; +``` + +### PieChartPluginSignatures + +```typescript +type PieChartPluginSignatures = PieChartPluginSignatures; +``` + +### PieChartProPluginSignatures + +```typescript +type PieChartProPluginSignatures = PieChartProPluginSignatures; +``` + +### PieChartProProps + +````typescript +type PieChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; +}; +```` + +### PieChartProps + +````typescript +type PieChartProps = { + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartSlotProps; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### PieChartProSlotProps + +```typescript +type PieChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + pieArc?: Partial; + pieArcLabel?: Partial; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### PieChartProSlots + +```typescript +type PieChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### PieChartSlotProps + +```typescript +type PieChartSlotProps = { + pieArc?: Partial; + pieArcLabel?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### PieChartSlots + +```typescript +type PieChartSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### pieClasses + +```typescript +type pieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClasses + +```typescript +type PieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClassKey + +```typescript +type PieClassKey = + | 'root' + | 'arc' + | 'series' + | 'arcLabel' + | 'animate' + | 'seriesLabels' + | 'focusIndicator'; +``` + +### PieItemId + +```typescript +type PieItemId = string | number; +``` + +### PieItemIdentifier + +An object that allows to identify a single pie slice. +Used for item interaction + +```typescript +type PieItemIdentifier = { type: 'pie'; seriesId: string; dataIndex: number }; +``` + +### PiePlotProps + +```typescript +type PiePlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: PiePlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PiePlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; +}; +``` + +### PiePlotSlotProps + +```typescript +type PiePlotSlotProps = { pieArc?: Partial; pieArcLabel?: Partial }; +``` + +### PiePlotSlots + +```typescript +type PiePlotSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; +}; +``` + +### PieSeries + +```typescript +type PieSeries = MakeOptional>, 'type'>; +``` + +### PieSeriesLayout + +Layout information computed from the pie series and the drawing area. + +```typescript +type PieSeriesLayout = { + /** The pie center coordinate in px. */ + center: { x: number; y: number }; + /** + * The pie radius in px. + * Computed based on the drawing area and the center placement. + */ + radius: { + /** + * The maximum available radius in px. + * Correspond to radius='100%'. + */ + available: number; + /** The pie inner radius in px, except if overridden by item state (highlight/faded). */ + inner: number; + /** The pie outer radius in px, except if overridden by item state (highlight/faded). */ + outer: number; + /** The pie label radius in px, except if overridden by item state (highlight/faded). */ + label: number; + }; +}; +``` + +### PieSeriesType + +```typescript +type PieSeriesType = { + type: 'pie'; + data: TData[]; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### PieValueType + +```typescript +type PieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### pinkPaletteDark + +```typescript +type pinkPaletteDark = string[]; +``` + +### pinkPaletteLight + +```typescript +type pinkPaletteLight = string[]; +``` + +### Position + +```typescript +type Position = { + /** The vertical position. */ + vertical?: 'top' | 'middle' | 'bottom'; + /** The horizontal position. */ + horizontal?: 'start' | 'center' | 'end'; +}; +``` + +### PropsFromSlot + +```typescript +type PropsFromSlot = + | P + | React.ComponentProps< + NonNullable | React.ElementType | null | undefined> + >; +``` + +### purplePaletteDark + +```typescript +type purplePaletteDark = string[]; +``` + +### purplePaletteLight + +```typescript +type purplePaletteLight = string[]; +``` + +### RADAR_CHART_PRO_PLUGINS + +```typescript +type RADAR_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### RADAR_PLUGINS + +```typescript +type RADAR_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, +]; +``` + +### RadarAxisHighlightProps + +```typescript +type RadarAxisHighlightProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial< + Pick + >; +}; +``` + +### RadarAxisProps + +```typescript +type RadarAxisProps = { + /** + * Defines how label align with the axis. + * - 'horizontal': labels stay horizontal and their placement change with the axis angle. + * - 'rotated': labels are rotated 90deg relatively to their axis. + * @default 'horizontal' + */ + labelOrientation?: 'horizontal' | 'rotated'; + /** The labels text anchor or a function returning the text anchor for a given axis angle (in degree). */ + textAnchor?: + | 'start' + | 'middle' + | 'end' + | 'inherit' + | ((angle: number) => 'start' | 'end' | 'middle' | 'inherit' | undefined); + /** The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). */ + dominantBaseline?: + | 'auto' + | 'use-script' + | 'no-change' + | 'reset-size' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'central' + | 'middle' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | (( + angle: number, + ) => + | 'auto' + | 'middle' + | 'alphabetic' + | 'hanging' + | 'ideographic' + | 'mathematical' + | 'central' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | 'use-script' + | 'no-change' + | 'reset-size' + | undefined); + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial>; + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### RadarChartPluginSignatures + +```typescript +type RadarChartPluginSignatures = RadarChartPluginSignatures; +``` + +### RadarChartProPluginSignatures + +```typescript +type RadarChartProPluginSignatures = RadarChartProPluginSignatures; +``` + +### RadarChartProProps + +````typescript +type RadarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** A CSS class name applied to the root element. */ + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; +}; +```` + +### RadarChartProps + +````typescript +type RadarChartProps = { + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; +}; +```` + +### RadarChartProSlotProps + +```typescript +type RadarChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### RadarChartProSlots + +```typescript +type RadarChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### RadarChartSlotProps + +```typescript +type RadarChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### RadarChartSlots + +```typescript +type RadarChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### radarClasses + +```typescript +type radarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClasses + +```typescript +type RadarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClassKey + +```typescript +type RadarClassKey = + | 'axisLine' + | 'axisLabel' + | 'axisRoot' + | 'gridRadial' + | 'gridDivider' + | 'gridStripe' + | 'seriesRoot' + | 'seriesArea' + | 'seriesMark' + | 'axisHighlightRoot' + | 'axisHighlightLine' + | 'axisHighlightDot'; +``` + +### RadarDataProviderProps + +```typescript +type RadarDataProviderProps< + TSignatures extends ChartAnyPluginSignature[] = RadarChartPluginSignatures, +> = { + /** Array of plugins used to add features to the chart. */ + plugins?: [] | [ChartPlugin]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** Slots to customize charts' components. */ + slots?: Partial; + /** The props for the slots. */ + slotProps?: Partial; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: + | string + | number + | bigint + | boolean + | ReactElement + | Iterable + | React.ReactPortal + | Promise + | null; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: number | Partial; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: {}; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; +}; +``` + +### RadarGridProps + +```typescript +type RadarGridProps = { + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; +}; +``` + +### RadarItemIdentifier + +An object that allows to identify either a radar series or a radar point (if dataIndex is defined). +Used for item interaction + +```typescript +type RadarItemIdentifier = { type: 'radar'; seriesId: string; dataIndex?: number }; +``` + +### RadarSeries + +```typescript +type RadarSeries = { + /** The id of this series. */ + id?: SeriesId; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + type?: 'radar'; +}; +``` + +### RadarSeriesAreaProps + +```typescript +type RadarSeriesAreaProps = { + /** Callback fired when an area is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesMarksProps + +```typescript +type RadarSeriesMarksProps = { + /** Callback fired when a mark is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesPlotProps + +```typescript +type RadarSeriesPlotProps = { + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesType + +```typescript +type RadarSeriesType = { + type: 'radar'; + data: number[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### RadiusAxis + +```typescript +type RadiusAxis = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * The minimal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + min?: number; + /** + * The maximal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + max?: number; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The minimal radius. */ + minRadius?: number; + /** The maximal radius. */ + maxRadius?: number; + colorMap?: ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### rainbowSurgePaletteDark + +```typescript +type rainbowSurgePaletteDark = string[]; +``` + +### rainbowSurgePaletteLight + +```typescript +type rainbowSurgePaletteLight = string[]; +``` + +### redPaletteDark + +```typescript +type redPaletteDark = string[]; +``` + +### redPaletteLight + +```typescript +type redPaletteLight = string[]; +``` + +### referenceLineClasses + +```typescript +type referenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### RotationAxis + +```typescript +type RotationAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The start angle (in deg). */ + startAngle?: number; + /** The end angle (in deg). */ + endAngle?: number; + /** The gap between the axis and the label. */ + labelGap?: number; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### SankeyChartProps + +```typescript +type SankeyChartProps = { + /** + * The series to display in the Sankey chart. + * A single object is expected. + */ + series: SankeySeries; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotExtension + +```typescript +type SankeyChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotProps + +```typescript +type SankeyChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### SankeyChartSlots + +```typescript +type SankeyChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### sankeyClasses + +```typescript +type sankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClasses + +```typescript +type SankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClassKey + +```typescript +type SankeyClassKey = + | 'node' + | 'link' + | 'root' + | 'nodes' + | 'links' + | 'nodeLabels' + | 'linkLabels' + | 'nodeLabel' + | 'linkLabel'; +``` + +### SankeyData + +```typescript +type SankeyData = { + /** + * An array of node configs for the Sankey diagram + * + * This is optional, but can be used to provide custom labels or styles for nodes. + */ + nodes?: SankeyNode[]; + /** + * Array of links between nodes. + * + * The node ids will be used as the labels. If you want to provide custom labels, use the `nodes` property. + * + * Each link should have a `source`, `target`, and `value` property. + */ + links: SankeyLink[]; +}; +``` + +### SankeyDataProviderProps + +```typescript +type SankeyDataProviderProps = { + children?: React.ReactNode; + series: SankeySeriesType[]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; +}; +``` + +### SankeyItemIdentifier + +```typescript +type SankeyItemIdentifier = SankeyNodeIdentifier | SankeyLinkIdentifier; +``` + +### SankeyItemIdentifierWithData + +```typescript +type SankeyItemIdentifierWithData = + | SankeyNodeIdentifierWithData + | SankeyLinkIdentifierWithData; +``` + +### SankeyLayout + +Calculated layout for the Sankey diagram + +```typescript +type SankeyLayout = { + nodes: SankeyLayoutNode[]; + links: SankeyLayoutLink[]; +}; +``` + +### SankeyLayoutLink + +Represents the calculated positions and paths for a link in the Sankey diagram + +```typescript +type SankeyLayoutLink = { + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithoutPosition + +```typescript +type SankeyLayoutLinkWithoutPosition = { + source: SankeyLayoutNodeWithoutPosition; + target: SankeyLayoutNodeWithoutPosition; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithPosition + +```typescript +type SankeyLayoutLinkWithPosition = { + path?: string | null; + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; + /** Link's vertical starting position (at source node) calculated by Sankey layout generator. */ + y0?: number; + /** Link's vertical end position (at target node) calculated by Sankey layout generator. */ + y1?: number; + /** Link's width (proportional to its value) calculated by Sankey layout generator. */ + width?: number; +}; +``` + +### SankeyLayoutNode + +Represents the calculated positions and dimensions for a node in the Sankey diagram + +```typescript +type SankeyLayoutNode = { + targetLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithoutPosition + +```typescript +type SankeyLayoutNodeWithoutPosition = { + targetLinks: SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithPosition + +```typescript +type SankeyLayoutNodeWithPosition = { + targetLinks: SankeyLayoutLinkWithPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; + /** Node's minimum horizontal position (derived from the node.depth) calculated by Sankey layout generator. */ + x0?: number; + /** Node's maximum horizontal position (node.x0 + sankey.nodeWidth) calculated by Sankey layout generator. */ + x1?: number; + /** Node's minimum vertical position calculated by Sankey layout generator. */ + y0?: number; + /** Node's maximum vertical position (node.y1 - node.y0 is proportional to node.value) calculated by Sankey layout generator. */ + y1?: number; +}; +``` + +### SankeyLink + +```typescript +type SankeyLink = { + /** Source node ID */ + source: SankeyNodeId; + /** Target node ID */ + target: SankeyNodeId; + /** The value/weight of the link (affects width) */ + value: number; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; +}; +``` + +### SankeyLinkIdentifier + +```typescript +type SankeyLinkIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; +}; +``` + +### SankeyLinkIdentifierWithData + +```typescript +type SankeyLinkIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; + /** The link object with all the calculated properties */ + link: SankeyLayoutLink; +}; +``` + +### SankeyLinkLabelPlotProps + +```typescript +type SankeyLinkLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyLinkOptions + +```typescript +type SankeyLinkOptions = { + /** + * Default color for links without specified colors. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; + /** Opacity of the links (0-1) */ + opacity?: number; + /** Whether to show link values */ + showValues?: boolean; + /** + * Custom sort mode for links + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the links array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutLink, b: SankeyLayoutLink) => number); + /** + * Applies the given number to the X dimension of the control points of the link's curve function. + * This can create better looking links between nodes, but is dependent on the graph layout. + * It is specially impacted by the chart height. + * @default 10 + */ + curveCorrection?: number; + /** + * Highlight mode for links + * - 'links': Highlight hovered link + * - 'nodes': Highlight nodes connected to hovered link + * - 'source': Highlight source node of hovered link + * - 'target': Highlight target node of hovered link + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyLinkHighlight; + /** + * Fade mode for links + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyLinkFade; +}; +``` + +### SankeyLinkPlotProps + +```typescript +type SankeyLinkPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeyNode + +```typescript +type SankeyNode = { + /** Unique identifier for the node */ + id: SankeyNodeId; + /** The node label to display */ + label?: string; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color?: string; +}; +``` + +### SankeyNodeId + +```typescript +type SankeyNodeId = string | number; +``` + +### SankeyNodeIdentifier + +```typescript +type SankeyNodeIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; +}; +``` + +### SankeyNodeIdentifierWithData + +```typescript +type SankeyNodeIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; + /** The node object with all the calculated properties */ + node: SankeyLayoutNode; +}; +``` + +### SankeyNodeLabelPlotProps + +```typescript +type SankeyNodeLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyNodeOptions + +```typescript +type SankeyNodeOptions = { + /** Default color for nodes without specified colors */ + color?: string; + /** Width of the nodes in pixels */ + width?: number; + /** Padding between nodes in pixels */ + padding?: number; + /** + * Node alignment strategy + * - 'justify': Nodes are evenly distributed across the width. + * - 'left': Nodes are aligned to the left. + * - 'right': Nodes are aligned to the right. + * - 'center': Nodes are centered. + * @default 'justify' + */ + align?: 'justify' | 'left' | 'right' | 'center'; + /** Whether to show node labels */ + showLabels?: boolean; + /** + * Custom sort mode for nodes + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the nodes array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutNode, b: SankeyLayoutNode) => number); + /** + * Highlight mode for nodes + * - 'nodes': Highlight hovered node + * - 'links': Highlight links connected to hovered node + * - 'incoming': Highlight incoming links to hovered node + * - 'outgoing': Highlight outgoing links from hovered node + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyNodeHighlight; + /** + * Fade mode for nodes + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyNodeFade; +}; +``` + +### SankeyNodePlotProps + +```typescript +type SankeyNodePlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; +}; +``` + +### SankeyPlotProps + +```typescript +type SankeyPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeySeries + +```typescript +type SankeySeries = { + /** Unique identifier for the series */ + id?: string; + /** The data for the Sankey diagram */ + data: SankeyData; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Type identifier for Sankey series */ + type?: 'sankey'; +}; +``` + +### SankeySeriesType + +```typescript +type SankeySeriesType = { + /** Unique identifier for the series */ + id?: string; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyTooltipClasses + +```typescript +type SankeyTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipContentClasses + +```typescript +type SankeyTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipProps + +```typescript +type SankeyTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; +}; +``` + +### SankeyTooltipSlotProps + +```typescript +type SankeyTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SankeyTooltipSlots + +```typescript +type SankeyTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### SankeyValueFormatterContext + +```typescript +type SankeyValueFormatterContext = + | { location: 'tooltip' | 'label'; type: 'node'; nodeId: SankeyNodeId } + | { location: 'tooltip' | 'label'; type: 'link'; sourceId: SankeyNodeId; targetId: SankeyNodeId }; +``` + +### ScaleName + +```typescript +type ScaleName = 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### SCATTER_CHART_PLUGINS + +```typescript +type SCATTER_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### SCATTER_CHART_PRO_PLUGINS + +```typescript +type SCATTER_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### ScatterChartPluginSignatures + +```typescript +type ScatterChartPluginSignatures = ScatterChartPluginSignatures; +``` + +### ScatterChartProPluginSignatures + +```typescript +type ScatterChartProPluginSignatures = ScatterChartProPluginSignatures; +``` + +### ScatterChartProProps + +````typescript +type ScatterChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### ScatterChartProps + +````typescript +type ScatterChartProps = { + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartSlotProps; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; +}; +```` + +### ScatterChartProSlotProps + +```typescript +type ScatterChartProSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + scatter?: Partial; + marker?: ScatterMarkerProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ScatterChartProSlots + +```typescript +type ScatterChartProSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### ScatterChartSlotProps + +```typescript +type ScatterChartSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + scatter?: Partial; + marker?: ScatterMarkerProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ScatterChartSlots + +```typescript +type ScatterChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### scatterClasses + +```typescript +type scatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClasses + +```typescript +type ScatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClassKey + +```typescript +type ScatterClassKey = 'marker' | 'root' | 'series' | 'focusedMark'; +``` + +### ScatterItemIdentifier + +An object that allows to identify a single scatter item. +Used for item interaction + +```typescript +type ScatterItemIdentifier = { type: 'scatter'; seriesId: string; dataIndex: number }; +``` + +### ScatterMarkerProps + +```typescript +type ScatterMarkerProps = { + /** The series ID. */ + seriesId: string; + /** The index of the data point. */ + dataIndex: number; + /** The x coordinate of the data point. */ + x: number; + /** The y coordinate of the data point. */ + y: number; + /** The fill color of the marker. */ + color: string; + /** The size of the marker. */ + size: number; + /** If `true`, the marker is highlighted. */ + isHighlighted: boolean; + /** If `true`, the marker is faded. */ + isFaded: boolean; + /** Callback fired when clicking on a scatter item. */ + onClick?: (event: React.MouseEvent) => void; +}; +``` + +### ScatterMarkerSlotExtension + +```typescript +type ScatterMarkerSlotExtension = { + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterMarkerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterMarkerSlots; +}; +``` + +### ScatterMarkerSlotProps + +```typescript +type ScatterMarkerSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterMarkerSlots + +```typescript +type ScatterMarkerSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterPlotProps + +```typescript +type ScatterPlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterPlotSlotProps; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + classes?: Partial; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; +}; +``` + +### ScatterPlotSlotProps + +```typescript +type ScatterPlotSlotProps = { scatter?: Partial; marker?: ScatterMarkerProps }; +``` + +### ScatterPlotSlots + +```typescript +type ScatterPlotSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterProps + +```typescript +type ScatterProps = { + series: DefaultizedScatterSeriesType; + xScale: D3Scale; + yScale: D3Scale; + color: string; + /** + * Function to get the color of a scatter item given its data index. + * The data index argument is optional. If not provided, the color for the entire series is returned. + * If provided, the color for the specific scatter item is returned. + */ + colorGetter: (dataIndex?: number) => string; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; + classes?: Partial; + slots?: ScatterSlots; + slotProps?: ScatterSlotProps; +}; +``` + +### ScatterSeries + +```typescript +type ScatterSeries = MakeOptional; +``` + +### ScatterSeriesType + +```typescript +type ScatterSeriesType = { + type: 'scatter'; + data?: ScatterValueType[]; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize?: number; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + preview?: { markerSize?: number }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### ScatterSlotProps + +```typescript +type ScatterSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterSlots + +```typescript +type ScatterSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterValueType + +```typescript +type ScatterValueType = { + x: number; + y: number; + z?: any; + /** A unique identifier for the scatter point */ + id?: string | number; +}; +``` + +### SeriesId + +The unique identifier of a series. + +```typescript +type SeriesId = string; +``` + +### SeriesItem + +```typescript +type SeriesItem = { + seriesId: string; + color: string; + value: + | { open: number; high: number; low: number; close: number } + | number + | HeatmapValueType + | ScatterValueType + | MakeRequired + | null; + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string; + formattedLabel: string | null; + markType: ChartsLabelMarkType | undefined; + markShape: MarkShape | undefined; +}; +``` + +### SeriesItemIdentifier + +```typescript +type SeriesItemIdentifier< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { seriesId: string }; +``` + +### SeriesItemIdentifierWithData + +```typescript +type SeriesItemIdentifierWithData< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### SeriesItemIdentifierWithType + +```typescript +type SeriesItemIdentifierWithType< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### SeriesLegendItemContext + +```typescript +type SeriesLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'series'; + /** The identifier of the series */ + seriesId: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### SeriesLegendItemParams + +```typescript +type SeriesLegendItemParams = { + /** The identifier of the series */ + seriesId: string; + /** The type of the series */ + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + markType: ChartsLabelMarkType | undefined; + markShape?: MarkShape; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### ShowMarkParams + +```typescript +type ShowMarkParams = { + /** The item index. */ + index: number; + /** The x coordinate in the SVG. */ + x: number; + /** The y coordinate in the SVG. */ + y: number; + /** The item position value. It likely comes from the axis `data` property. */ + position: AxisValue; + /** The item value. It comes from the series `data` property. */ + value: number; +}; +``` + +### SparkLineChartProps + +````typescript +type SparkLineChartProps = { + /** + * The xAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + xAxis?: XAxis; + /** + * The yAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + yAxis?: YAxis; + axisHighlight?: ChartsAxisHighlightProps; + /** + * Type of plot used. + * @default 'line' + */ + plotType?: 'bar' | 'line'; + /** Data to plot. */ + data: number[]; + /** + * Formatter used by the tooltip. + * @default (value: number | null) => (value === null ? '' : value.toString()) + * @returns the formatted value. + */ + valueFormatter?: (value: number | null) => string; + /** + * Set to `true` to enable the tooltip in the sparkline. + * @default false + */ + showTooltip?: boolean; + /** + * Set to `true` to highlight the value. + * With line, it shows a point. + * With bar, it shows a highlight band. + * @default false + */ + showHighlight?: boolean; + /** + * Set to `true` to fill spark line area. + * Has no effect if plotType='bar'. + * @default false + */ + area?: boolean; + /** @default 'linear' */ + curve?: CurveType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + * @default 5 + */ + margin?: Partial | number; + /** + * Overridable component slots. + * @default {} + */ + slots?: SparkLineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SparkLineChartSlotProps; + /** + * Color used to colorize the sparkline. + * @default rainbowSurgePalette[0] + */ + color?: ChartsColor; + /** + * When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. + * @default false + */ + disableClipping?: boolean; + /** + * The clipped area offset in pixels. + * + * This prevents partial clipping of lines when they are drawn on the edge of the drawing area. + * @default { top: 1, right: 1, bottom: 1, left: 1 } + */ + clipAreaOffset?: { top?: number; right?: number; bottom?: number; left?: number }; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | BarItemIdentifier + | Omit + | LineItemIdentifier + | Omit + | ScatterItemIdentifier + | Omit + | PieItemIdentifier + | Omit + | RadarItemIdentifier + | Omit + | HeatmapItemIdentifier + | Omit + | FunnelItemIdentifier + | Omit + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: ( + tooltipItem: + | BarItemIdentifier + | LineItemIdentifier + | ScatterItemIdentifier + | PieItemIdentifier + | RadarItemIdentifier + | HeatmapItemIdentifier + | FunnelItemIdentifier + | SankeyItemIdentifier + | null, + ) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: + | SankeyItemIdentifier + | { type: 'bar'; seriesId: string; dataIndex?: number } + | { type: 'line'; seriesId: string; dataIndex?: number } + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | { type: 'pie'; seriesId: string; dataIndex?: number } + | { type: 'radar'; seriesId: string; dataIndex?: number } + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * Callback fired when clicking close to an item. + * This is only available for scatter plot for now. + */ + onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + radar: ChartSeriesTypeConfig<'radar'>; + heatmap: ChartSeriesTypeConfig<'heatmap'>; + funnel: ChartSeriesTypeConfig<'funnel'>; + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + )[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | VisibilityIdentifier + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | VisibilityIdentifier + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** If true, the hit area interaction is disabled and falls back to hover events. */ + disableHitArea?: boolean; +}; +```` + +### SparkLineChartSlotProps + +```typescript +type SparkLineChartSlotProps = { + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SparkLineChartSlots + +```typescript +type SparkLineChartSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### StackableChartSeriesType + +```typescript +type StackableChartSeriesType = 'bar' | 'line'; +``` + +### StackOffsetType + +```typescript +type StackOffsetType = 'expand' | 'diverging' | 'none' | 'silhouette' | 'wiggle'; +``` + +### StackOrderType + +```typescript +type StackOrderType = 'appearance' | 'ascending' | 'descending' | 'insideOut' | 'none' | 'reverse'; +``` + +### strawberrySkyPaletteDark + +```typescript +type strawberrySkyPaletteDark = string[]; +``` + +### strawberrySkyPaletteLight + +```typescript +type strawberrySkyPaletteLight = string[]; +``` + +### TickFrequency + +The predefined tick frequencies for time ordinal axes. + +- 'years': displays the year, placing ticks at the start of each year +- 'quarterly': displays the month, placing ticks at the start of each quarter +- 'months': displays the month, placing ticks at the start of each month +- 'biweekly': displays the day, placing ticks every two weeks +- 'weeks': displays the day, placing ticks at the start of each week +- 'days': displays the day, placing ticks at the start of each day +- 'hours': displays the hour and minutes, placing ticks at the start of each hour + +```typescript +type TickFrequency = 'years' | 'quarterly' | 'months' | 'biweekly' | 'weeks' | 'days' | 'hours'; +``` + +### TickFrequencyDefinition + +Definition of a tick frequency for time ordinal axes. + +```typescript +type TickFrequencyDefinition = { + /** + * Returns the number of ticks in the given date range for this tick frequency. + * @returns The number of ticks in the [from, to] range. + */ + getTickNumber: (from: Date, to: Date) => number; + /** + * Decides if the current date should be shown as a tick. + * @returns Whether the current date is a tick or not. + */ + isTick: (prev: Date, value: Date) => boolean; + /** + * Format the tick value for display. + * @returns The formatted date string. + */ + format: (date: Date) => string; +}; +``` + +### TickItem + +```typescript +type TickItem = { + /** + * The value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + value?: any; + /** + * The formatted value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + formattedValue?: string; + /** + * The offset in pixels relative to the SVG origin. + * For an x-axis, it is relative to the left side of the SVG. + * For a y-axis, it is relative to the top side of the SVG. + */ + offset: number; + /** + * The offset in pixels relative to the tick position. + * For an x-axis, a positive value means the label is shifted to the right of the tick. + * For a y-axis, a positive value means the label is shifted downwards from the tick. + */ + labelOffset: number; +}; +``` + +### UseAnimateParams + +```typescript +type UseAnimateParams = { + /** + * Function that returns the interpolation function for animating props. + * @returns + * Interpolation function that takes a time value between 0 and 1 and returns the interpolated + * props at time t. This function is called on every frame of the animation. + */ + createInterpolator: (lastProps: Props, newProps: Props) => (t: number) => Props; + /** + * Transforms the interpolated props to be passed to `applyProps`, which usually means transforming them to element + * attributes, e.g., transforming an array of points into a `d` attribute for a path. + * @returns The transformed props. + */ + transformProps: (props: Props) => T; + /** + * Applies the transformed props to the element. Usually this will be a call to `element.setAttribute("x", x)` or + * to `element.style.width = width` so that updating the element does not go through the React lifecycle (i.e., not + * causing a re-render), with the objective of improving performance. + * + * This function is called on every frame of the animation. + */ + applyProps: (element: Elem, props: T) => void; + /** If `true`, the animation will be skipped and the final props will be applied immediately. */ + skip?: boolean; + /** Initial props to animate from. If not provided, defaults to the props passed as the first argument of `useAnimate`. */ + initialProps?: Props; + /** Optional ref to merge with the ref returned from this hook. */ + ref?: React.Ref; +}; +``` + +### UseAnimateReturn + +```typescript +type UseAnimateReturn = { + /** Ref to be passed to the element to animate. */ + ref: React.Ref; +}; +``` + +### UseAxesTooltipParams + +```typescript +type UseAxesTooltipParams = { + /** + * The axis directions to consider. + * If not defined, all directions are considered + */ + directions?: ('x' | 'y' | 'rotation')[]; +}; +``` + +### UseAxesTooltipReturnValue + +```typescript +type UseAxesTooltipReturnValue = { axisDirection: 'x' | 'y' | 'radius' | 'rotation'; +mainAxis: { /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ +id: AxisId; +/** The data used by `'band'` and `'point'` scales. */ +data?: any[]; +/** The key used to retrieve `data` from the `dataset` prop. */ +dataKey?: string; +/** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ +valueGetter?: ((item: DatasetElementType) => any); +colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string); type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'piecewise'; thresholds: (number | Date)[]; colors: string[]; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) }; +/** + * Formats the axis value. + * @returns The string to display. + */ +valueFormatter?: ((value: any, context: AxisValueFormatterContext) => string); +/** The label of the axis. */ +label?: string; +/** A CSS class name applied to the root element. */ +className?: string; +/** + * If true, the axis line is disabled. + * @default false + */ +disableLine?: boolean; +/** + * If true, the ticks are disabled. + * @default false + */ +disableTicks?: boolean; +/** The style applied to ticks text. */ +tickLabelStyle?: ChartsTextStyle; +/** The style applied to the axis label. */ +labelStyle?: ChartsTextStyle; +/** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ +tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); +/** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ +tickSpacing?: number; +/** + * The size of the ticks. + * @default 6 + */ +tickSize?: number; +/** Override or extend the styles applied to the component. */ +classes?: Partial; +/** + * Overridable component slots. + * @default {} + */ +slots?: Partial; +/** + * The props used for each component slot. + * @default {} + */ +slotProps?: Partial; +sx?: SxProps; +/** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMaxStep?: number; +/** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMinStep?: number; +/** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ +tickNumber?: number; +/** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ +tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; +/** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ +tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; +/** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ +tickLabelPlacement?: 'middle' | 'tick'; +/** If `true`, hide this value in the tooltip */ +hideTooltip?: boolean; +/** If `true`, Reverse the axis scaleBand. */ +reverse?: boolean; +/** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ +domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); +/** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ +ignoreTooltip?: boolean; +zoom?: boolean | ZoomOptions | false & DefaultizedZoomOptions | true & DefaultizedZoomOptions | { minStart?: number; maxEnd?: number; step?: number; minSpan?: number; maxSpan?: number; panning?: boolean; filterMode?: ZoomFilterMode; slider?: ZoomSliderOptions; axisId: AxisId; axisDirection: 'x' | 'y'; slider: DefaultedZoomSliderOptions; reverse: boolean; minStart: number; maxEnd: number; step: number; minSpan: number; maxSpan: number; panning: boolean; filterMode: ZoomFilterMode }; +/** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ +offset?: number; +scaleType: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +scale: ScaleBand<{ toString: function toString() { [native code] } }> | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; +colorScale?: ScaleOrdinal | ScaleOrdinal | ScaleSequential | ScaleThreshold | ScaleThreshold; +/** Indicate if the axis should be consider by a tooltip with `trigger='axis'`. */ +triggerTooltip?: boolean }; +axisId: AxisId; +axisValue: AxisValueT; +axisFormattedValue: string; +dataIndex: number; +seriesItems: SeriesItem[] } +``` + +### UseBarSeriesContextReturnValue + +```typescript +type UseBarSeriesContextReturnValue = SeriesProcessorResult<'bar'>; +``` + +### UseBarSeriesReturnValue + +```typescript +type UseBarSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UseChartCartesianAxisSignature + +```typescript +type UseChartCartesianAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartCartesianAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartCartesianAxisDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartCartesianAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature, UseChartBrushSignature]; +}; +``` + +### UseChartClosestPointSignature + +```typescript +type UseChartClosestPointSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVoronoiParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVoronoiDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVoronoiInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVoronoiState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [ + UseChartInteractionSignature, + UseChartHighlightSignature, + UseChartTooltipSignature, + ]; +}; +``` + +### UseChartHighlightSignature + +```typescript +type UseChartHighlightSignature< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartHighlightParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartHighlightDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartHighlightInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartHighlightState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartInteractionSignature + +```typescript +type UseChartInteractionSignature = { + /** The raw properties that can be passed to the plugin. */ + params: {}; + /** The params after being processed with the default values. */ + defaultizedParams: {}; + /** An imperative api available for internal use. */ + instance: UseChartInteractionInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartInteractionState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartPolarAxisSignature + +```typescript +type UseChartPolarAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartPolarAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartPolarAxisParameters; + /** An imperative api available for internal use. */ + instance: UseChartPolarAxisInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartPolarAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature]; +}; +``` + +### UseChartProExportSignature + +```typescript +type UseChartProExportSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProExportParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProExportParameters; + /** An imperative api available for internal use. */ + instance: UseChartProExportInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProExportState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProExportPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartProZoomSignature + +```typescript +type UseChartProZoomSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProZoomParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProZoomDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartProZoomInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProZoomState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProZoomPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature, UseChartBrushSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartTooltipSignature + +```typescript +type UseChartTooltipSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartTooltipParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartTooltipDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartTooltipInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartTooltipState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartVisibilityManagerInstance + +```typescript +type UseChartVisibilityManagerInstance< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** Hide an item by its identifier. */ + hideItem: hideItem; + /** Show an item by its identifier. */ + showItem: showItem; + /** Toggle the visibility of an item by its identifier. */ + toggleItemVisibility: toggleItemVisibility; +}; +``` + +### UseChartVisibilityManagerParameters + +````typescript +type UseChartVisibilityManagerParameters< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: (hiddenItems: VisibilityIdentifierWithType[]) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: (VisibilityIdentifierWithType | VisibilityIdentifier)[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | VisibilityIdentifierWithType + | VisibilityIdentifier + )[]; +}; +```` + +### UseChartVisibilityManagerSignature + +```typescript +type UseChartVisibilityManagerSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVisibilityManagerParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVisibilityManagerDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVisibilityManagerInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVisibilityManagerState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartZAxisSignature + +```typescript +type UseChartZAxisSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartZAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartZAxisParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartZAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseFunnelSeriesContextReturnValue + +```typescript +type UseFunnelSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseFunnelSeriesReturnValue + +```typescript +type UseFunnelSeriesReturnValue = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### UseHeatmapSeriesContextReturnValue + +```typescript +type UseHeatmapSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseHeatmapSeriesReturnValue + +```typescript +type UseHeatmapSeriesReturnValue = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### UseItemTooltipReturnValue + +```typescript +type UseItemTooltipReturnValue< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### UseLineSeriesContextReturnValue + +```typescript +type UseLineSeriesContextReturnValue = SeriesProcessorResult<'line'>; +``` + +### UseLineSeriesReturnValue + +```typescript +type UseLineSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UsePieSeriesContextReturnValue + +```typescript +type UsePieSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UsePieSeriesReturnValue + +```typescript +type UsePieSeriesReturnValue = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### UseRadarAxisParams + +```typescript +type UseRadarAxisParams = { + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### UseRadarItemTooltipReturnValue + +```typescript +type UseRadarItemTooltipReturnValue = { + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; + values: ItemTooltipValue<'radar'>[]; +}; +``` + +### UseRadarSeriesContextReturnValue + +```typescript +type UseRadarSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseRadarSeriesReturnValue + +```typescript +type UseRadarSeriesReturnValue = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### UseSankeySeriesContextReturnValue + +```typescript +type UseSankeySeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseSankeySeriesLayoutReturnValue + +```typescript +type UseSankeySeriesLayoutReturnValue = { sankeyLayout: SankeyLayout }; +``` + +### UseSankeySeriesReturnValue + +```typescript +type UseSankeySeriesReturnValue = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### UseScatterSeriesContextReturnValue + +```typescript +type UseScatterSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseScatterSeriesReturnValue + +```typescript +type UseScatterSeriesReturnValue = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### VisibilityIdentifier + +```typescript +type VisibilityIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type?: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId?: string; + seriesId: string; +}; +``` + +### VisibilityIdentifierWithType + +```typescript +type VisibilityIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### XAxis + +```typescript +type XAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### YAxis + +```typescript +type YAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'left' | 'right' | 'none'; + zoom?: boolean | ZoomOptions; + /** + * The width of the axis. + * Set to `'auto'` to automatically calculate the width based on tick label measurements. + * @default 65 if an axis label is provided, 45 otherwise. + */ + width?: number | 'auto'; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### yellowPaletteDark + +```typescript +type yellowPaletteDark = string[]; +``` + +### yellowPaletteLight + +```typescript +type yellowPaletteLight = string[]; +``` + +### ZoomData + +```typescript +type ZoomData = { + /** The id of the zoomed axis. */ + axisId: AxisId; + /** The starting percentage of the zoom range. In the range of 0 to 100. */ + start: number; + /** The ending percentage of the zoom range. In the range of 0 to 100. */ + end: number; +}; +``` + +### ZoomFilterMode + +```typescript +type ZoomFilterMode = 'keep' | 'discard'; +``` + +### ZoomOptions + +```typescript +type ZoomOptions = { + /** + * The starting percentage of the zoom range. In the range of 0 to 100. + * @default 0 + */ + minStart?: number; + /** + * The ending percentage of the zoom range. In the range of 0 to 100. + * @default 100 + */ + maxEnd?: number; + /** + * The step size of the zooming function. Defines the granularity of the zoom. + * @default 5 + */ + step?: number; + /** + * Restricts the minimum span size in the range of 0 to 100. + * + * If the span size is smaller than the minSpan, the span will be resized to the minSpan. + * @default 10 + */ + minSpan?: number; + /** + * Restricts the maximum span size in the range of 0 to 100. + * + * If the span size is larger than the maxSpan, the span will be resized to the maxSpan. + * @default 100 + */ + maxSpan?: number; + /** + * Set to `false` to disable panning. Useful when you want to pan programmatically, + * or to show only a specific section of the chart. + * @default true + */ + panning?: boolean; + /** + * Defines how to filter the axis data when it is outside of the zoomed range of this axis. + * + * - `keep`: The data outside the zoomed range is kept. And the other axes will stay the same. + * - `discard`: The data outside the zoomed range is discarded for the other axes. + * The other axes will be adjusted to fit the zoomed range. + * @default 'keep' + */ + filterMode?: ZoomFilterMode; + /** Configures the zoom slider. The slider is an element that shows the zoomed range and allows its manipulation. */ + slider?: ZoomSliderOptions; +}; +``` + +### ZoomSliderOptions + +```typescript +type ZoomSliderOptions = { + /** If `true`, the slider will be shown. */ + enabled?: boolean; + /** + * The size reserved for the zoom slider. The actual size of the slider might be smaller, so + * increasing this value effectively increases the margin around the slider. + * This means the height for the x-axis and the width for the y-axis. + * @default 48 if preview is enabled, 28 otherwise. + */ + size?: number; + /** + * Defines when the tooltip with the zoom values should be shown. + * - 'always': The tooltip is always shown. + * - 'hover': The tooltip is shown when hovering over the track or thumb. + * - 'never': The tooltip is never shown. + * @default 'hover' + */ + showTooltip?: ZoomSliderShowTooltip; + /** + * If `true`, a preview of the chart will be shown in the slider. + * Can also be an object to configure which series are shown in the preview. + */ + preview?: boolean | ZoomSliderPreviewOptions; +}; +``` + +### ZoomSliderShowTooltip + +```typescript +type ZoomSliderShowTooltip = 'always' | 'hover' | 'never'; +``` + +## External Types + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; +}) => { + identifier: { type: 'pie'; seriesId: string; dataIndex: number }; + color: string; + label: string | undefined; + value: unknown; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { pie?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; + seriesLayout: { pie?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + type: 'pie'; + data: unknown; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id?: string | undefined; + valueFormatter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + color?: string | undefined; + colorGetter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => unknown; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: { + type: 'pie'; + seriesId: string; + dataIndex: number; +}) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: { type: 'pie'; seriesId: string; dataIndex: number }) => { + type: 'pie'; + seriesId: string; + dataIndex: number; +}; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = ( + state: unknown, + point: { x: number; y: number }, +) => { type: 'pie'; seriesId: string; dataIndex: number } | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | null + | undefined, + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number | undefined } | null, +) => unknown; +``` + +### SeriesValueFormatter + +```typescript +type SeriesValueFormatter = (value: number, context: { dataIndex: number }) => string | null; +``` + +### hideItem + +```typescript +type hideItem = (identifier: unknown) => void; +``` + +### showItem + +```typescript +type showItem = (identifier: unknown) => void; +``` + +### toggleItemVisibility + +```typescript +type toggleItemVisibility = ( + identifier: + | unknown + | { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; + }, +) => void; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### Exclude + +```typescript +type Exclude = 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### TriggerOptions + +```typescript +type TriggerOptions = 'item' | 'axis' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.chart-image-export-options.ts b/docs/pages/x/api/charts/types.chart-image-export-options.ts new file mode 100644 index 0000000000000..f71c83ae8019a --- /dev/null +++ b/docs/pages/x/api/charts/types.chart-image-export-options.ts @@ -0,0 +1,4 @@ +import { ChartImageExportOptions } from '@mui/x-charts-pro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartImageExportOptions = createTypes(import.meta.url, ChartImageExportOptions); diff --git a/docs/pages/x/api/charts/types.chart-print-export-options.md b/docs/pages/x/api/charts/types.chart-print-export-options.md new file mode 100644 index 0000000000000..843b2dc61d90a --- /dev/null +++ b/docs/pages/x/api/charts/types.chart-print-export-options.md @@ -0,0 +1,35002 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.chart-print-export-options.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### BarChart + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarChartPro + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `BarSeries[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### BarElement + +**BarElement Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | - | +| layout\* | `'horizontal' \| 'vertical'` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| slotProps | `BarElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarElementSlots` | `{}` | Overridable component slots. | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| xOrigin\* | `number` | - | - | +| y\* | `number` | - | - | +| yOrigin\* | `number` | - | - | + +### BarLabel + +**BarLabel Props:** + +| Prop | Type | Default | Description | +| :-------------- | :--------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------- | +| hidden | `boolean` | - | If true, the bar label is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| dataIndex\* | `number` | - | - | +| height\* | `number` | - | Height of the bar this label belongs to. | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| layout\* | `'vertical' \| 'horizontal'` | - | - | +| placement | `'center' \| 'outside'` | `'center'` | The placement of the bar label. It controls whether the label is rendered in the center or outside the bar. | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| width\* | `number` | - | Width of the bar this label belongs to. | +| x\* | `number` | - | Position in the x-axis of the bar this label belongs to. | +| xOrigin\* | `number` | - | The x-coordinate of the stack this bar label belongs to. | +| y\* | `number` | - | Position in the y-axis of the bar this label belongs to. | +| yOrigin\* | `number` | - | The y-coordinate of the stack this bar label belongs to. | + +### BarPlot + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarPlot API](https://mui.com/x/api/charts/bar-plot/) + +**BarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :----------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `onItemClick` | - | Callback fired when a bar item is clicked. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `BarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### blueberryTwilightPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### bluePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsAxis Props:** + +| Prop | Type | Default | Description | +| :-------- | :-------------------- | :------ | :-------------------------------------- | +| slotProps | `ChartsAxisSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsAxisSlots` | `{}` | Overridable component slots. | + +### ChartsAxisHighlight + +Demos: + +- [Custom components](https://mui.com/x/react-charts/components/) + +API: + +- [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/) + +**ChartsAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :--- | :------------------------ | :------ | :---------- | +| x | `ChartsAxisHighlightType` | - | - | +| y | `ChartsAxisHighlightType` | - | - | + +### ChartsAxisTooltipContent + +**ChartsAxisTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | The sort in which series items are displayed in the tooltip. When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. | +| sx | `SxProps` | - | - | + +### ChartsBrushOverlay + +Component that renders visual feedback during brush interaction + +**ChartsBrushOverlay Props:** + +| Prop | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------- | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsClipPath + +API: + +- [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/) + +**ChartsClipPath Props:** + +| Prop | Type | Default | Description | +| :----- | :----------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| offset | `{ top?: number; right?: number; bottom?: number; left?: number }` | - | Offset, in pixels, of the clip path rectangle from the drawing area. A positive value will move the rectangle outside the drawing area. | +| id\* | `string` | - | The id of the clip path. | + +### ChartsColorCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### ChartsColorPaletteCallback + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ChartsContainerPro + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPro` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/) + +**ChartsContainerPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsDataProvider + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/react-charts/composition/) + +API: + +- [ChartsDataProvider API](https://mui.com/x/api/charts/charts-data-provider/) + +**ChartsDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsDataProviderPro + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPro API](https://mui.com/x/api/charts/charts-data-provider-pro/) + +**ChartsDataProviderPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +### ChartsGrid + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsGrid API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsGrid Props:** + +| Prop | Type | Default | Description | +| :--------- | :--------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| horizontal | `boolean` | - | Displays horizontal grid. | +| vertical | `boolean` | - | Displays vertical grid. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsItemTooltipContent + +**ChartsItemTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sx | `SxProps` | - | - | + +### ChartsLegend + +**ChartsLegend Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :----------------------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | - | The direction of the legend layout. The default depends on the chart. | +| onItemClick | `((event: React.MouseEvent, legendItem: SeriesLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| toggleVisibilityOnClick | `boolean` | `false` | If `true`, clicking on a legend item will toggle the visibility of the corresponding series. | +| className | `string` | - | - | + +### ChartsLoadingOverlay + +**ChartsLoadingOverlay Props:** + +| Prop | Type | Default | Description | +| :--- | :--------------- | :------ | :---------- | +| sx | `SxProps` | - | - | + +### ChartsLocalizationProvider + +Demos: + +- [localization](https://mui.com/x/react-charts/localization/) + +API: + +- [ChartsLocalizationProvider API](https://mui.com/x/api/charts/charts-localization-provider/) + +**ChartsLocalizationProvider Props:** + +| Prop | Type | Default | Description | +| :--------- | :-------------------------- | :------ | :----------------------------------- | +| localeText | `Partial` | - | Localized text for chart components. | +| children | `React.ReactNode` | - | - | + +### ChartsNoDataOverlay + +**ChartsNoDataOverlay Props:** + +| Prop | Type | Default | Description | +| :--- | :--------------- | :------ | :---------- | +| sx | `SxProps` | - | - | + +### ChartsOverlay + +**ChartsOverlay Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------- | :------ | :----------------------------------------- | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| slotProps | `ChartsOverlaySlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsOverlaySlots` | `{}` | Overridable component slots. | + +### ChartsReferenceLine + +**ChartsReferenceLine Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------- | :--------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | +| label | `string` | - | The label to display along the reference line. | +| axisId | `AxisId` | ``The `id` of the first defined axis.`` | The id of the axis used for the reference value. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| labelAlign | `'start' \| 'middle' \| 'end'` | `'middle'` | The alignment if the label is in the chart drawing area. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the label. | +| lineStyle | `React.CSSProperties` | - | The style applied to the line. | +| spacing | `number \| { x?: number; y?: number }` | `{ x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line.` | Additional space around the label in px. Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. | +| x | `string \| number \| Date` | - | The x value associated with the reference line. If defined the reference line will be vertical. | +| y | `string \| number \| Date` | - | The y value associated with the reference line. If defined the reference line will be horizontal. | + +### ChartsSurface + +A helper component that combines `` and `` to provide a surface for drawing charts. +If you need more control over the layers, you can use `` and `` separately. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsSurface API](https://mui.com/x/api/charts/charts-surface/) + +**ChartsSurface Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------- | :------ | :----------------------------------------------------------------------------------------- | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChartsText + +Helper component to manage multiline text in SVG + +**ChartsText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :---------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text\* | `string` | - | Text displayed. | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### ChartsToolbarImageExportTrigger + +A button that triggers an image export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarImageExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartsToolbarImageExportOptions` | - | The options to apply on the image export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPrintExportTrigger + +A button that triggers a print export. +It renders the `baseButton` slot. + +Demos: + +- [Export](https://mui.com/x/react-charts/export/) + +**ChartsToolbarPrintExportTrigger Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| options | `ChartPrintExportOptions` | - | The options to apply on the Print export. | +| tabIndex | `number` | - | - | +| disabled | `boolean` | - | - | +| id | `string` | - | - | +| className | `string` | - | - | +| style | `React.CSSProperties` | - | - | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarPro + +The chart toolbar component for the pro package. + +**ChartsToolbarPro Props:** + +| Prop | Type | Default | Description | +| :----------------- | :---------------------------------- | :------ | :---------- | +| imageExportOptions | `ChartsToolbarImageExportOptions[]` | - | - | +| printOptions | `ChartsToolbarPrintExportOptions` | - | - | + +### ChartsToolbarZoomInTrigger + +A button that zooms the chart in. +It renders the `baseButton` slot. + +**ChartsToolbarZoomInTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsToolbarZoomOutTrigger + +A button that zooms the chart out. +It renders the `baseButton` slot. + +**ChartsToolbarZoomOutTrigger Props:** + +| Prop | Type | Default | Description | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :------------------------------------------------------ | +| render | `RenderProp & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }>` | - | A function to customize the rendering of the component. | + +### ChartsTooltip + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | Defines the sort order in which series items are displayed in the axis tooltip. When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. Only applies when `trigger='axis'`. | +| trigger | `'axis' \| 'none' \| 'item'` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### ChartsTooltipContainer + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltipContainer Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `TriggerOptions` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | +| children | `React.ReactNode` | - | - | + +### ChartsWrapper + +Wrapper for the charts components. +Its main purpose is to position the HTML legend in the correct place. + +**ChartsWrapper Props:** + +| Prop | Type | Default | Description | +| :--------------- | :---------------- | :--------------------------------------------------------------- | :----------------------------------------------- | +| extendVertically | `boolean` | `` `false` if the `height` prop is set. And `true` otherwise. `` | If `true`, the chart wrapper set `height: 100%`. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| legendDirection | `Direction` | `'horizontal'` | The direction of the legend. | +| legendPosition | `Position` | `{ horizontal: 'center', vertical: 'bottom' }` | The position of the legend. | +| sx | `SxProps` | - | - | +| children\* | `React.ReactNode` | - | - | + +### ChartsXAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/) + +**ChartsXAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'x'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelMinGap | `number` | `4` | The minimum gap in pixels between two tick labels. If two tick labels are closer than this minimum gap, one of them will be hidden. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsYAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/) + +**ChartsYAxis Props:** + +| Prop | Type | Default | Description | +| :----------------- | :------------------------------------------------------------ | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| label | `string` | - | The label of the axis. | +| axis | `'y'` | - | - | +| axisId | `AxisId` | - | The id of the axis to render. If undefined, it will be the first defined axis. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| disableLine | `boolean` | `false` | If true, the axis line is disabled. | +| disableTicks | `boolean` | `false` | If true, the ticks are disabled. | +| labelStyle | `ChartsTextStyle` | - | The style applied to the axis label. | +| slotProps | `Partial` | `{}` | The props used for each component slot. | +| slots | `Partial` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tickInterval | `'auto' \| ((value: any, index: number) => boolean) \| any[]` | `'auto'` | Defines which ticks are displayed. Its value can be: 'auto' In such case the ticks are computed based on axis scale and other parameters.a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.an array containing the values where ticks should be displayed. | +| tickLabelInterval | `'auto' \| ((value: any, index: number) => boolean)` | `'auto'` | Defines which ticks get its label displayed. Its value can be: 'auto' In such case, labels are displayed if they do not overlap with the previous one.a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. | +| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. | +| tickLabelStyle | `ChartsTextStyle` | - | The style applied to ticks text. | +| tickMaxStep | `number` | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickMinStep | `number` | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). | +| tickNumber | `number` | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). | +| tickPlacement | `'start' \| 'end' \| 'middle' \| 'extremities'` | `'extremities'` | The placement of ticks in regard to the band interval. Only used if scale is 'band'. | +| tickSize | `number` | `6` | The size of the ticks. | +| tickSpacing | `number` | `0` | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. | +| className | `string` | - | A CSS class name applied to the root element. | + +### ChartsZoomSlider + +Renders the zoom slider for all x and y axes that have it enabled. + +### ChartZoomSlider + +### cheerfulFiestaPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### ContinuousColorLegend + +**ContinuousColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------------------------------------- | :--------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| gradientId | `string` | `auto-generated id` | The id for the gradient to use. If not provided, it will use the generated gradient from the axis configuration. The `gradientId` will be used as `fill="url(#gradientId)"`. | +| labelPosition | `'start' \| 'end' \| 'extremes'` | `'end'` | Where to position the labels relative to the gradient. | +| maxLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the maximum side of the gradient. Can either be a string, or a function. If not defined, the formatted maximal value is display. | +| minLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the minimum side of the gradient. Can either be a string, or a function. | +| reverse | `boolean` | `false` | If `true`, the gradient and labels will be reversed. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| thickness | `number` | `12` | The thickness of the gradient | +| className | `string` | - | - | + +### cyanPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### defaultOnBeforeExport + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| iframe | `HTMLIFrameElement` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = void; +``` + +### FocusedBar + +### FocusedFunnelSection + +### FocusedHeatmapCell + +### FocusedLineMark + +### FocusedPieArc + +**FocusedPieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color | `string` | - | - | +| cornerRadius | `number` | - | - | +| innerRadius | `number` | - | - | +| outerRadius | `number` | - | - | +| paddingAngle | `number` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | + +### FocusedRadarMark + +### FocusedSankeyLink + +### FocusedSankeyNode + +### FocusedScatterMark + +### FunnelChart + +**FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### FunnelPlot + +**FunnelPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| slotProps | `FunnelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### Gauge + +**Gauge Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| classes | `Partial` | - | - | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeContainer + +**GaugeContainer Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeReferenceArc + +### GaugeValueArc + +**GaugeValueArc Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------- | :------ | :---------- | +| skipAnimation | `boolean` | - | - | + +### GaugeValueText + +**GaugeValueText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### getPieCoordinates + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------------------- | :------ | :---------- | +| series | `LegendItemParams` | - | - | +| drawing | `LegendItemParams` | - | - | + +**Return Value:** + +| Property | Type | Description | +| :---------------- | :------- | :---------- | +| `cx` | `number` | - | +| `cy` | `number` | - | +| `availableRadius` | `number` | - | + +### getValueToPositionMapper + +For a given scale return a function that map value to their position. +Useful when dealing with specific scale such as band. + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------------------- | :------ | :--------------- | +| scale | `D3Scale<{ toString: function toString() { [native code] } }, Range>` | - | The scale to use | + +**Return Value:** + +A function that map value to their position + +```tsx +type ReturnValue = (value: any) => number; +``` + +### greenPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Heatmap + +**Heatmap Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, item: SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>) => void)` | - | The callback fired when an item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: HeatmapItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| series\* | `HeatmapSeries[]` | - | The series to display in the bar chart. An array of \[\[HeatmapSeries]] objects. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| slotProps | `HeatmapSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltip | `ChartsTooltipProps` | - | The configuration of the tooltip. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `HeatmapItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### HeatmapCell + +Demos: + +- [Heatmap](https://mui.com/x/react-charts/heatmap/) + +API: + +- [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/) + +**HeatmapCell Props:** + +| Prop | Type | Default | Description | +| :----------- | :---------------------- | :------ | :---------- | +| height\* | `number` | - | - | +| ownerState\* | `HeatmapCellOwnerState` | - | - | +| width\* | `number` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### HeatmapData + +**Constructor Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| data | `HeatmapValueType[]` | - | - | + +**Methods:** + +```typescript +function getValue(xIndex: number, yIndex: number): number | null; +``` + +### HeatmapPlot + +**HeatmapPlot Props:** + +| Prop | Type | Default | Description | +| :----------- | :--------------------- | :------ | :------------------------------------------------ | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| slotProps | `HeatmapPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | A CSS class name applied to the root element. | + +### HeatmapTooltip + +**HeatmapTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### HeatmapTooltipContent + +**HeatmapTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineChartPro + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### mangoFusionPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +### orangePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### PieArc + +**PieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| dataIndex\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| innerRadius\* | `number` | - | - | +| isFaded\* | `boolean` | - | - | +| isFocused\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| outerRadius\* | `number` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | +| startAngle\* | `number` | - | - | + +### PieArcLabel + +**PieArcLabel Props:** + +| Prop | Type | Default | Description | +| :---------------- | :-------------------- | :------ | :---------- | +| hidden | `boolean` | - | - | +| arcLabelRadius\* | `number` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| formattedArcLabel | `string \| null` | - | - | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| startAngle\* | `number` | - | - | + +### PieArcLabelPlot + +**PieArcLabelPlot Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabel | `'formattedValue' \| 'label' \| 'value' \| ((item: { id?: PieItemId; color: string; labelMarkType?: ChartsLabelMarkType; value: number; formattedValue: string; hidden: boolean; label?: string }) => string)` | - | The label displayed into the arc. | +| arcLabelMinAngle | `number` | `0` | The minimal angle required to display the arc label. | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcLabelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcLabelPlotSlots` | `{}` | Overridable component slots. | + +### PieArcPlot + +**PieArcPlot Props:** + +| Prop | Type | Default | Description | +| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcPlotSlots` | `{}` | Overridable component slots. | + +### piecewiseColorDefaultLabelFormatter + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| params | `PiecewiseLabelFormatterParams` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### PiecewiseColorLegend + +**PiecewiseColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------- | :------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :------------------------------------------------------------------ | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| labelFormatter | `((params: PiecewiseLabelFormatterParams) => string \| null)` | - | Format the legend labels. | +| labelPosition | `'start' \| 'end' \| 'extremes' \| 'inline-start' \| 'inline-end'` | `'extremes'` | Where to position the labels relative to the color marks. | +| onItemClick | `((event: React.MouseEvent, legendItem: PiecewiseColorLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| className | `string` | - | - | + +### PieChart + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PieChart API](https://mui.com/x/api/charts/pie-chart/) + +**PieChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PieChartPro + +**PieChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PiePlot + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PiePlot API](https://mui.com/x/api/charts/pie-plot/) + +**PiePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------- | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PiePlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PiePlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### pinkPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### purplePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### RadarAxis + +**RadarAxis Props:** + +| Prop | Type | Default | Description | +| :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| angle | `number` | - | The absolute rotation angle of the metrics (in degree) If not defined the metric angle will be used. | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| divisions | `number` | `1` | The number of divisions with label. | +| dominantBaseline | `'auto' \| 'use-script' \| 'no-change' \| 'reset-size' \| 'ideographic' \| 'alphabetic' \| 'hanging' \| 'mathematical' \| 'central' \| 'middle' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| ((angle: number) => 'auto' \| 'middle' \| 'alphabetic' \| 'hanging' \| 'ideographic' \| 'mathematical' \| 'central' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| 'use-script' \| 'no-change' \| 'reset-size' \| undefined)` | - | The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). | +| labelOrientation | `'horizontal' \| 'rotated'` | `'horizontal'` | Defines how label align with the axis. 'horizontal': labels stay horizontal and their placement change with the axis angle.'rotated': labels are rotated 90deg relatively to their axis. | +| metric | `string` | - | The metric to get. If `undefined`, the hook returns `null` | +| textAnchor | `'start' \| 'middle' \| 'end' \| 'inherit' \| ((angle: number) => 'start' \| 'end' \| 'middle' \| 'inherit' \| undefined)` | - | The labels text anchor or a function returning the text anchor for a given axis angle (in degree). | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarAxisHighlight + +**RadarAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarChart + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarChartPro + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartProSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarDataProvider + +**RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### RadarGrid + +**RadarGrid Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------ | :------------------------------------------------------------------------------------- | :-------------------------------------------------------- | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | + +### RadarMetricLabels + +### RadarSeriesArea + +**RadarSeriesArea Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesMarks + +**RadarSeriesMarks Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesPlot + +**RadarSeriesPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### rainbowSurgePalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### redPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### SankeyChart + +Sankey Chart component + +Displays a Sankey diagram, visualizing flows between nodes where the width +of the links is proportional to the flow quantity. + +Demos: + +- [Sankey Chart](https://mui.com/x/react-charts/sankey/) + +API: + +- [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/) + +**SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyDataProvider + +Orchestrates the data providers for the sankey chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +**SankeyDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The highlighted item. Used when the highlight is controlled. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeriesType[]` | - | - | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyLinkLabelPlot + +**SankeyLinkLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyLinkPlot + +**SankeyLinkPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodeLabelPlot + +**SankeyNodeLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodePlot + +**SankeyNodePlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyPlot + +Renders a Sankey diagram plot. + +**SankeyPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| className | `string` | - | A CSS class name applied to the root element. | + +### SankeyTooltip + +**SankeyTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### SankeyTooltipContent + +**SankeyTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### Scatter + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [Scatter API](https://mui.com/x/api/charts/scatter/) + +**Scatter Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| colorGetter\* | `((dataIndex?: number) => string)` | - | Function to get the color of a scatter item given its data index. The data index argument is optional. If not provided, the color for the entire series is returned. If provided, the color for the specific scatter item is returned. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| series\* | `DefaultizedScatterSeriesType` | - | - | +| slotProps | `ScatterSlotProps` | - | - | +| slots | `ScatterSlots` | - | - | +| xScale\* | `D3Scale` | - | - | +| yScale\* | `D3Scale` | - | - | + +### ScatterChart + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterChartPro + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChartPro Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `LegendItemParams` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartProSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartProSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterMarker + +**ScatterMarker Props:** + +| Prop | Type | Default | Description | +| :-------------- | :------------------------------------------------------------ | :------ | :---------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | Callback fired when clicking on a scatter item. | +| color\* | `string` | - | The fill color of the marker. | +| dataIndex\* | `number` | - | The index of the data point. | +| isFaded\* | `boolean` | - | If `true`, the marker is faded. | +| isHighlighted\* | `boolean` | - | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | The series ID. | +| size\* | `number` | - | The size of the marker. | +| x\* | `number` | - | The x coordinate of the data point. | +| y\* | `number` | - | The y coordinate of the data point. | + +### ScatterPlot + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/) + +**ScatterPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :---------------------------------------------------------------------------------------------------------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| classes | `Partial` | - | - | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| slotProps | `ScatterPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +### SparkLineChart + +Demos: + +- [SparkLine](https://mui.com/x/react-charts/sparkline/) + +API: + +- [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/) + +**SparkLineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| area | `boolean` | `false` | Set to `true` to fill spark line area. Has no effect if plotType='bar'. | +| axisHighlight | `ChartsAxisHighlightProps` | - | - | +| baseline | `number \| 'min' \| 'max'` | `0` | The value of the line at the base of the series area. `'min'` the area will fill the space **under** the line.`'max'` the area will fill the space **above** the line.`number` the area will fill the space between this value and the line | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| clipAreaOffset | `{ top?: number; right?: number; bottom?: number; left?: number }` | `{ top: 1, right: 1, bottom: 1, left: 1 }` | The clipped area offset in pixels. This prevents partial clipping of lines when they are drawn on the edge of the drawing area. | +| color | `ChartsColor` | `rainbowSurgePalette[0]` | Color used to colorize the sparkline. | +| curve | `CurveType` | `'linear'` | - | +| data\* | `number[]` | - | Data to plot. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClipping | `boolean` | `false` | When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. | +| disableHitArea | `boolean` | - | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| VisibilityIdentifier)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| { type: 'bar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'line'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'pie'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| LegendItemParams<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| VisibilityIdentifier)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | `5` | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| { type?: 'heatmap'; seriesId?: string; xIndex?: number; yIndex?: number; seriesId: string; type: 'heatmap' } \| { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| { type?: 'sankey'; seriesId?: string; subType?: 'node'; nodeId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' } \| { type?: 'sankey'; seriesId?: string; subType?: 'link'; sourceId?: SankeyNodeId; targetId?: SankeyNodeId; subType: 'node' \| 'link'; seriesId: string; type: 'sankey' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| { type: 'bar'; seriesId: string; dataIndex?: number } \| { type: 'line'; seriesId: string; dataIndex?: number } \| { type: 'scatter'; seriesId: string; dataIndex?: number } \| { type: 'pie'; seriesId: string; dataIndex?: number } \| { type: 'radar'; seriesId: string; dataIndex?: number } \| { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking close to an item. This is only available for scatter plot for now. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| LineItemIdentifier \| ScatterItemIdentifier \| PieItemIdentifier \| RadarItemIdentifier \| HeatmapItemIdentifier \| FunnelItemIdentifier \| SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plotType | `'bar' \| 'line'` | `'line'` | Type of plot used. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'>; line: ChartSeriesTypeConfig<'line'>; scatter: ChartSeriesTypeConfig<'scatter'>; pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> }; radar: ChartSeriesTypeConfig<'radar'>; heatmap: ChartSeriesTypeConfig<'heatmap'>; funnel: ChartSeriesTypeConfig<'funnel'>; sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showHighlight | `boolean` | `false` | Set to `true` to highlight the value. With line, it shows a point. With bar, it shows a highlight band. | +| showTooltip | `boolean` | `false` | Set to `true` to enable the tooltip in the sparkline. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `SparkLineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SparkLineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| LegendItemParams \| LineItemIdentifier \| LegendItemParams \| ScatterItemIdentifier \| LegendItemParams \| PieItemIdentifier \| LegendItemParams \| RadarItemIdentifier \| LegendItemParams \| HeatmapItemIdentifier \| LegendItemParams \| FunnelItemIdentifier \| LegendItemParams \| SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| valueFormatter | `((value: number \| null) => string)` | `(value: number \| null) => (value === null ? '' : value.toString())` | Formatter used by the tooltip. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `XAxis` | - | The xAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| yAxis | `YAxis` | - | The yAxis configuration. Notice it is a single \[\[AxisConfig]] object, not an array of configuration. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### strawberrySkyPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +### Unstable_FunnelChart + +**Unstable_FunnelChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| categoryAxis | `CategoryAxis` | `{ position: 'none' }` | The configuration of the category axis. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| gap | `number` | `0` | The gap, in pixels, between funnel sections. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | `false` | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'funnel'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } \| VisibilityIdentifier<'funnel'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all funnel elements at the current position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, funnelItemIdentifier: FunnelItemIdentifier) => void)` | - | Callback fired when a funnel item is clicked. | +| onTooltipItemChange | `((tooltipItem: FunnelItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `FunnelSeries[]` | - | The series to display in the funnel chart. An array of \[\[FunnelSeries]] objects. | +| seriesConfig | `{ funnel: ChartSeriesTypeConfig<'funnel'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `FunnelChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `FunnelChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `FunnelItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarChart + +**Unstable_RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| LegendItemParams<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarDataProvider + +**Unstable_RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### Unstable_SankeyChart + +**Unstable_SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| LegendItemParams \| LegendItemParams \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### useAnimate + +Hook to customize the animation of an element. +Animates a ref from `initialProps` to `props`. + +**useAnimate Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------- | :------ | :----------------------- | +| props | `{}` | - | The props to animate to. | +| \_\_1 | `UseAnimateParams<{}, Element, {}>` | - | - | + +**useAnimate Return Value:** + +an object containing a ref that should be passed to the element to animate and the transformed props. +If `skip` is true, the transformed props are the `props` to animate to; if it is false, the transformed props are the +`initialProps`. + +The animated props are only accessible in `applyProps`. The props returned from this hook are not animated. + +When an animation starts, an interpolator is created using `createInterpolator`. +On every animation frame: + +1. The interpolator is called to get the interpolated props; +2. `transformProps` is called to transform the interpolated props; +3. `applyProps` is called to apply the transformed props to the element. + +If `props` change while an animation is progress, the animation will continue towards the new `props`. + +The animation can be skipped by setting `skip` to true. If a transition is in progress, it will immediately end +and `applyProps` be called with the final value. If there isn't a transition in progress, a new one won't be +started and `applyProps` will not be called. + +```tsx +type ReturnValue = UseAnimateReturn; +``` + +### useAnimateArea + +Animates an area of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateArea Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateAreaParams` | - | - | + +**useAnimateArea Return Value:** + +```tsx +type ReturnValue = UseAnimatedAreaReturn; +``` + +### useAnimateBar + +Animates a bar from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to its +final position. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBar Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------- | :------ | :---------- | +| props | `UseAnimateBarParams` | - | - | + +**useAnimateBar Return Value:** + +```tsx +type ReturnValue = UseAnimateBarReturnValue; +``` + +### useAnimateBarLabel + +Animates a bar label from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to the +center of the bar it belongs to. +The label is horizontally centered within the bar when the layout is vertical, and vertically centered for laid out +horizontally. + +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateBarLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------- | :------ | :---------- | +| props | `UseAnimateBarLabelParams` | - | - | + +**useAnimateBarLabel Return Value:** + +```tsx +type ReturnValue = UseAnimateBarLabelReturn; +``` + +### useAnimateLine + +Animates a line of a line chart using a `path` element. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimateLine Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| props | `UseAnimateLineParams` | - | - | + +**useAnimateLine Return Value:** + +```tsx +type ReturnValue = UseAnimatedReturnValue; +``` + +### useAnimatePieArc + +Animates a slice of a pie chart by increasing the start and end angles from the middle angle to their final values. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArc Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------- | :------ | :---------- | +| props | `UseAnimatePieArcParams` | - | - | + +**useAnimatePieArc Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcReturnValue; +``` + +### useAnimatePieArcLabel + +Animates the label of pie slice from its middle point to the centroid of the slice. +The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can +pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called. + +**useAnimatePieArcLabel Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------- | :------ | :---------- | +| props | `UseAnimatePieArcLabelParams` | - | - | + +**useAnimatePieArcLabel Return Value:** + +```tsx +type ReturnValue = UseAnimatePieArcLabelReturn; +``` + +### useAxesTooltip + +Returns the axes to display in the tooltip and the series item related to them. + +**useAxesTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| params | `UseAxesTooltipParams` | - | - | + +**useAxesTooltip Return Value:** + +```tsx +type ReturnValue = + | UseAxesTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'radar' | 'heatmap' | 'funnel', + string | number | Date + >[] + | null; +``` + +### useBarSeries + +Get access to the internal state of bar series. + +**useBarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useBarSeries Return Value:** + +the bar series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + stackOffset?: StackOffsetType; + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + barLabelPlacement?: 'center' | 'outside'; + stack?: string; + stackOrder?: StackOrderType; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + layout: 'horizontal' | 'vertical'; + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useBarSeriesContext + +Get access to the internal state of bar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useBarSeriesContext Return Value:** + +the bar series + +```tsx +type ReturnValue = SeriesProcessorResult<'bar'> | undefined; +``` + +### useBrush + +Get the current brush state. + +- `start` is the starting point of the brush selection. +- `current` is the current point of the brush selection. + +**useBrush Return Value:** + +`{ start, current }` - The brush state. + +```tsx +type ReturnValue = { start: { x: number; y: number }; current: { x: number; y: number } } | null; +``` + +### useChartApiContext + +The `useChartApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProvider` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject>; +``` + +### useChartCartesianAxis + +**useChartCartesianAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartCartesianAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartClosestPoint + +**useChartClosestPoint Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartClosestPoint Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartGradientId + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +For a gradient that respects the coordinates of the object on which it is applied, use `useChartGradientIdObjectBound` instead. + +**useChartGradientId Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientId Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartGradientIdObjectBound + +Returns a gradient id for the given axis id. + +Can be useful when reusing the same gradient on custom components. + +This gradient differs from `useChartGradientId` in that it respects the coordinates of the object on which it is applied. + +**useChartGradientIdObjectBound Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| axisId | `AxisId` | - | the axis id | + +**useChartGradientIdObjectBound Return Value:** + +the gradient id + +```tsx +type ReturnValue = string; +``` + +### useChartHighlight + +**useChartHighlight Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartHighlight Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartId + +Get the unique identifier of the chart. + +**useChartId Return Value:** + +chartId if it exists. + +```tsx +type ReturnValue = string | undefined; +``` + +### useChartInteraction + +**useChartInteraction Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartInteraction Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartPolarAxis + +**useChartPolarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartPolarAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartProApiContext + +The `useChartProApiContext` hook provides access to the chart API. +This is only available when the chart is rendered within a chart or a `ChartsDataProviderPro` component. +If you want to access the chart API outside those components, you should use the `apiRef` prop instead. + +**useChartProApiContext Return Value:** + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartProApiRef + +Hook that instantiates a \[\[ChartProApiRef]]. +The chart type needs to be given as the generic parameter to narrow down the API to the specific chart type. + +**useChartProApiRef Return Value:** + +```tsx +type ReturnValue = React.RefObject< + | ChartProApi< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition', + ChartAnyPluginSignature[] + > + | undefined +>; +``` + +### useChartProExport + +**useChartProExport Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProExport Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartProZoom + +**useChartProZoom Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartProZoom Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useChartRootRef + +Get the ref for the root chart element. + +**useChartRootRef Return Value:** + +The root chart element ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLayerContainerRef + +Get the ref for the chart surface element. + +**useChartsLayerContainerRef Return Value:** + +The chart surface ref. + +```tsx +type ReturnValue = React.RefObject; +``` + +### useChartsLocalization + +**useChartsLocalization Return Value:** + +```tsx +type ReturnValue = ChartsLocalizationContextValue; +``` + +### useChartTooltip + +**useChartTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartTooltip Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartVisibilityManager + +**useChartVisibilityManager Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------------------------ | :------ | :---------- | +| options | `ChartPluginOptions>` | - | - | + +**useChartVisibilityManager Return Value:** + +```tsx +type ReturnValue = ChartResponse>; +``` + +### useChartZAxis + +**useChartZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------------- | :------ | :---------- | +| options | `ChartPluginOptions` | - | - | + +**useChartZAxis Return Value:** + +```tsx +type ReturnValue = ChartResponse; +``` + +### useDataset + +Get access to the dataset used to populate series and axes data. + +**useDataset Return Value:** + +The dataset array if provided, otherwise undefined. + +```tsx +type ReturnValue = Readonly[]> | undefined; +``` + +### useDrawingArea + +Get the drawing area dimensions and coordinates. The drawing area is the area where the chart is rendered. + +It includes the left, top, width, height, bottom, and right dimensions. + +**useDrawingArea Return Value:** + +The drawing area dimensions. + +```tsx +type ReturnValue = ChartDrawingArea; +``` + +### useFocusedItem + +Get the focused item from keyboard navigation. + +**useFocusedItem Return Value:** + +```tsx +type ReturnValue = FocusedItemIdentifier | null; +``` + +### useFunnelSeries + +Get access to the internal state of funnel series. + +**useFunnelSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useFunnelSeries Return Value:** + +the funnel series + +```tsx +type ReturnValue = DefaultizedFunnelSeriesType | undefined; +``` + +### useFunnelSeriesContext + +Get access to the internal state of funnel series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useFunnelSeriesContext Return Value:** + +the funnel series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useGaugeState + +**useGaugeState Return Value:** + +```tsx +type ReturnValue = { + value: number | null; + valueMin: number; + valueMax: number; + startAngle: number; + endAngle: number; + innerRadius: number; + outerRadius: number; + cornerRadius: number; + cx: number; + cy: number; + maxRadius: number; + valueAngle: number | null; +}; +``` + +### useHeatmapSeries + +Get access to the internal state of heatmap series. + +**useHeatmapSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useHeatmapSeries Return Value:** + +the heatmap series + +```tsx +type ReturnValue = DefaultizedHeatmapSeriesType | undefined; +``` + +### useHeatmapSeriesContext + +Get access to the internal state of heatmap series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useHeatmapSeriesContext Return Value:** + +the heatmap series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useIsZoomInteracting + +Get access to the zoom state. + +**useIsZoomInteracting Return Value:** + +Inform the zoom is interacting. + +```tsx +type ReturnValue = boolean; +``` + +### useItemHighlightState + +A hook to check the highlighted state of the item. +This function already calculates that an item is not faded if it is highlighted. + +If you need fine control over the state, use the `useItemHighlightStateGetter` hook instead. + +**useItemHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------------------------- | :------ | :------------------- | +| item | `UseItemHighlightedParams<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | is the item to check | + +**useItemHighlightState Return Value:** + +the state of the item + +```tsx +type ReturnValue = HighlightState; +``` + +### useItemHighlightStateGetter + +A hook to get a callback that returns the highlight state of an item. + +If you're interested by a single item, consider using `useItemHighlightState`. + +**useItemHighlightStateGetter Return Value:** + +callback to get the highlight state of an item. + +```tsx +type ReturnValue = (item: any | null) => HighlightState; +``` + +### useItemTooltip + +Returns a config object when the tooltip contains a single item to display. +Some specific charts like radar need more complex structure. Use specific hook like `useRadarItemTooltip` for them. + +**useItemTooltip Return Value:** + +The tooltip item config + +```tsx +type ReturnValue = UseItemTooltipReturnValue< + 'bar' | 'line' | 'scatter' | 'pie' | 'heatmap' | 'funnel' | 'sankey' +> | null; +``` + +### useLegend + +Get the legend items to display. + +This hook is used by the `ChartsLegend` component. And will return the legend items formatted for display. + +An alternative is to use the `useSeries` hook and format the legend items yourself. + +**useLegend Return Value:** + +legend data + +| Property | Type | Description | +| :------- | :------------------------- | :---------- | +| items | `SeriesLegendItemParams[]` | - | + +### useLineSeries + +Get access to the internal state of line series. + +**useLineSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useLineSeries Return Value:** + +the line series + +```tsx +type ReturnValue = + | { + hidden: boolean; + dataKey?: string; + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + colorGetter?: (data: ColorCallbackValue) => string; + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + labelMarkType?: ChartsLabelMarkType; + label?: string | ((location: 'tooltip' | 'legend') => string); + xAxisId?: AxisId; + yAxisId?: AxisId; + baseline?: number | 'min' | 'max'; + stackOffset?: StackOffsetType; + stack?: string; + stackOrder?: StackOrderType; + area?: boolean; + curve?: CurveType; + strictStepCurve?: boolean; + showMark?: boolean | ((params: ShowMarkParams) => boolean); + shape?: MarkShape; + disableHighlight?: boolean; + connectNulls?: boolean; + id: string; + data: (number | null)[]; + valueFormatter: SeriesValueFormatter; + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; + } + | undefined; +``` + +### useLineSeriesContext + +Get access to the internal state of line series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. +- stackingGroups: the array of stacking groups. Each group contains the series ids stacked and the strategy to use. + +**useLineSeriesContext Return Value:** + +the line series + +```tsx +type ReturnValue = SeriesProcessorResult<'line'> | undefined; +``` + +### usePieSeries + +Get access to the internal state of pie series. + +**usePieSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**usePieSeries Return Value:** + +the pie series + +```tsx +type ReturnValue = DefaultizedPieSeriesType | undefined; +``` + +### usePieSeriesContext + +Get access to the internal state of pie series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**usePieSeriesContext Return Value:** + +the pie series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadarAxis + +Returns an array with one item per metric with the different points to label. + +**useRadarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| params | `UseRadarAxisParams` | - | - | + +**useRadarAxis Return Value:** + +```tsx +type ReturnValue = { + metric: string; + angle: number; + center: { x: number; y: number }; + labels: { x: number; y: number; value: number | Date; formattedValue: string }[]; +} | null; +``` + +### useRadarItemTooltip + +Contains an object per value with their content and the label of the associated metric. + +**useRadarItemTooltip Return Value:** + +The tooltip item configs + +```tsx +type ReturnValue = UseRadarItemTooltipReturnValue | null; +``` + +### useRadarSeries + +Get access to the internal state of radar series. + +**useRadarSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useRadarSeries Return Value:** + +the radar series + +```tsx +type ReturnValue = DefaultizedRadarSeriesType | undefined; +``` + +### useRadarSeriesContext + +Get access to the internal state of radar series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useRadarSeriesContext Return Value:** + +the radar series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useRadiusAxes + +Get all the radius axes for polar charts. + +Returns all radial axes configured in polar charts along with their IDs. +Radius axes are used in charts like `RadarChart` to define radial positioning and scaling. + +**useRadiusAxes Return Value:** + +An object containing: + +- `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `radiusAxisIds`: An array of all radius axis IDs in the chart + +| Property | Type | Description | +| :------------ | :--------------------------------------------- | :---------- | +| radiusAxis | `DefaultizedAxisConfig` | - | +| radiusAxisIds | `string[]` | - | + +### useRadiusAxis + +Get a specific radius axis or the default radius axis for polar charts. + +Returns the configuration and scale for a radial axis in polar charts. +The radius axis controls the radial distance of data points from the center of the circle. + +**useRadiusAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's radius axis configurationUndefined to get the default (first) radius axis | + +**useRadiusAxis Return Value:** + +The radius axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRadiusAxisProps + > + | undefined; +``` + +### useRadiusScale + +Get the radius scale. + +**useRadiusScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `radiusAxis` propUndefined to get the default radius axis | + +**useRadiusScale Return Value:** + +The radius axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useRotationAxes + +Get all the rotation axes for polar charts. + +Returns all rotation axes configured in polar charts along with their IDs. +Rotation axes are used in charts like `RadarChart` to define angular positioning. + +**useRotationAxes Return Value:** + +An object containing: + +- `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `rotationAxisIds`: An array of all rotation axis IDs in the chart + +| Property | Type | Description | +| :-------------- | :----------------------------------------------- | :---------- | +| rotationAxis | `DefaultizedAxisConfig` | - | +| rotationAxisIds | `string[]` | - | + +### useRotationAxis + +Get a specific rotation axis or the default rotation axis for polar charts. + +Returns the configuration and scale for a rotation axis in polar charts. +The rotation axis controls the angular positioning of data points around the circle. + +**useRotationAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's rotation axis configurationUndefined to get the default (first) rotation axis | + +**useRotationAxis Return Value:** + +The rotation axis configuration, or undefined if not found + +```tsx +type ReturnValue = + | PolarAxisDefaultized< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsRotationAxisProps + > + | undefined; +``` + +### useRotationScale + +Get the rotation scale. + +**useRotationScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `number \| string` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `rotationAxis` propUndefined to get the default rotation axis | + +**useRotationScale Return Value:** + +The rotation axis scale, or undefined if not found + +```tsx +type ReturnValue = + | ( + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined) + ) + | undefined; +``` + +### useSankeyLayout + +Get access to the sankey layout. + +**useSankeyLayout Return Value:** + +the sankey layout + +```tsx +type ReturnValue = SankeyLayout | undefined; +``` + +### useSankeyLinkHighlightState + +**useSankeyLinkHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| linkIdentifier | `SankeyLinkIdentifier` | - | - | + +**useSankeyLinkHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeyNodeHighlightState + +**useSankeyNodeHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| nodeIdentifier | `SankeyNodeIdentifier` | - | - | + +**useSankeyNodeHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeySeries + +Get access to the internal state of sankey series. + +**useSankeySeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useSankeySeries Return Value:** + +the sankey series + +```tsx +type ReturnValue = DefaultizedSankeySeriesType | undefined; +``` + +### useSankeySeriesContext + +Get access to the internal state of sankey series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useSankeySeriesContext Return Value:** + +the sankey series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useScatterSeries + +Get access to the internal state of scatter series. + +**useScatterSeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useScatterSeries Return Value:** + +the scatter series + +```tsx +type ReturnValue = DefaultizedScatterSeriesType | undefined; +``` + +### useScatterSeriesContext + +Get access to the internal state of scatter series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useScatterSeriesContext Return Value:** + +the scatter series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +### useSeries + +Get access to the internal state of series. +Structured by type of series: +{ seriesType?: { series: { id1: precessedValue, ... }, seriesOrder: \[id1, ...] } } + +**useSeries Return Value:** + +FormattedSeries series + +```tsx +type ReturnValue = ProcessedSeries; +``` + +### useXAxes + +Get all the x-axes. + +Returns all X axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useXAxes Return Value:** + +An object containing: + +- `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `xAxisIds`: An array of all X axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| xAxis | `ComputedAxisConfig` | - | +| xAxisIds | `AxisId[]` | - | + +### useXAxis + +Get a specific X axis or the default X axis. + +**useXAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXAxis Return Value:** + +The configuration for a single X axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsXAxisProps +>; +``` + +### useXAxisCoordinates + +Get the coordinates of the given X axis. The coordinates are relative to the SVG's origin. + +**useXAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisCoordinates Return Value:** + +The coordinates of the X axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useXAxisTicks + +Returns the ticks for the given X axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useXAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the X axis. | + +**useXAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useXColorScale + +Get the X axis color scale. + +**useXColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useXColorScale Return Value:** + +The color scale for the specified X axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useXScale + +Get the X scale. + +**useXScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `xAxis` propUndefined to get the default (first) X axis | + +**useXScale Return Value:** + +The X axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useYAxes + +Get all the y-axes. + +Returns all Y axes configured in the chart along with their IDs. +This is useful when you need to iterate over multiple axes or access all axis configurations at once. + +**useYAxes Return Value:** + +An object containing: + +- `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }` +- `yAxisIds`: An array of all Y axis IDs in the chart + +| Property | Type | Description | +| :------- | :------------------------------------- | :---------- | +| yAxis | `ComputedAxisConfig` | - | +| yAxisIds | `AxisId[]` | - | + +### useYAxis + +Get a specific Y axis or the default Y axis. + +**useYAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYAxis Return Value:** + +The configuration for a single Y axis. + +```tsx +type ReturnValue = ComputedAxis< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + any, + ChartsYAxisProps +>; +``` + +### useYAxisCoordinates + +Returns the coordinates of the given Y axis. The coordinates are relative to the SVG's origin. + +**useYAxisCoordinates Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisCoordinates Return Value:** + +The coordinates of the Y axis or null if the axis does not exist or has position: 'none'. + +```tsx +type ReturnValue = AxisCoordinates | null; +``` + +### useYAxisTicks + +Returns the ticks for the given Y axis. Ticks outside the drawing area are not included. +The ticks returned from this hook are not grouped, i.e., they don't follow the `groups` prop of the axis. + +**useYAxisTicks Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------- | +| axisId | `AxisId` | - | The id of the Y axis. | + +**useYAxisTicks Return Value:** + +```tsx +type ReturnValue = TickItem[]; +``` + +### useYColorScale + +Get the Y axis color scale. + +**useYColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useYColorScale Return Value:** + +The color scale for the specified Y axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### useYScale + +Get the Y scale. + +**useYScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | The axis identifier. Can be: A string or number matching the axis ID defined in the chart's `yAxis` propUndefined to get the default (first) Y axis | + +**useYScale Return Value:** + +The Y axis scale + +```tsx +type ReturnValue = + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); +``` + +### useZAxes + +**useZAxes Return Value:** + +| Property | Type | Description | +| :------- | :----------------------- | :---------- | +| zAxis | `DefaultizedZAxisConfig` | - | +| zAxisIds | `AxisId[]` | - | + +### useZAxis + +**useZAxis Parameters:** + +| Parameter | Type | Default | Description | +| :--------- | :----------------- | :------ | :---------- | +| identifier | `number \| string` | - | - | + +**useZAxis Return Value:** + +```tsx +type ReturnValue = ZAxisDefaultized; +``` + +### useZColorScale + +Get the Z axis color scale. + +**useZColorScale Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------------------------------------------------------------------------------------- | +| axisId | `AxisId` | - | If provided returns color scale for axisId, else returns the values for the default axis. | + +**useZColorScale Return Value:** + +The color scale for the specified Z axis, or undefined if not found. + +```tsx +type ReturnValue = + | ScaleOrdinal + | ScaleOrdinal + | ScaleSequential + | ScaleThreshold + | ScaleThreshold + | undefined; +``` + +### yellowPalette + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------ | :------ | :---------- | +| mode | `'light' \| 'dark'` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string[]; +``` + +## Additional Types + +### AllSeriesType + +```typescript +type AllSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | MakeOptional[] + | number[] + | FunnelValueType[] + | SankeyData; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter> + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null); + /** The id of this series. */ + id?: SeriesId; +}; +``` + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AXIS_LABEL_DEFAULT_HEIGHT + +```typescript +type AXIS_LABEL_DEFAULT_HEIGHT = 20; +``` + +### axisClasses + +```typescript +type axisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### AxisConfig + +Use this type for advanced typing. For basic usage, use `XAxis`, `YAxis`, `RotationAxis` or `RadiusAxis`. + +```typescript +type AxisConfig = { offset?: number } & CommonAxisConfig & { min?: NumberValue; max?: NumberValue } | {} & Omit, 'axisId'> & Partial | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig }, 'scale'>> & AxisSideConfig & TickParams & AxisConfigExtension +``` + +### AxisCoordinates + +```typescript +type AxisCoordinates = { left: number; top: number; right: number; bottom: number }; +``` + +### AxisItemIdentifier + +Identifies a data point within an axis. + +```typescript +type AxisItemIdentifier = { + /** The axis id. */ + axisId: AxisId; + /** The data index. */ + dataIndex: number; +}; +``` + +### AxisValueFormatterContext + +```typescript +type AxisValueFormatterContext< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', +> = + | { location: 'legend' } + | { + location: 'tooltip' | 'zoom-slider-tooltip'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + } + | { + location: 'tick'; + scale: + | ((value: NumberValue) => number | undefined) + | ((value: Date | NumberValue) => number | undefined); + defaultTickLabel: string; + tickNumber?: number; + }; +``` + +### BAR_CHART_PLUGINS + +```typescript +type BAR_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### BAR_CHART_PRO_PLUGINS + +```typescript +type BAR_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BarChartPluginSignatures + +```typescript +type BarChartPluginSignatures = BarChartPluginSignatures; +``` + +### BarChartProPluginSignatures + +```typescript +type BarChartProPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartProProps + +````typescript +type BarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartProps + +````typescript +type BarChartProps = { + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] objects. + */ + series: BarSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartSlotProps; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### BarChartProSlotProps + +```typescript +type BarChartProSlotProps = { + bar?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + barLabel?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartProSlots + +```typescript +type BarChartProSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### BarChartSlotProps + +```typescript +type BarChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### BarChartSlots + +```typescript +type BarChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### barClasses + +```typescript +type barClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClasses + +```typescript +type BarClasses = { + /** Styles applied to the bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; + /** Styles applied to an individual bar element. */ + element: string; + /** Styles applied to an individual bar label. */ + label: string; + /** Styles applied to a bar label when it is animated. */ + labelAnimate: string; +}; +``` + +### BarClassKey + +```typescript +type BarClassKey = 'label' | 'root' | 'series' | 'element' | 'seriesLabels' | 'labelAnimate'; +``` + +### BarElementProps + +```typescript +type BarElementProps = { + seriesId: string; + dataIndex: number; + color: string; + classes?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarElementSlots; + x: number; + xOrigin: number; + y: number; + yOrigin: number; + width: number; + height: number; + layout: 'horizontal' | 'vertical'; + skipAnimation: boolean; + hidden?: boolean; +}; +``` + +### BarElementSlotProps + +```typescript +type BarElementSlotProps = { + bar?: SlotComponentPropsFromProps; +}; +``` + +### BarElementSlots + +```typescript +type BarElementSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; +}; +``` + +### BarItem + +```typescript +type BarItem = { + /** The series id of the bar. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number | null; +}; +``` + +### BarItemIdentifier + +An object that allows to identify a single bar. +Used for item interaction + +```typescript +type BarItemIdentifier = { type: 'bar'; seriesId: string; dataIndex: number }; +``` + +### BarLabelContext + +```typescript +type BarLabelContext = { + bar: { + /** + * The height of the bar. + * It could be used to control the label based on the bar size. + */ + height: number; + /** + * The width of the bar. + * It could be used to control the label based on the bar size. + */ + width: number; + }; +}; +``` + +### BarLabelOwnerState + +```typescript +type BarLabelOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; +}; +``` + +### BarLabelProps + +```typescript +type BarLabelProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + layout: 'vertical' | 'horizontal'; + classes?: Partial; + /** The x-coordinate of the stack this bar label belongs to. */ + xOrigin: number; + /** The y-coordinate of the stack this bar label belongs to. */ + yOrigin: number; + /** Position in the x-axis of the bar this label belongs to. */ + x: number; + /** Position in the y-axis of the bar this label belongs to. */ + y: number; + /** Width of the bar this label belongs to. */ + width: number; + /** Height of the bar this label belongs to. */ + height: number; + /** + * The placement of the bar label. + * It controls whether the label is rendered in the center or outside the bar. + * @default 'center' + */ + placement?: 'center' | 'outside'; + /** If true, the bar label is hidden. */ + hidden?: boolean; +}; +``` + +### BarLabelSlotProps + +```typescript +type BarLabelSlotProps = { + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarLabelSlots + +```typescript +type BarLabelSlots = { + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarPlotProps + +```typescript +type BarPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: onItemClick; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: BarPlotSlots; +}; +``` + +### BarPlotSlotProps + +```typescript +type BarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### BarPlotSlots + +```typescript +type BarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### BarProps + +```typescript +type BarProps = { + seriesId: string; + dataIndex: number; + color: string; + ownerState: BarElementOwnerState; + /** The position in the x-axis of the stack this bar belongs to. */ + xOrigin: number; + /** The position in the y-axis of the stack this bar belongs to. */ + yOrigin: number; + /** The position of the bar in the x-axis. */ + x: number; + /** The position of the bar in the y-axis. */ + y: number; + /** The height of the bar. */ + height: number; + /** The width of the bar. */ + width: number; + /** The orientation of the bar. */ + layout: 'vertical' | 'horizontal'; + /** If true, no animations should be applied. */ + skipAnimation: boolean; +}; +``` + +### BarSeries + +```typescript +type BarSeries = MakeOptional; +``` + +### BarSeriesType + +```typescript +type BarSeriesType = { + type: 'bar'; + /** Data associated to each bar. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize?: number; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### BarValueType + +```typescript +type BarValueType = number; +``` + +### blueberryTwilightPaletteDark + +```typescript +type blueberryTwilightPaletteDark = string[]; +``` + +### blueberryTwilightPaletteLight + +```typescript +type blueberryTwilightPaletteLight = string[]; +``` + +### bluePaletteDark + +```typescript +type bluePaletteDark = string[]; +``` + +### bluePaletteLight + +```typescript +type bluePaletteLight = string[]; +``` + +### brushOverlayClasses + +```typescript +type brushOverlayClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the brush lines. */ + rect: string; + /** Styles applied when the brush is selecting the x axis. */ + x: string; + /** Styles applied when the brush is selecting the y axis. */ + y: string; +}; +``` + +### BrushOverlayClasses + +```typescript +type BrushOverlayClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the brush lines. */ + rect: string; + /** Styles applied when the brush is selecting the x axis. */ + x: string; + /** Styles applied when the brush is selecting the y axis. */ + y: string; +}; +``` + +### BrushOverlayClassKey + +```typescript +type BrushOverlayClassKey = 'x' | 'y' | 'root' | 'rect'; +``` + +### CartesianChartSeriesType + +```typescript +type CartesianChartSeriesType = 'bar' | 'line' | 'scatter' | 'heatmap' | 'funnel'; +``` + +### CategoryAxis + +```typescript +type CategoryAxis = { + /** + * The categories to be displayed on the axis. + * The order of the categories is the order in which they are displayed. + */ + categories?: string[]; + /** + * The position of the axis. + * - 'left' - The axis is positioned on the left side of the chart. + * - 'right' - The axis is positioned on the right side of the chart. + * - 'top' - The axis is positioned on the top side of the chart. + * - 'bottom' - The axis is positioned on the bottom side of the chart. + * - 'none' - The axis is not displayed. + */ + position?: 'left' | 'right' | 'top' | 'bottom' | 'none'; + /** + * The size of the axis. + * - If the axis is horizontal, the size is the height of the axis. + * - If the axis is vertical, the size is the width of the axis. + * - If set to `'auto'`, the size is automatically calculated based on tick label measurements. + */ + size?: number | 'auto'; + scaleType?: 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### ChartApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartApi< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'composition' | undefined = undefined, + TSignatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### chartAxisZoomSliderThumbClasses + +```typescript +type chartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClasses + +```typescript +type ChartAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartAxisZoomSliderThumbClassKey + +```typescript +type ChartAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartAxisZoomSliderTrackClasses + +```typescript +type chartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClasses + +```typescript +type ChartAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartAxisZoomSliderTrackClassKey + +```typescript +type ChartAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartBaseButtonProps + +```typescript +type ChartBaseButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; +``` + +### ChartBaseCommonProps + +```typescript +type ChartBaseCommonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +}; +``` + +### ChartBaseIconButtonProps + +```typescript +type ChartBaseIconButtonProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; +}; +``` + +### ChartBaseIconProps + +```typescript +type ChartBaseIconProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +``` + +### ChartDrawingArea + +```typescript +type ChartDrawingArea = { + /** The gap between the left border of the SVG and the drawing area. */ + left: number; + /** The gap between the top border of the SVG and the drawing area. */ + top: number; + /** The gap between the bottom border of the SVG and the drawing area. */ + bottom: number; + /** The gap between the right border of the SVG and the drawing area. */ + right: number; + /** The width of the drawing area. */ + width: number; + /** The height of the drawing area. */ + height: number; +}; +``` + +### ChartImageExportOptions + +The options to apply on the image export. + +```typescript +type ChartImageExportOptions = { + /** + * The format of the image to be exported. + * Browsers are required to support 'image/png'. Some browsers also support 'image/jpeg' and 'image/webp'. + * If the provided `type` is not supported by the browser, it will default to 'image/png'. + * @default 'image/png' + */ + type?: string; + /** + * The quality of the image to be exported between 0 and 1. This is only applicable for lossy formats, such as + * 'image/jpeg' and 'image/webp'. 'image/png' does not support this option. + * @default 0.9 + */ + quality?: number; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartPrintExportOptions + +The options to apply on the Print export. + +```typescript +type ChartPrintExportOptions = { + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartProApi + +The API of the chart `apiRef` object. +The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. + +```typescript +type ChartProApi< + ChartType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition' + | undefined = undefined, + Signatures extends ChartAnyPluginSignature[] = {}, +> = any | ({} & Partial<{}>); +``` + +### ChartsAxisClasses + +```typescript +type ChartsAxisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### ChartsAxisClassKey + +```typescript +type ChartsAxisClassKey = + | 'line' + | 'label' + | 'tick' + | 'bottom' + | 'left' + | 'right' + | 'top' + | 'root' + | 'tickContainer' + | 'tickLabel' + | 'directionX' + | 'directionY'; +``` + +### ChartsAxisData + +The data format returned by onAxisClick. + +```typescript +type ChartsAxisData = { + /** The index in the axis' data property. */ + dataIndex: number; + /** Tha value associated to the axis item. */ + axisValue: number | Date | string; + /** The mapping of series ids to their value for this particular axis index. */ + seriesValues: Record; +}; +``` + +### chartsAxisHighlightClasses + +```typescript +type chartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClasses + +```typescript +type ChartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClassKey + +```typescript +type ChartsAxisHighlightClassKey = 'root'; +``` + +### ChartsAxisHighlightPath + +```typescript +type ChartsAxisHighlightPath = StyledComponent< + MUIStyledCommonProps & { ownerState: { axisHighlight: ChartsAxisHighlightType } }, + Pick< + React.SVGProps, + | 'string' + | 'id' + | 'min' + | 'max' + | 'type' + | 'color' + | 'scale' + | 'className' + | 'offset' + | 'end' + | 'height' + | 'x' + | 'style' + | 'width' + | 'ref' + | 'dominantBaseline' + | 'suppressHydrationWarning' + | 'lang' + | 'media' + | 'method' + | 'name' + | 'nonce' + | 'part' + | 'slot' + | 'target' + | 'role' + | 'tabIndex' + | 'crossOrigin' + | 'accentHeight' + | 'accumulate' + | 'additive' + | 'alignmentBaseline' + | 'allowReorder' + | 'alphabetic' + | 'amplitude' + | 'arabicForm' + | 'ascent' + | 'attributeName' + | 'attributeType' + | 'autoReverse' + | 'azimuth' + | 'baseFrequency' + | 'baselineShift' + | 'baseProfile' + | 'bbox' + | 'begin' + | 'bias' + | 'by' + | 'calcMode' + | 'capHeight' + | 'clip' + | 'clipPath' + | 'clipPathUnits' + | 'clipRule' + | 'colorInterpolation' + | 'colorInterpolationFilters' + | 'colorProfile' + | 'colorRendering' + | 'contentScriptType' + | 'contentStyleType' + | 'cursor' + | 'cx' + | 'cy' + | 'd' + | 'decelerate' + | 'descent' + | 'diffuseConstant' + | 'direction' + | 'display' + | 'divisor' + | 'dur' + | 'dx' + | 'dy' + | 'edgeMode' + | 'elevation' + | 'enableBackground' + | 'exponent' + | 'externalResourcesRequired' + | 'fill' + | 'fillOpacity' + | 'fillRule' + | 'filter' + | 'filterRes' + | 'filterUnits' + | 'floodColor' + | 'floodOpacity' + | 'focusable' + | 'fontFamily' + | 'fontSize' + | 'fontSizeAdjust' + | 'fontStretch' + | 'fontStyle' + | 'fontVariant' + | 'fontWeight' + | 'format' + | 'fr' + | 'from' + | 'fx' + | 'fy' + | 'g1' + | 'g2' + | 'glyphName' + | 'glyphOrientationHorizontal' + | 'glyphOrientationVertical' + | 'glyphRef' + | 'gradientTransform' + | 'gradientUnits' + | 'hanging' + | 'horizAdvX' + | 'horizOriginX' + | 'href' + | 'ideographic' + | 'imageRendering' + | 'in2' + | 'in' + | 'intercept' + | 'k1' + | 'k2' + | 'k3' + | 'k4' + | 'k' + | 'kernelMatrix' + | 'kernelUnitLength' + | 'kerning' + | 'keyPoints' + | 'keySplines' + | 'keyTimes' + | 'lengthAdjust' + | 'letterSpacing' + | 'lightingColor' + | 'limitingConeAngle' + | 'local' + | 'markerEnd' + | 'markerHeight' + | 'markerMid' + | 'markerStart' + | 'markerUnits' + | 'markerWidth' + | 'mask' + | 'maskContentUnits' + | 'maskUnits' + | 'mathematical' + | 'mode' + | 'numOctaves' + | 'opacity' + | 'operator' + | 'order' + | 'orient' + | 'orientation' + | 'origin' + | 'overflow' + | 'overlinePosition' + | 'overlineThickness' + | 'paintOrder' + | 'panose1' + | 'path' + | 'pathLength' + | 'patternContentUnits' + | 'patternTransform' + | 'patternUnits' + | 'pointerEvents' + | 'points' + | 'pointsAtX' + | 'pointsAtY' + | 'pointsAtZ' + | 'preserveAlpha' + | 'preserveAspectRatio' + | 'primitiveUnits' + | 'r' + | 'radius' + | 'refX' + | 'refY' + | 'renderingIntent' + | 'repeatCount' + | 'repeatDur' + | 'requiredExtensions' + | 'requiredFeatures' + | 'restart' + | 'result' + | 'rotate' + | 'rx' + | 'ry' + | 'seed' + | 'shapeRendering' + | 'slope' + | 'spacing' + | 'specularConstant' + | 'specularExponent' + | 'speed' + | 'spreadMethod' + | 'startOffset' + | 'stdDeviation' + | 'stemh' + | 'stemv' + | 'stitchTiles' + | 'stopColor' + | 'stopOpacity' + | 'strikethroughPosition' + | 'strikethroughThickness' + | 'stroke' + | 'strokeDasharray' + | 'strokeDashoffset' + | 'strokeLinecap' + | 'strokeLinejoin' + | 'strokeMiterlimit' + | 'strokeOpacity' + | 'strokeWidth' + | 'surfaceScale' + | 'systemLanguage' + | 'tableValues' + | 'targetX' + | 'targetY' + | 'textAnchor' + | 'textDecoration' + | 'textLength' + | 'textRendering' + | 'to' + | 'transform' + | 'u1' + | 'u2' + | 'underlinePosition' + | 'underlineThickness' + | 'unicode' + | 'unicodeBidi' + | 'unicodeRange' + | 'unitsPerEm' + | 'vAlphabetic' + | 'values' + | 'vectorEffect' + | 'version' + | 'vertAdvY' + | 'vertOriginX' + | 'vertOriginY' + | 'vHanging' + | 'vIdeographic' + | 'viewBox' + | 'viewTarget' + | 'visibility' + | 'vMathematical' + | 'widths' + | 'wordSpacing' + | 'writingMode' + | 'x1' + | 'x2' + | 'xChannelSelector' + | 'xHeight' + | 'xlinkActuate' + | 'xlinkArcrole' + | 'xlinkHref' + | 'xlinkRole' + | 'xlinkShow' + | 'xlinkTitle' + | 'xlinkType' + | 'xmlBase' + | 'xmlLang' + | 'xmlns' + | 'xmlnsXlink' + | 'xmlSpace' + | 'y1' + | 'y2' + | 'y' + | 'yChannelSelector' + | 'z' + | 'zoomAndPan' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + >, + {} +>; +``` + +### ChartsAxisHighlightProps + +```typescript +type ChartsAxisHighlightProps = { x?: ChartsAxisHighlightType; y?: ChartsAxisHighlightType }; +``` + +### ChartsAxisHighlightType + +```typescript +type ChartsAxisHighlightType = 'none' | 'line' | 'band'; +``` + +### ChartsAxisProps + +```typescript +type ChartsAxisProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsAxisSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsAxisSlotProps; +}; +``` + +### ChartsAxisSlotProps + +```typescript +type ChartsAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsAxisSlots + +```typescript +type ChartsAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsAxisTooltipContentClasses + +```typescript +type ChartsAxisTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsAxisTooltipContentProps + +```typescript +type ChartsAxisTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; + /** + * The sort in which series items are displayed in the tooltip. + * When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### chartsAxisZoomSliderThumbClasses + +```typescript +type chartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClasses + +```typescript +type ChartsAxisZoomSliderThumbClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element when it is a start thumb. */ + start: string; + /** Styles applied to the root element when it is an end thumb. */ + end: string; +}; +``` + +### ChartsAxisZoomSliderThumbClassKey + +```typescript +type ChartsAxisZoomSliderThumbClassKey = 'start' | 'end' | 'root' | 'horizontal' | 'vertical'; +``` + +### chartsAxisZoomSliderTrackClasses + +```typescript +type chartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClasses + +```typescript +type ChartsAxisZoomSliderTrackClasses = { + /** Styles applied to the root element when it is horizontal. */ + horizontal: string; + /** Styles applied to the root element when it is vertical. */ + vertical: string; + /** Styles applied to the root element to the active part of the track. */ + active: string; + /** Styles applied to the root element to the background part of the track. */ + background: string; +}; +``` + +### ChartsAxisZoomSliderTrackClassKey + +```typescript +type ChartsAxisZoomSliderTrackClassKey = 'background' | 'horizontal' | 'vertical' | 'active'; +``` + +### ChartsBaseSlots + +```typescript +type ChartsBaseSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### ChartsBrushOverlayProps + +```typescript +type ChartsBrushOverlayProps = { + /** A CSS class name applied to the root element. */ + className?: string; +}; +``` + +### ChartsClipPathProps + +```typescript +type ChartsClipPathProps = { + /** The id of the clip path. */ + id: string; + /** + * Offset, in pixels, of the clip path rectangle from the drawing area. + * + * A positive value will move the rectangle outside the drawing area. + */ + offset?: { top?: number; right?: number; bottom?: number; left?: number }; +}; +``` + +### ChartsColor + +```typescript +type ChartsColor = string | ChartsColorCallback; +``` + +### ChartsColorPalette + +```typescript +type ChartsColorPalette = string[] | ChartsColorPaletteCallback; +``` + +### ChartsContainerProProps + +```typescript +type ChartsContainerProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsContainerProSlotProps + +```typescript +type ChartsContainerProSlotProps = {}; +``` + +### ChartsContainerProSlots + +```typescript +type ChartsContainerProSlots = {}; +``` + +### ChartsDataProviderProProps + +```typescript +type ChartsDataProviderProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProps + +```typescript +type ChartsDataProviderProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartClosestPointSignature, + UseChartKeyboardNavigationSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProSlotProps + +```typescript +type ChartsDataProviderProSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderProSlots + +```typescript +type ChartsDataProviderProSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### ChartsDataProviderSlotProps + +```typescript +type ChartsDataProviderSlotProps = { + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ChartsDataProviderSlots + +```typescript +type ChartsDataProviderSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +### chartsGridClasses + +```typescript +type chartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClasses + +```typescript +type ChartsGridClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to every line element. */ + line: string; + /** Styles applied to x-axes. */ + horizontalLine: string; + /** Styles applied to y-axes. */ + verticalLine: string; +}; +``` + +### ChartsGridClassKey + +```typescript +type ChartsGridClassKey = 'line' | 'root' | 'horizontalLine' | 'verticalLine'; +``` + +### ChartsGridProps + +```typescript +type ChartsGridProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Displays vertical grid. */ + vertical?: boolean; + /** Displays horizontal grid. */ + horizontal?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### ChartsIconSlots + +```typescript +type ChartsIconSlots = {}; +``` + +### ChartsItemTooltipContentClasses + +```typescript +type ChartsItemTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsItemTooltipContentProps + +```typescript +type ChartsItemTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; +}; +``` + +### ChartsLabel + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabel = unknown; +``` + +### ChartsLabelClasses + +```typescript +type ChartsLabelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsLabelCustomMarkProps + +```typescript +type ChartsLabelCustomMarkProps = { + className?: string; + /** Color of the series this mark refers to. */ + color?: string; +}; +``` + +### ChartsLabelGradientClasses + +```typescript +type ChartsLabelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### ChartsLabelMark + +Generates the label mark for the tooltip and legend. + +```typescript +type ChartsLabelMark = unknown; +``` + +### ChartsLabelMarkClasses + +```typescript +type ChartsLabelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### ChartsLabelMarkProps + +```typescript +type ChartsLabelMarkProps = { + /** + * The type of the mark. + * @default 'square' + */ + type?: ChartsLabelMarkType; + /** + * The mark will be rendered as a combination of a line and the specified mark type. + * The line will be rendered first, followed by the mark. + * Only used if `type='line+mark'`. + */ + markShape?: MarkShape; + /** The color of the mark. */ + color?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLabelProps + +```typescript +type ChartsLabelProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; +}; +``` + +### ChartsLegendClasses + +```typescript +type ChartsLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### ChartsLegendPosition + +```typescript +type ChartsLegendPosition = { + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; +}; +``` + +### ChartsLegendProps + +```typescript +type ChartsLegendProps = { + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * If `true`, clicking on a legend item will toggle the visibility of the corresponding series. + * @default false + */ + toggleVisibilityOnClick?: boolean; + className?: string; + sx?: SxProps; + tabIndex?: number; +}; +``` + +### ChartsLegendSlotExtension + +```typescript +type ChartsLegendSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsLegendSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsLegendSlotProps; +}; +``` + +### ChartsLegendSlotProps + +```typescript +type ChartsLegendSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; +}; +``` + +### ChartsLegendSlots + +```typescript +type ChartsLegendSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; +}; +``` + +### ChartsLocalizationProviderProps + +```typescript +type ChartsLocalizationProviderProps = { + children?: React.ReactNode; + /** Localized text for chart components. */ + localeText?: Partial; +}; +``` + +### ChartsOverlayProps + +```typescript +type ChartsOverlayProps = { + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsOverlaySlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsOverlaySlotProps; +}; +``` + +### ChartsOverlaySlotProps + +```typescript +type ChartsOverlaySlotProps = { + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; +}; +``` + +### ChartsOverlaySlots + +```typescript +type ChartsOverlaySlots = { + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsPieSorting + +```typescript +type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number); +``` + +### ChartsReferenceLineClasses + +```typescript +type ChartsReferenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### ChartsReferenceLineClassKey + +```typescript +type ChartsReferenceLineClassKey = 'line' | 'label' | 'root' | 'horizontal' | 'vertical'; +``` + +### ChartsReferenceLineProps + +```typescript +type ChartsReferenceLineProps = ( + | { x?: undefined; y: string | number | Date } + | { y?: undefined; x: string | number | Date } +) & { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### chartsSurfaceClasses + +```typescript +type chartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceClasses + +```typescript +type ChartsSurfaceClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsSurfaceProps + +```typescript +type ChartsSurfaceProps = { + className?: string; + sx?: SxProps; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; +}; +``` + +### ChartsTextProps + +```typescript +type ChartsTextProps = { + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** Text displayed. */ + text: string; + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### ChartsTextStyle + +```typescript +type ChartsTextStyle = { + angle?: number; + /** + * The text baseline + * @default 'central' + */ + dominantBaseline?: ChartsTextBaseline; + /** + * The text anchor + * @default 'middle' + */ + textAnchor?: ChartsTextAnchor; +}; +``` + +### ChartsToolbarImageExportOptions + +```typescript +type ChartsToolbarImageExportOptions = { + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; + /** + * The quality of the image to be exported between 0 and 1. This is only applicable for lossy formats, such as + * 'image/jpeg' and 'image/webp'. 'image/png' does not support this option. + * @default 0.9 + */ + quality?: number; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * The format of the image to be exported. + * Browsers are required to support 'image/png'. Some browsers also support 'image/jpeg' and 'image/webp'. + * If the provided `type` is not supported by the browser, it will default to 'image/png'. + * @default 'image/png' + */ + type: string; +}; +``` + +### ChartsToolbarImageExportTriggerProps + +```typescript +type ChartsToolbarImageExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartsToolbarImageExportOptions; +}; +``` + +### ChartsToolbarPrintExportOptions + +```typescript +type ChartsToolbarPrintExportOptions = { + /** + * If `true`, this export option will be removed from the ChartsToolbarExport menu. + * @default false + */ + disableToolbarButton?: boolean; + /** + * The name of the file without the extension. + * @default The title of the document the chart belongs to + */ + fileName?: string; + /** + * Callback function that is called before the export is triggered. + * It can be used to modify the iframe or perform any other actions before the export, such as updating styles, + * removing elements, etc. + * @returns A promise or void. If a promise is returned, the export will wait for it to resolve before proceeding. + */ + onBeforeExport?: (iframe: HTMLIFrameElement) => void | Promise; + /** + * If `true`, the styles of the page the chart belongs to will be copied to the export iframe. + * Copying styles is useful to ensure that the exported chart looks the same as it does on the page. + * @default true + */ + copyStyles?: boolean; + /** + * A nonce to be used for Content Security Policy (CSP) compliance. + * If provided, this nonce will be added to any style elements created during the export process. + */ + nonce?: string; +}; +``` + +### ChartsToolbarPrintExportTriggerProps + +```typescript +type ChartsToolbarPrintExportTriggerProps = React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; +} & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number } & { + render?: RenderProp< + React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + } + >; + options?: ChartPrintExportOptions; +}; +``` + +### ChartsToolbarProProps + +```typescript +type ChartsToolbarProProps = { + printOptions?: ChartsToolbarPrintExportOptions; + imageExportOptions?: ChartsToolbarImageExportOptions[]; +}; +``` + +### ChartsToolbarProSlotProps + +```typescript +type ChartsToolbarProSlotProps = { + /** Props for the toolbar component. */ + toolbar?: Partial; +}; +``` + +### ChartsToolbarProSlots + +```typescript +type ChartsToolbarProSlots = { + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipCell + +```typescript +type ChartsTooltipCell = StyledComponent< + Pick< + TypographyOwnProps & + CommonProps & + Omit< + React.DetailedHTMLProps, HTMLSpanElement>, + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'children' + | 'variant' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + >, + | 'id' + | 'color' + | 'className' + | 'classes' + | 'sx' + | 'style' + | 'ref' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'key' + | 'content' + | 'translate' + | 'hidden' + | 'variant' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variantMapping' + > & + MUIStyledCommonProps & { component?: React.ElementType }, + {}, + {} +>; +``` + +### chartsTooltipClasses + +```typescript +type chartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClasses + +```typescript +type ChartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClassKey + +```typescript +type ChartsTooltipClassKey = 'root' | 'paper' | 'table' | 'row' | 'cell' | 'mark' | 'axisValueCell'; +``` + +### ChartsTooltipContainerClasses + +```typescript +type ChartsTooltipContainerClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipContainerProps + +```typescript +type ChartsTooltipContainerProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + children?: React.ReactNode; +}; +``` + +### ChartsTooltipContainerSlotProps + +```typescript +type ChartsTooltipContainerSlotProps = {}; +``` + +### ChartsTooltipContainerSlots + +```typescript +type ChartsTooltipContainerSlots = {}; +``` + +### ChartsTooltipPaper + +```typescript +type ChartsTooltipPaper = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLDivElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipProps + +```typescript +type ChartsTooltipProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'axis' | 'none' | 'item'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * Defines the sort order in which series items are displayed in the axis tooltip. + * When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. + * Only applies when `trigger='axis'`. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### ChartsTooltipRow + +```typescript +type ChartsTooltipRow = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableRowElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'hidden' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + >, + {} +>; +``` + +### ChartsTooltipSlotProps + +```typescript +type ChartsTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial>; +}; +``` + +### ChartsTooltipSlots + +```typescript +type ChartsTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ChartsTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipTable + +```typescript +type ChartsTooltipTable = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableElement>, + | 'ref' + | 'key' + | 'id' + | 'color' + | 'className' + | 'style' + | 'width' + | 'suppressHydrationWarning' + | 'lang' + | 'nonce' + | 'part' + | 'slot' + | 'role' + | 'tabIndex' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'content' + | 'translate' + | 'border' + | 'bgcolor' + | 'hidden' + | 'title' + | 'summary' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'spellCheck' + | 'radioGroup' + | 'about' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'tw' + | 'align' + | 'cellPadding' + | 'cellSpacing' + | 'frame' + | 'rules' + >, + {} +>; +``` + +### ChartsTypeFeatureFlags + +```typescript +type ChartsTypeFeatureFlags = {}; +``` + +### ChartsWrapperOwnerState + +```typescript +type ChartsWrapperOwnerState = { + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * The direction of the legend. + * @default 'horizontal' + */ + legendDirection?: Direction; + /** + * The position of the legend. + * @default { horizontal: 'center', vertical: 'bottom' } + */ + legendPosition?: Position; +}; +``` + +### ChartsWrapperProps + +```typescript +type ChartsWrapperProps = { + /** + * The position of the legend. + * @default { horizontal: 'center', vertical: 'bottom' } + */ + legendPosition?: Position; + /** + * The direction of the legend. + * @default 'horizontal' + */ + legendDirection?: Direction; + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * If `true`, the chart wrapper set `height: 100%`. + * @default `false` if the `height` prop is set. And `true` otherwise. + */ + extendVertically?: boolean; + children: React.ReactNode; + sx?: SxProps; +}; +``` + +### ChartsXAxisProps + +```typescript +type ChartsXAxisProps = { + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsXAxisSlotProps + +```typescript +type ChartsXAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsXAxisSlots + +```typescript +type ChartsXAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsXReferenceLineProps + +```typescript +type ChartsXReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The x value associated with the reference line. + * If defined the reference line will be vertical. + */ + x: TValue; +}; +``` + +### ChartsYAxisProps + +```typescript +type ChartsYAxisProps = { + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the axis to render. + * If undefined, it will be the first defined axis. + */ + axisId?: AxisId; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** The label of the axis. */ + label?: string; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; +}; +``` + +### ChartsYAxisSlotProps + +```typescript +type ChartsYAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsYAxisSlots + +```typescript +type ChartsYAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` + +### ChartsYReferenceLineProps + +```typescript +type ChartsYReferenceLineProps = { + /** + * The alignment if the label is in the chart drawing area. + * @default 'middle' + */ + labelAlign?: 'start' | 'middle' | 'end'; + /** The label to display along the reference line. */ + label?: string; + /** + * Additional space around the label in px. + * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes. + * @default { x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line. + */ + spacing?: number | { x?: number; y?: number }; + /** + * The id of the axis used for the reference value. + * @default The `id` of the first defined axis. + */ + axisId?: AxisId; + /** The style applied to the label. */ + labelStyle?: ChartsTextStyle; + /** The style applied to the line. */ + lineStyle?: React.CSSProperties; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The y value associated with the reference line. + * If defined the reference line will be horizontal. + */ + y: TValue; +}; +``` + +### cheerfulFiestaPaletteDark + +```typescript +type cheerfulFiestaPaletteDark = string[]; +``` + +### cheerfulFiestaPaletteLight + +```typescript +type cheerfulFiestaPaletteLight = string[]; +``` + +### ColorLegendSelector + +```typescript +type ColorLegendSelector = { + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### ComputedPieRadius + +Props received when the parent components has done the percentage conversion. + +```typescript +type ComputedPieRadius = { + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### continuousColorLegendClasses + +```typescript +type continuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendClasses + +```typescript +type ContinuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendProps + +```typescript +type ContinuousColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * The label to display at the minimum side of the gradient. + * Can either be a string, or a function. + * @default formattedValue + */ + minLabel?: string | LabelFormatter; + /** + * The label to display at the maximum side of the gradient. + * Can either be a string, or a function. + * If not defined, the formatted maximal value is display. + * @default formattedValue + */ + maxLabel?: string | LabelFormatter; + /** + * The id for the gradient to use. + * If not provided, it will use the generated gradient from the axis configuration. + * The `gradientId` will be used as `fill="url(#gradientId)"`. + * @default auto-generated id + */ + gradientId?: string; + /** + * Where to position the labels relative to the gradient. + * @default 'end' + */ + labelPosition?: 'start' | 'end' | 'extremes'; + /** + * If `true`, the gradient and labels will be reversed. + * @default false + */ + reverse?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; + /** + * The thickness of the gradient + * @default 12 + */ + thickness?: number; +}; +``` + +### ContinuousScaleName + +```typescript +type ContinuousScaleName = 'linear' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc'; +``` + +### CurveType + +The type of curve to use for the line. +Read more about curves at +[line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + +```typescript +type CurveType = + | 'catmullRom' + | 'linear' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepBefore' + | 'stepAfter' + | 'bumpY' + | 'bumpX'; +``` + +### cyanPaletteDark + +```typescript +type cyanPaletteDark = string[]; +``` + +### cyanPaletteLight + +```typescript +type cyanPaletteLight = string[]; +``` + +### DEFAULT_AXIS_SIZE_HEIGHT + +```typescript +type DEFAULT_AXIS_SIZE_HEIGHT = 25; +``` + +### DEFAULT_AXIS_SIZE_WIDTH + +```typescript +type DEFAULT_AXIS_SIZE_WIDTH = 45; +``` + +### DEFAULT_MARGINS + +```typescript +type DEFAULT_MARGINS = { top: number; bottom: number; left: number; right: number }; +``` + +### DEFAULT_RADIUS_AXIS_KEY + +```typescript +type DEFAULT_RADIUS_AXIS_KEY = 'DEFAULT_RADIUS_AXIS_KEY'; +``` + +### DEFAULT_ROTATION_AXIS_KEY + +```typescript +type DEFAULT_ROTATION_AXIS_KEY = 'DEFAULT_ROTATION_AXIS_KEY'; +``` + +### DEFAULT_X_AXIS_KEY + +```typescript +type DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY'; +``` + +### DEFAULT_Y_AXIS_KEY + +```typescript +type DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY'; +``` + +### DefaultizedBarSeriesType + +```typescript +type DefaultizedBarSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; +}; +``` + +### DefaultizedFunnelSeriesType + +```typescript +type DefaultizedFunnelSeriesType = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### DefaultizedHeatmapSeriesType + +```typescript +type DefaultizedHeatmapSeriesType = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### DefaultizedLineSeriesType + +```typescript +type DefaultizedLineSeriesType = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedPieSeriesType + +```typescript +type DefaultizedPieSeriesType = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### DefaultizedPieValueType + +```typescript +type DefaultizedPieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; + color: string; + formattedValue: string; + hidden: boolean; +}; +``` + +### DefaultizedRadarSeriesType + +```typescript +type DefaultizedRadarSeriesType = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### DefaultizedSankeySeriesType + +```typescript +type DefaultizedSankeySeriesType = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### DefaultizedScatterSeriesType + +```typescript +type DefaultizedScatterSeriesType = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### DefaultizedSeriesType + +```typescript +type DefaultizedSeriesType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: CommonHighlightScope | SankeyHighlightScope; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: + | HeatmapValueType[] + | (number | null)[] + | ScatterValueType[] + | number[] + | DefaultizedPieValueType[] + | MakeRequired[] + | SankeyLayout; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: + | ((value: number | null, context: { xIndex: number; yIndex: number }) => string | null) + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | SeriesValueFormatter + | ((value: number, context: SankeyValueFormatterContext) => string | null) + | SeriesValueFormatter; +}; +``` + +### defaultSeriesConfigPro + +```typescript +type defaultSeriesConfigPro = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; +}; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### FadeOptions + +```typescript +type FadeOptions = 'none' | 'series' | 'global'; +``` + +### FocusedItemIdentifier + +```typescript +type FocusedItemIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### FUNNEL_CHART_PLUGINS + +```typescript +type FUNNEL_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### FunnelChartPluginSignatures + +```typescript +type FunnelChartPluginSignatures = FunnelChartPluginSignatures; +``` + +### FunnelChartProps + +````typescript +type FunnelChartProps = { + /** + * The series to display in the funnel chart. + * An array of [[FunnelSeries]] objects. + */ + series: FunnelSeries[]; + /** + * The configuration of the category axis. + * @default { position: 'none' } + */ + categoryAxis?: CategoryAxis; + /** + * If `true`, the legend is not rendered. + * @default false + */ + hideLegend?: boolean; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: FunnelItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: FunnelItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The gap, in pixels, between funnel sections. + * @default 0 + */ + gap?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'funnel'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { funnel: ChartSeriesTypeConfig<'funnel'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all funnel elements at the current position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'funnel'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'funnel'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | VisibilityIdentifier<'funnel'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +```` + +### FunnelChartSlotExtension + +```typescript +type FunnelChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelChartSlotProps; +}; +``` + +### FunnelChartSlotProps + +```typescript +type FunnelChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### FunnelChartSlots + +```typescript +type FunnelChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### funnelClasses + +```typescript +type funnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClasses + +```typescript +type FunnelClasses = { + /** Styles applied to the funnel plot element. */ + root: string; + /** Styles applied to an individual funnel section element. */ + section: string; + /** Styles applied to a funnel section element if `variant="filled"`. */ + sectionFilled: string; + /** Styles applied to a funnel section element if `variant="outlined"`. */ + sectionOutlined: string; + /** Styles applied to a funnel section label element. */ + sectionLabel: string; +}; +``` + +### FunnelClassKey + +```typescript +type FunnelClassKey = 'root' | 'section' | 'sectionLabel' | 'sectionFilled' | 'sectionOutlined'; +``` + +### FunnelCurveType + +```typescript +type FunnelCurveType = 'linear' | 'linear-sharp' | 'step' | 'bump' | 'pyramid' | 'step-pyramid'; +``` + +### FunnelDataPoints + +```typescript +type FunnelDataPoints = Record<'x' | 'y', number> & { useBandWidth: boolean; stackOffset: number }; +``` + +### FunnelItem + +```typescript +type FunnelItem = { + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; + /** The value of the data point. */ + value: number; +}; +``` + +### FunnelItemId + +```typescript +type FunnelItemId = string | number; +``` + +### FunnelItemIdentifier + +An object that allows to identify a funnel item. +Used for item interaction + +```typescript +type FunnelItemIdentifier = { + type: 'funnel'; + /** The series id of the funnel. */ + seriesId: string; + /** The index of the data point in the series. */ + dataIndex: number; +}; +``` + +### FunnelLabelOptions + +```typescript +type FunnelLabelOptions = { + /** + * The position of the label. + * @default { vertical: 'middle', horizontal: 'center' } + */ + position?: Position; + /** + * The text anchor of the label. Affects the horizontal alignment of the text. + * + * Default value depends on the position. + */ + textAnchor?: 'start' | 'middle' | 'end'; + /** + * The dominant baseline of the label. Affects the vertical alignment of the text. + * + * Default value depends on the position. + */ + dominantBaseline?: + | 'auto' + | 'baseline' + | 'hanging' + | 'middle' + | 'central' + | 'text-after-edge' + | 'text-before-edge'; + /** + * The offset of the label from the anchor point. + * If a single number is provided, the offset will be applied in both directions. + * @default 0 + */ + offset?: number | { x?: number; y?: number }; +}; +``` + +### FunnelPlotProps + +```typescript +type FunnelPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Callback fired when a funnel item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + funnelItemIdentifier: FunnelItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotExtension + +```typescript +type FunnelPlotSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: FunnelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: FunnelPlotSlotProps; +}; +``` + +### FunnelPlotSlotProps + +```typescript +type FunnelPlotSlotProps = { + funnelSection?: FunnelSectionProps; + funnelSectionLabel?: FunnelSectionLabelProps; +}; +``` + +### FunnelPlotSlots + +```typescript +type FunnelPlotSlots = { + /** + * Custom component for funnel section. + * @default FunnelSection + */ + funnelSection?: React.ElementType< + FunnelSectionProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for funnel section label. + * @default FunnelSectionLabel + */ + funnelSectionLabel?: React.ElementType< + FunnelSectionLabelProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### FunnelScaleName + +```typescript +type FunnelScaleName = Exclude< + 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear', + 'point' +>; +``` + +### FunnelSection + +```typescript +type FunnelSection = unknown; +``` + +### FunnelSectionLabel + +```typescript +type FunnelSectionLabel = unknown; +``` + +### FunnelSeries + +```typescript +type FunnelSeries = { + /** The id of this series. */ + id?: SeriesId; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + type?: 'funnel'; +}; +``` + +### FunnelSeriesType + +```typescript +type FunnelSeriesType = { + type: 'funnel'; + /** Data associated to the funnel section. */ + data: FunnelValueType[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; + /** + * Controls how the funnel is drawn. + * Ignored on `step` and `linear-sharp` curves. + * + * This affects different curves in different ways: + * - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges. + * - `pyramid` & `step-pyramid`: Fully changes the direction of the shape. + * @default 'auto' + */ + funnelDirection?: 'increasing' | 'decreasing' | 'auto'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### FunnelValueType + +```typescript +type FunnelValueType = { + /** A unique identifier of the funnel section. */ + id?: FunnelItemId; + /** The value of the funnel section. */ + value: number; + /** The label to display on the tooltip, funnel section, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'section') => string | undefined); + /** The color of the funnel section */ + color?: string; + /** + * Defines the mark type for the funnel item. + * @default 'square' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### gaugeClasses + +```typescript +type gaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClasses + +```typescript +type GaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClassKey + +```typescript +type GaugeClassKey = 'root' | 'valueArc' | 'referenceArc' | 'valueText'; +``` + +### GaugeContainerProps + +```typescript +type GaugeContainerProps = { + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; +}; +``` + +### GaugeFormatterParams + +```typescript +type GaugeFormatterParams = { value: number | null; valueMin: number; valueMax: number }; +``` + +### GaugeProps + +```typescript +type GaugeProps = { + classes?: Partial; + children?: React.ReactNode; + className?: string; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; + text?: string | ((params: GaugeFormatterParams) => string | null); +}; +``` + +### GaugeValueTextProps + +```typescript +type GaugeValueTextProps = { + text?: string | ((params: GaugeFormatterParams) => string | null); + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` + +### greenPaletteDark + +```typescript +type greenPaletteDark = string[]; +``` + +### greenPaletteLight + +```typescript +type greenPaletteLight = string[]; +``` + +### HEATMAP_PLUGINS + +```typescript +type HEATMAP_PLUGINS = [ + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### HeatmapCellOwnerState + +```typescript +type HeatmapCellOwnerState = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + value: number; +}; +``` + +### HeatmapCellProps + +```typescript +type HeatmapCellProps = { + x: number; + y: number; + width: number; + height: number; + ownerState: HeatmapCellOwnerState; +}; +``` + +### heatmapClasses + +```typescript +type heatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClasses + +```typescript +type HeatmapClasses = { + /** Styles applied to the heatmap plot root element. */ + root: string; + /** Styles applied to the heatmap cells. */ + cell: string; + /** + * Styles applied to the cell element if highlighted. + * @deprecated Use `[data-highlighted]` selector instead. + */ + highlighted: string; + /** + * Styles applied to the cell element if faded. + * @deprecated Use `[data-faded]` selector instead. + */ + faded: string; + /** + * Styles applied to the root element for a specified series. + * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`. + * @deprecated Use `[data-series="${seriesId}"]` selector instead. + */ + series: string; +}; +``` + +### HeatmapClassKey + +```typescript +type HeatmapClassKey = 'root' | 'series' | 'highlighted' | 'faded' | 'cell'; +``` + +### HeatmapItemIdentifier + +An object that allows to identify a single cell. +Used for item interaction + +```typescript +type HeatmapItemIdentifier = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; +}; +``` + +### HeatmapItemIdentifierWithData + +The cell identifier with the associated data value. + +```typescript +type HeatmapItemIdentifierWithData = { + type: 'heatmap'; + /** The id of the series the cell belongs to. */ + seriesId: string; + /** The x index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + xIndex: number; + /** The y index of the cell. Useful to identify the cell position in the heatmap even if there is no data. */ + yIndex: number; + /** The value of the cell. Null if there is no data associated. */ + value: number | null; +}; +``` + +### HeatmapPlotProps + +```typescript +type HeatmapPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapPlotSlotProps; +}; +``` + +### HeatmapPlotSlotProps + +```typescript +type HeatmapPlotSlotProps = { cell?: Partial }; +``` + +### HeatmapPlotSlots + +```typescript +type HeatmapPlotSlots = { + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; +}; +``` + +### HeatmapPluginSignatures + +```typescript +type HeatmapPluginSignatures = HeatmapPluginSignatures; +``` + +### HeatmapProps + +```typescript +type HeatmapProps = { + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The series to display in the bar chart. + * An array of [[HeatmapSeries]] objects. + */ + series: HeatmapSeries[]; + /** + * The configuration of the tooltip. + * @see + */ + tooltip?: ChartsTooltipProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: HeatmapItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: HeatmapItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** The callback fired when an item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + item: SeriesItemIdentifierWithType< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + ) => void; + apiRef?: React.RefObject | undefined>; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +``` + +### HeatmapSeries + +```typescript +type HeatmapSeries = { + /** The id of this series. */ + id?: SeriesId; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + type?: 'heatmap'; +}; +``` + +### HeatmapSeriesType + +```typescript +type HeatmapSeriesType = { + type: 'heatmap'; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data?: HeatmapValueType[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; + /** The id of this series. */ + id?: SeriesId; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### HeatmapSlotProps + +```typescript +type HeatmapSlotProps = { + tooltip?: Partial; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + cell?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### HeatmapSlots + +```typescript +type HeatmapSlots = { + /** + * Custom component for the tooltip. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the legend. + * @default ContinuousColorLegendProps + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### HeatmapTooltipClasses + +```typescript +type HeatmapTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentClasses + +```typescript +type HeatmapTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### HeatmapTooltipContentProps + +```typescript +type HeatmapTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### HeatmapTooltipProps + +```typescript +type HeatmapTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer'; +}; +``` + +### HeatmapTooltipSlotProps + +```typescript +type HeatmapTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial; +}; +``` + +### HeatmapTooltipSlots + +```typescript +type HeatmapTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### HeatmapValueType + +```typescript +type HeatmapValueType = HeatmapValueType; +``` + +### HighlightItemIdentifier + +Identifies an highlighted item or series. + +```typescript +type HighlightItemIdentifier< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightItemIdentifierWithType + +```typescript +type HighlightItemIdentifierWithType< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + /** Unique identifier for the series */ + seriesId: string; +}; +``` + +### HighlightOptions + +```typescript +type HighlightOptions = 'none' | 'item' | 'series'; +``` + +### HighlightScope + +```typescript +type HighlightScope = CommonHighlightScope | SankeyHighlightScope; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` + +### ItemTooltip + +```typescript +type ItemTooltip< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### labelClasses + +```typescript +type labelClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### labelGradientClasses + +```typescript +type labelGradientClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the "mask" that gives shape to the gradient. */ + mask: string; + /** Styles applied when direction is "column". */ + vertical: string; + /** Styles applied when direction is "row". */ + horizontal: string; + /** Styles applied to the element filled by the gradient */ + fill: string; +}; +``` + +### labelMarkClasses + +```typescript +type labelMarkClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the mark type "line". */ + line: string; + /** Styles applied to the mark type "line+mark". */ + lineAndMark: string; + /** Styles applied to the mark type "square". */ + square: string; + /** Styles applied to the mark type "circle". */ + circle: string; + /** Styles applied to the element with fill={color} attribute. */ + fill: string; +}; +``` + +### legendClasses + +```typescript +type legendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### LegendItemContext + +```typescript +type LegendItemContext = SeriesLegendItemContext | PiecewiseColorLegendItemContext; +``` + +### LegendItemParams + +```typescript +type LegendItemParams = { + /** The type of the series */ + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + markType: ChartsLabelMarkType | undefined; + /** The identifier of the series */ + seriesId?: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The minimum value of the category */ + minValue?: number | Date | null; + /** The maximum value of the category */ + maxValue?: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LINE_CHART_PRO_PLUGINS + +```typescript +type LINE_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProPluginSignatures + +```typescript +type LineChartProPluginSignatures = LineChartProPluginSignatures; +``` + +### LineChartProProps + +````typescript +type LineChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartProSlotProps + +```typescript +type LineChartProSlotProps = { + line?: SlotComponentPropsFromProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + area?: SlotComponentPropsFromProps; + mark?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + lineHighlight?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### LineChartProSlots + +```typescript +type LineChartProSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'line' + | 'area' + | 'mark' + | 'highlight' + | 'markAnimate' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + seriesId: string; + color: string; + classes?: Partial; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LineItemIdentifier + +An object that allows to identify a single line. +Used for item interaction + +```typescript +type LineItemIdentifier = { + type: 'line'; + seriesId: string; + /** `dataIndex` can be `undefined` if the mouse is over the area and not a specific item. */ + dataIndex?: number; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### LineSeriesType + +```typescript +type LineSeriesType = { + type: 'line'; + /** Data associated to the line. */ + data?: (number | null)[]; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; +}; +``` + +### mangoFusionPaletteDark + +```typescript +type mangoFusionPaletteDark = string[]; +``` + +### mangoFusionPaletteLight + +```typescript +type mangoFusionPaletteLight = string[]; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + seriesId: string; + classes?: Partial; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +### MarkShape + +```typescript +type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; +``` + +### NumberValue + +```typescript +type NumberValue = NumberValue; +``` + +### orangePaletteDark + +```typescript +type orangePaletteDark = string[]; +``` + +### orangePaletteLight + +```typescript +type orangePaletteLight = string[]; +``` + +### OrdinalTimeTicks + +```typescript +type OrdinalTimeTicks = (TickFrequencyDefinition | TickFrequency)[]; +``` + +### PIE_CHART_PLUGINS + +```typescript +type PIE_CHART_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### PIE_CHART_PRO_PLUGINS + +```typescript +type PIE_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### PieArcLabelPlotProps + +```typescript +type PieArcLabelPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcLabelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcLabelPlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcLabelPlotSlotProps + +```typescript +type PieArcLabelPlotSlotProps = { pieArcLabel?: Partial }; +``` + +### PieArcLabelPlotSlots + +```typescript +type PieArcLabelPlotSlots = { pieArcLabel?: React.JSXElementConstructor }; +``` + +### PieArcLabelProps + +```typescript +type PieArcLabelProps = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + classes?: Partial; + startAngle: number; + endAngle: number; + arcLabelRadius: number; + cornerRadius: number; + paddingAngle: number; + skipAnimation: boolean; + formattedArcLabel?: string | null; + hidden?: boolean; +}; +``` + +### PieArcOwnerState + +```typescript +type PieArcOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; +}; +``` + +### PieArcPlotProps + +```typescript +type PieArcPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcPlotSlotProps; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcPlotSlotProps + +```typescript +type PieArcPlotSlotProps = { pieArc?: Partial }; +``` + +### PieArcPlotSlots + +```typescript +type PieArcPlotSlots = { pieArc?: React.JSXElementConstructor }; +``` + +### PieArcProps + +```typescript +type PieArcProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; + cornerRadius: number; + endAngle: number; + innerRadius: number; + onClick?: (event: React.MouseEvent) => void; + outerRadius: number; + paddingAngle: number; + startAngle: number; + /** If `true`, the animation is disabled. */ + skipAnimation?: boolean; + /** + * If `true`, the default event handlers are disabled. + * Those are used, for example, to display a tooltip or highlight the arc on hover. + */ + skipInteraction?: boolean; +}; +``` + +### piecewiseColorLegendClasses + +```typescript +type piecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendClasses + +```typescript +type PiecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendItemContext + +```typescript +type PiecewiseColorLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'piecewiseColor'; + /** The minimum value of the category */ + minValue: number | Date | null; + /** The maximum value of the category */ + maxValue: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### PiecewiseColorLegendProps + +```typescript +type PiecewiseColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * Format the legend labels. + * @returns The displayed label, `''` to skip the label but show the color mark, or `null` to skip it entirely. + */ + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + /** + * Where to position the labels relative to the color marks. + * @default 'extremes' + */ + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### PiecewiseLabelFormatterParams + +```typescript +type PiecewiseLabelFormatterParams = { + /** The index of the entry. */ + index: number; + /** The length of the entries array. */ + length: number; + /** The min value of the piece. `null` is infinite. */ + min: number | Date | null; + /** The max value of the piece. `null` is infinite. */ + max: number | Date | null; + /** The formatted min value of the piece. `null` is infinite. */ + formattedMin: string | null; + /** The formatted max value of the piece. `null` is infinite. */ + formattedMax: string | null; +}; +``` + +### PieChartPluginSignatures + +```typescript +type PieChartPluginSignatures = PieChartPluginSignatures; +``` + +### PieChartProPluginSignatures + +```typescript +type PieChartProPluginSignatures = PieChartProPluginSignatures; +``` + +### PieChartProProps + +````typescript +type PieChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; +}; +```` + +### PieChartProps + +````typescript +type PieChartProps = { + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartSlotProps; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### PieChartProSlotProps + +```typescript +type PieChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + pieArc?: Partial; + pieArcLabel?: Partial; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### PieChartProSlots + +```typescript +type PieChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### PieChartSlotProps + +```typescript +type PieChartSlotProps = { + pieArc?: Partial; + pieArcLabel?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### PieChartSlots + +```typescript +type PieChartSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### pieClasses + +```typescript +type pieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClasses + +```typescript +type PieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClassKey + +```typescript +type PieClassKey = + | 'root' + | 'arc' + | 'series' + | 'arcLabel' + | 'animate' + | 'seriesLabels' + | 'focusIndicator'; +``` + +### PieItemId + +```typescript +type PieItemId = string | number; +``` + +### PieItemIdentifier + +An object that allows to identify a single pie slice. +Used for item interaction + +```typescript +type PieItemIdentifier = { type: 'pie'; seriesId: string; dataIndex: number }; +``` + +### PiePlotProps + +```typescript +type PiePlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: PiePlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PiePlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; +}; +``` + +### PiePlotSlotProps + +```typescript +type PiePlotSlotProps = { pieArc?: Partial; pieArcLabel?: Partial }; +``` + +### PiePlotSlots + +```typescript +type PiePlotSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; +}; +``` + +### PieSeries + +```typescript +type PieSeries = MakeOptional>, 'type'>; +``` + +### PieSeriesLayout + +Layout information computed from the pie series and the drawing area. + +```typescript +type PieSeriesLayout = { + /** The pie center coordinate in px. */ + center: { x: number; y: number }; + /** + * The pie radius in px. + * Computed based on the drawing area and the center placement. + */ + radius: { + /** + * The maximum available radius in px. + * Correspond to radius='100%'. + */ + available: number; + /** The pie inner radius in px, except if overridden by item state (highlight/faded). */ + inner: number; + /** The pie outer radius in px, except if overridden by item state (highlight/faded). */ + outer: number; + /** The pie label radius in px, except if overridden by item state (highlight/faded). */ + label: number; + }; +}; +``` + +### PieSeriesType + +```typescript +type PieSeriesType = { + type: 'pie'; + data: TData[]; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### PieValueType + +```typescript +type PieValueType = { + /** A unique identifier of the pie slice. */ + id?: PieItemId; + value: number; + /** The label to display on the tooltip, arc, or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string); + color?: string; + /** + * Defines the mark type for the pie item. + * @default 'circle' + */ + labelMarkType?: ChartsLabelMarkType; +}; +``` + +### pinkPaletteDark + +```typescript +type pinkPaletteDark = string[]; +``` + +### pinkPaletteLight + +```typescript +type pinkPaletteLight = string[]; +``` + +### Position + +```typescript +type Position = { + /** The vertical position. */ + vertical?: 'top' | 'middle' | 'bottom'; + /** The horizontal position. */ + horizontal?: 'start' | 'center' | 'end'; +}; +``` + +### PropsFromSlot + +```typescript +type PropsFromSlot = + | P + | React.ComponentProps< + NonNullable | React.ElementType | null | undefined> + >; +``` + +### purplePaletteDark + +```typescript +type purplePaletteDark = string[]; +``` + +### purplePaletteLight + +```typescript +type purplePaletteLight = string[]; +``` + +### RADAR_CHART_PRO_PLUGINS + +```typescript +type RADAR_CHART_PRO_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, +]; +``` + +### RADAR_PLUGINS + +```typescript +type RADAR_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, +]; +``` + +### RadarAxisHighlightProps + +```typescript +type RadarAxisHighlightProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial< + Pick + >; +}; +``` + +### RadarAxisProps + +```typescript +type RadarAxisProps = { + /** + * Defines how label align with the axis. + * - 'horizontal': labels stay horizontal and their placement change with the axis angle. + * - 'rotated': labels are rotated 90deg relatively to their axis. + * @default 'horizontal' + */ + labelOrientation?: 'horizontal' | 'rotated'; + /** The labels text anchor or a function returning the text anchor for a given axis angle (in degree). */ + textAnchor?: + | 'start' + | 'middle' + | 'end' + | 'inherit' + | ((angle: number) => 'start' | 'end' | 'middle' | 'inherit' | undefined); + /** The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). */ + dominantBaseline?: + | 'auto' + | 'use-script' + | 'no-change' + | 'reset-size' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'central' + | 'middle' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | (( + angle: number, + ) => + | 'auto' + | 'middle' + | 'alphabetic' + | 'hanging' + | 'ideographic' + | 'mathematical' + | 'central' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | 'use-script' + | 'no-change' + | 'reset-size' + | undefined); + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial>; + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### RadarChartPluginSignatures + +```typescript +type RadarChartPluginSignatures = RadarChartPluginSignatures; +``` + +### RadarChartProPluginSignatures + +```typescript +type RadarChartProPluginSignatures = RadarChartProPluginSignatures; +``` + +### RadarChartProProps + +````typescript +type RadarChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartProSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** A CSS class name applied to the root element. */ + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; +}; +```` + +### RadarChartProps + +````typescript +type RadarChartProps = { + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartSlotProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + sx?: SxProps; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; +}; +```` + +### RadarChartProSlotProps + +```typescript +type RadarChartProSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### RadarChartProSlots + +```typescript +type RadarChartProSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### RadarChartSlotProps + +```typescript +type RadarChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### RadarChartSlots + +```typescript +type RadarChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### radarClasses + +```typescript +type radarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClasses + +```typescript +type RadarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClassKey + +```typescript +type RadarClassKey = + | 'axisLine' + | 'axisLabel' + | 'axisRoot' + | 'gridRadial' + | 'gridDivider' + | 'gridStripe' + | 'seriesRoot' + | 'seriesArea' + | 'seriesMark' + | 'axisHighlightRoot' + | 'axisHighlightLine' + | 'axisHighlightDot'; +``` + +### RadarDataProviderProps + +```typescript +type RadarDataProviderProps< + TSignatures extends ChartAnyPluginSignature[] = RadarChartPluginSignatures, +> = { + /** Array of plugins used to add features to the chart. */ + plugins?: [] | [ChartPlugin]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** Slots to customize charts' components. */ + slots?: Partial; + /** The props for the slots. */ + slotProps?: Partial; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: + | string + | number + | bigint + | boolean + | ReactElement + | Iterable + | React.ReactPortal + | Promise + | null; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: number | Partial; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: {}; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; +}; +``` + +### RadarGridProps + +```typescript +type RadarGridProps = { + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; +}; +``` + +### RadarItemIdentifier + +An object that allows to identify either a radar series or a radar point (if dataIndex is defined). +Used for item interaction + +```typescript +type RadarItemIdentifier = { type: 'radar'; seriesId: string; dataIndex?: number }; +``` + +### RadarSeries + +```typescript +type RadarSeries = { + /** The id of this series. */ + id?: SeriesId; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + type?: 'radar'; +}; +``` + +### RadarSeriesAreaProps + +```typescript +type RadarSeriesAreaProps = { + /** Callback fired when an area is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesMarksProps + +```typescript +type RadarSeriesMarksProps = { + /** Callback fired when a mark is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesPlotProps + +```typescript +type RadarSeriesPlotProps = { + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesType + +```typescript +type RadarSeriesType = { + type: 'radar'; + data: number[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; +}; +``` + +### RadiusAxis + +```typescript +type RadiusAxis = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * The minimal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + min?: number; + /** + * The maximal value of the domain. + * If not provided, it gets computed to display the entire chart data. + */ + max?: number; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The minimal radius. */ + minRadius?: number; + /** The maximal radius. */ + maxRadius?: number; + colorMap?: ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### rainbowSurgePaletteDark + +```typescript +type rainbowSurgePaletteDark = string[]; +``` + +### rainbowSurgePaletteLight + +```typescript +type rainbowSurgePaletteLight = string[]; +``` + +### redPaletteDark + +```typescript +type redPaletteDark = string[]; +``` + +### redPaletteLight + +```typescript +type redPaletteLight = string[]; +``` + +### referenceLineClasses + +```typescript +type referenceLineClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the root element if the reference line is vertical. */ + vertical: string; + /** Styles applied to the root element if the reference line is horizontal. */ + horizontal: string; + /** Styles applied to the reference line. */ + line: string; + /** Styles applied to the reference label. */ + label: string; +}; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### RotationAxis + +```typescript +type RotationAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id: AxisId; + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** The label of the axis. */ + label?: string; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** The start angle (in deg). */ + startAngle?: number; + /** The end angle (in deg). */ + endAngle?: number; + /** The gap between the axis and the label. */ + labelGap?: number; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; +}; +``` + +### SankeyChartProps + +```typescript +type SankeyChartProps = { + /** + * The series to display in the Sankey chart. + * A single object is expected. + */ + series: SankeySeries; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotExtension + +```typescript +type SankeyChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotProps + +```typescript +type SankeyChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### SankeyChartSlots + +```typescript +type SankeyChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer' } + | { trigger?: 'item'; anchor?: 'node' | 'pointer' } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### sankeyClasses + +```typescript +type sankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClasses + +```typescript +type SankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClassKey + +```typescript +type SankeyClassKey = + | 'node' + | 'link' + | 'root' + | 'nodes' + | 'links' + | 'nodeLabels' + | 'linkLabels' + | 'nodeLabel' + | 'linkLabel'; +``` + +### SankeyData + +```typescript +type SankeyData = { + /** + * An array of node configs for the Sankey diagram + * + * This is optional, but can be used to provide custom labels or styles for nodes. + */ + nodes?: SankeyNode[]; + /** + * Array of links between nodes. + * + * The node ids will be used as the labels. If you want to provide custom labels, use the `nodes` property. + * + * Each link should have a `source`, `target`, and `value` property. + */ + links: SankeyLink[]; +}; +``` + +### SankeyDataProviderProps + +```typescript +type SankeyDataProviderProps = { + children?: React.ReactNode; + series: SankeySeriesType[]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; +}; +``` + +### SankeyItemIdentifier + +```typescript +type SankeyItemIdentifier = SankeyNodeIdentifier | SankeyLinkIdentifier; +``` + +### SankeyItemIdentifierWithData + +```typescript +type SankeyItemIdentifierWithData = + | SankeyNodeIdentifierWithData + | SankeyLinkIdentifierWithData; +``` + +### SankeyLayout + +Calculated layout for the Sankey diagram + +```typescript +type SankeyLayout = { + nodes: SankeyLayoutNode[]; + links: SankeyLayoutLink[]; +}; +``` + +### SankeyLayoutLink + +Represents the calculated positions and paths for a link in the Sankey diagram + +```typescript +type SankeyLayoutLink = { + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithoutPosition + +```typescript +type SankeyLayoutLinkWithoutPosition = { + source: SankeyLayoutNodeWithoutPosition; + target: SankeyLayoutNodeWithoutPosition; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithPosition + +```typescript +type SankeyLayoutLinkWithPosition = { + path?: string | null; + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; + /** Link's vertical starting position (at source node) calculated by Sankey layout generator. */ + y0?: number; + /** Link's vertical end position (at target node) calculated by Sankey layout generator. */ + y1?: number; + /** Link's width (proportional to its value) calculated by Sankey layout generator. */ + width?: number; +}; +``` + +### SankeyLayoutNode + +Represents the calculated positions and dimensions for a node in the Sankey diagram + +```typescript +type SankeyLayoutNode = { + targetLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithoutPosition + +```typescript +type SankeyLayoutNodeWithoutPosition = { + targetLinks: SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithPosition + +```typescript +type SankeyLayoutNodeWithPosition = { + targetLinks: SankeyLayoutLinkWithPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; + /** Node's minimum horizontal position (derived from the node.depth) calculated by Sankey layout generator. */ + x0?: number; + /** Node's maximum horizontal position (node.x0 + sankey.nodeWidth) calculated by Sankey layout generator. */ + x1?: number; + /** Node's minimum vertical position calculated by Sankey layout generator. */ + y0?: number; + /** Node's maximum vertical position (node.y1 - node.y0 is proportional to node.value) calculated by Sankey layout generator. */ + y1?: number; +}; +``` + +### SankeyLink + +```typescript +type SankeyLink = { + /** Source node ID */ + source: SankeyNodeId; + /** Target node ID */ + target: SankeyNodeId; + /** The value/weight of the link (affects width) */ + value: number; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; +}; +``` + +### SankeyLinkIdentifier + +```typescript +type SankeyLinkIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; +}; +``` + +### SankeyLinkIdentifierWithData + +```typescript +type SankeyLinkIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; + /** The link object with all the calculated properties */ + link: SankeyLayoutLink; +}; +``` + +### SankeyLinkLabelPlotProps + +```typescript +type SankeyLinkLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyLinkOptions + +```typescript +type SankeyLinkOptions = { + /** + * Default color for links without specified colors. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; + /** Opacity of the links (0-1) */ + opacity?: number; + /** Whether to show link values */ + showValues?: boolean; + /** + * Custom sort mode for links + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the links array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutLink, b: SankeyLayoutLink) => number); + /** + * Applies the given number to the X dimension of the control points of the link's curve function. + * This can create better looking links between nodes, but is dependent on the graph layout. + * It is specially impacted by the chart height. + * @default 10 + */ + curveCorrection?: number; + /** + * Highlight mode for links + * - 'links': Highlight hovered link + * - 'nodes': Highlight nodes connected to hovered link + * - 'source': Highlight source node of hovered link + * - 'target': Highlight target node of hovered link + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyLinkHighlight; + /** + * Fade mode for links + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyLinkFade; +}; +``` + +### SankeyLinkPlotProps + +```typescript +type SankeyLinkPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeyNode + +```typescript +type SankeyNode = { + /** Unique identifier for the node */ + id: SankeyNodeId; + /** The node label to display */ + label?: string; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color?: string; +}; +``` + +### SankeyNodeId + +```typescript +type SankeyNodeId = string | number; +``` + +### SankeyNodeIdentifier + +```typescript +type SankeyNodeIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; +}; +``` + +### SankeyNodeIdentifierWithData + +```typescript +type SankeyNodeIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; + /** The node object with all the calculated properties */ + node: SankeyLayoutNode; +}; +``` + +### SankeyNodeLabelPlotProps + +```typescript +type SankeyNodeLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyNodeOptions + +```typescript +type SankeyNodeOptions = { + /** Default color for nodes without specified colors */ + color?: string; + /** Width of the nodes in pixels */ + width?: number; + /** Padding between nodes in pixels */ + padding?: number; + /** + * Node alignment strategy + * - 'justify': Nodes are evenly distributed across the width. + * - 'left': Nodes are aligned to the left. + * - 'right': Nodes are aligned to the right. + * - 'center': Nodes are centered. + * @default 'justify' + */ + align?: 'justify' | 'left' | 'right' | 'center'; + /** Whether to show node labels */ + showLabels?: boolean; + /** + * Custom sort mode for nodes + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the nodes array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutNode, b: SankeyLayoutNode) => number); + /** + * Highlight mode for nodes + * - 'nodes': Highlight hovered node + * - 'links': Highlight links connected to hovered node + * - 'incoming': Highlight incoming links to hovered node + * - 'outgoing': Highlight outgoing links from hovered node + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyNodeHighlight; + /** + * Fade mode for nodes + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyNodeFade; +}; +``` + +### SankeyNodePlotProps + +```typescript +type SankeyNodePlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; +}; +``` + +### SankeyPlotProps + +```typescript +type SankeyPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeySeries + +```typescript +type SankeySeries = { + /** Unique identifier for the series */ + id?: string; + /** The data for the Sankey diagram */ + data: SankeyData; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Type identifier for Sankey series */ + type?: 'sankey'; +}; +``` + +### SankeySeriesType + +```typescript +type SankeySeriesType = { + /** Unique identifier for the series */ + id?: string; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyTooltipClasses + +```typescript +type SankeyTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipContentClasses + +```typescript +type SankeyTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipProps + +```typescript +type SankeyTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; +}; +``` + +### SankeyTooltipSlotProps + +```typescript +type SankeyTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SankeyTooltipSlots + +```typescript +type SankeyTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### SankeyValueFormatterContext + +```typescript +type SankeyValueFormatterContext = + | { location: 'tooltip' | 'label'; type: 'node'; nodeId: SankeyNodeId } + | { location: 'tooltip' | 'label'; type: 'link'; sourceId: SankeyNodeId; targetId: SankeyNodeId }; +``` + +### ScaleName + +```typescript +type ScaleName = 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### SCATTER_CHART_PLUGINS + +```typescript +type SCATTER_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### SCATTER_CHART_PRO_PLUGINS + +```typescript +type SCATTER_CHART_PRO_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### ScatterChartPluginSignatures + +```typescript +type ScatterChartPluginSignatures = ScatterChartPluginSignatures; +``` + +### ScatterChartProPluginSignatures + +```typescript +type ScatterChartProPluginSignatures = ScatterChartProPluginSignatures; +``` + +### ScatterChartProProps + +````typescript +type ScatterChartProProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartProSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartProSlotProps; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### ScatterChartProps + +````typescript +type ScatterChartProps = { + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartSlotProps; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; +}; +```` + +### ScatterChartProSlotProps + +```typescript +type ScatterChartProSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + scatter?: Partial; + marker?: ScatterMarkerProps; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ScatterChartProSlots + +```typescript +type ScatterChartProSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### ScatterChartSlotProps + +```typescript +type ScatterChartSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + scatter?: Partial; + marker?: ScatterMarkerProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ScatterChartSlots + +```typescript +type ScatterChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### scatterClasses + +```typescript +type scatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClasses + +```typescript +type ScatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClassKey + +```typescript +type ScatterClassKey = 'marker' | 'root' | 'series' | 'focusedMark'; +``` + +### ScatterItemIdentifier + +An object that allows to identify a single scatter item. +Used for item interaction + +```typescript +type ScatterItemIdentifier = { type: 'scatter'; seriesId: string; dataIndex: number }; +``` + +### ScatterMarkerProps + +```typescript +type ScatterMarkerProps = { + /** The series ID. */ + seriesId: string; + /** The index of the data point. */ + dataIndex: number; + /** The x coordinate of the data point. */ + x: number; + /** The y coordinate of the data point. */ + y: number; + /** The fill color of the marker. */ + color: string; + /** The size of the marker. */ + size: number; + /** If `true`, the marker is highlighted. */ + isHighlighted: boolean; + /** If `true`, the marker is faded. */ + isFaded: boolean; + /** Callback fired when clicking on a scatter item. */ + onClick?: (event: React.MouseEvent) => void; +}; +``` + +### ScatterMarkerSlotExtension + +```typescript +type ScatterMarkerSlotExtension = { + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterMarkerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterMarkerSlots; +}; +``` + +### ScatterMarkerSlotProps + +```typescript +type ScatterMarkerSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterMarkerSlots + +```typescript +type ScatterMarkerSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterPlotProps + +```typescript +type ScatterPlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterPlotSlotProps; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + classes?: Partial; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; +}; +``` + +### ScatterPlotSlotProps + +```typescript +type ScatterPlotSlotProps = { scatter?: Partial; marker?: ScatterMarkerProps }; +``` + +### ScatterPlotSlots + +```typescript +type ScatterPlotSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterProps + +```typescript +type ScatterProps = { + series: DefaultizedScatterSeriesType; + xScale: D3Scale; + yScale: D3Scale; + color: string; + /** + * Function to get the color of a scatter item given its data index. + * The data index argument is optional. If not provided, the color for the entire series is returned. + * If provided, the color for the specific scatter item is returned. + */ + colorGetter: (dataIndex?: number) => string; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; + classes?: Partial; + slots?: ScatterSlots; + slotProps?: ScatterSlotProps; +}; +``` + +### ScatterSeries + +```typescript +type ScatterSeries = MakeOptional; +``` + +### ScatterSeriesType + +```typescript +type ScatterSeriesType = { + type: 'scatter'; + data?: ScatterValueType[]; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize?: number; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + preview?: { markerSize?: number }; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +### ScatterSlotProps + +```typescript +type ScatterSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterSlots + +```typescript +type ScatterSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterValueType + +```typescript +type ScatterValueType = { + x: number; + y: number; + z?: any; + /** A unique identifier for the scatter point */ + id?: string | number; +}; +``` + +### SeriesId + +The unique identifier of a series. + +```typescript +type SeriesId = string; +``` + +### SeriesItem + +```typescript +type SeriesItem = { + seriesId: string; + color: string; + value: + | { open: number; high: number; low: number; close: number } + | number + | HeatmapValueType + | ScatterValueType + | MakeRequired + | null; + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string; + formattedLabel: string | null; + markType: ChartsLabelMarkType | undefined; + markShape: MarkShape | undefined; +}; +``` + +### SeriesItemIdentifier + +```typescript +type SeriesItemIdentifier< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { seriesId: string }; +``` + +### SeriesItemIdentifierWithData + +```typescript +type SeriesItemIdentifierWithData< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### SeriesItemIdentifierWithType + +```typescript +type SeriesItemIdentifierWithType< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### SeriesLegendItemContext + +```typescript +type SeriesLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'series'; + /** The identifier of the series */ + seriesId: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### SeriesLegendItemParams + +```typescript +type SeriesLegendItemParams = { + /** The identifier of the series */ + seriesId: string; + /** The type of the series */ + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + markType: ChartsLabelMarkType | undefined; + markShape?: MarkShape; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### ShowMarkParams + +```typescript +type ShowMarkParams = { + /** The item index. */ + index: number; + /** The x coordinate in the SVG. */ + x: number; + /** The y coordinate in the SVG. */ + y: number; + /** The item position value. It likely comes from the axis `data` property. */ + position: AxisValue; + /** The item value. It comes from the series `data` property. */ + value: number; +}; +``` + +### SparkLineChartProps + +````typescript +type SparkLineChartProps = { + /** + * The xAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + xAxis?: XAxis; + /** + * The yAxis configuration. + * Notice it is a single [[AxisConfig]] object, not an array of configuration. + */ + yAxis?: YAxis; + axisHighlight?: ChartsAxisHighlightProps; + /** + * Type of plot used. + * @default 'line' + */ + plotType?: 'bar' | 'line'; + /** Data to plot. */ + data: number[]; + /** + * Formatter used by the tooltip. + * @default (value: number | null) => (value === null ? '' : value.toString()) + * @returns the formatted value. + */ + valueFormatter?: (value: number | null) => string; + /** + * Set to `true` to enable the tooltip in the sparkline. + * @default false + */ + showTooltip?: boolean; + /** + * Set to `true` to highlight the value. + * With line, it shows a point. + * With bar, it shows a highlight band. + * @default false + */ + showHighlight?: boolean; + /** + * Set to `true` to fill spark line area. + * Has no effect if plotType='bar'. + * @default false + */ + area?: boolean; + /** @default 'linear' */ + curve?: CurveType; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + * @default 5 + */ + margin?: Partial | number; + /** + * Overridable component slots. + * @default {} + */ + slots?: SparkLineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SparkLineChartSlotProps; + /** + * Color used to colorize the sparkline. + * @default rainbowSurgePalette[0] + */ + color?: ChartsColor; + /** + * When `true`, the chart's drawing area will not be clipped and elements within can visually overflow the chart. + * @default false + */ + disableClipping?: boolean; + /** + * The clipped area offset in pixels. + * + * This prevents partial clipping of lines when they are drawn on the edge of the drawing area. + * @default { top: 1, right: 1, bottom: 1, left: 1 } + */ + clipAreaOffset?: { top?: number; right?: number; bottom?: number; left?: number }; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | BarItemIdentifier + | Omit + | LineItemIdentifier + | Omit + | ScatterItemIdentifier + | Omit + | PieItemIdentifier + | Omit + | RadarItemIdentifier + | Omit + | HeatmapItemIdentifier + | Omit + | FunnelItemIdentifier + | Omit + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: ( + tooltipItem: + | BarItemIdentifier + | LineItemIdentifier + | ScatterItemIdentifier + | PieItemIdentifier + | RadarItemIdentifier + | HeatmapItemIdentifier + | FunnelItemIdentifier + | SankeyItemIdentifier + | null, + ) => void; + className?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'funnel'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: + | SankeyItemIdentifier + | { type: 'bar'; seriesId: string; dataIndex?: number } + | { type: 'line'; seriesId: string; dataIndex?: number } + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | { type: 'pie'; seriesId: string; dataIndex?: number } + | { type: 'radar'; seriesId: string; dataIndex?: number } + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | { type: 'funnel'; seriesId: string; dataIndex?: number } + | null, + ) => void; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + theme?: 'light' | 'dark'; + /** + * Callback fired when clicking close to an item. + * This is only available for scatter plot for now. + */ + onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + radar: ChartSeriesTypeConfig<'radar'>; + heatmap: ChartSeriesTypeConfig<'heatmap'>; + funnel: ChartSeriesTypeConfig<'funnel'>; + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + )[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | VisibilityIdentifier + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | { + type?: 'heatmap'; + seriesId?: string; + xIndex?: number; + yIndex?: number; + seriesId: string; + type: 'heatmap'; + } + | { type?: 'funnel'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'funnel' } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'node'; + nodeId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | { + type?: 'sankey'; + seriesId?: string; + subType?: 'link'; + sourceId?: SankeyNodeId; + targetId?: SankeyNodeId; + subType: 'node' | 'link'; + seriesId: string; + type: 'sankey'; + } + | VisibilityIdentifier + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** If true, the hit area interaction is disabled and falls back to hover events. */ + disableHitArea?: boolean; +}; +```` + +### SparkLineChartSlotProps + +```typescript +type SparkLineChartSlotProps = { + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SparkLineChartSlots + +```typescript +type SparkLineChartSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'asc' | 'desc' } + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'node' | 'pointer'; sort?: undefined } + ) & { + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'data' + | 'line' + | 'label' + | 'link' + | 'time' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'text' + | 'p' + | 'legend' + | 'circle' + | 'center' + | 'desc' + | 'section' + | 'source' + | 'area' + | 'a' + | 'b' + | 'g' + | 'i' + | 'q' + | 's' + | 'u' + | 'table' + | 'mark' + | 'map' + | 'small' + | 'title' + | 'div' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'rp' + | 'rt' + | 'ruby' + | 'samp' + | 'search' + | 'script' + | 'select' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'tr' + | 'track' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### StackableChartSeriesType + +```typescript +type StackableChartSeriesType = 'bar' | 'line'; +``` + +### StackOffsetType + +```typescript +type StackOffsetType = 'expand' | 'diverging' | 'none' | 'silhouette' | 'wiggle'; +``` + +### StackOrderType + +```typescript +type StackOrderType = 'appearance' | 'ascending' | 'descending' | 'insideOut' | 'none' | 'reverse'; +``` + +### strawberrySkyPaletteDark + +```typescript +type strawberrySkyPaletteDark = string[]; +``` + +### strawberrySkyPaletteLight + +```typescript +type strawberrySkyPaletteLight = string[]; +``` + +### TickFrequency + +The predefined tick frequencies for time ordinal axes. + +- 'years': displays the year, placing ticks at the start of each year +- 'quarterly': displays the month, placing ticks at the start of each quarter +- 'months': displays the month, placing ticks at the start of each month +- 'biweekly': displays the day, placing ticks every two weeks +- 'weeks': displays the day, placing ticks at the start of each week +- 'days': displays the day, placing ticks at the start of each day +- 'hours': displays the hour and minutes, placing ticks at the start of each hour + +```typescript +type TickFrequency = 'years' | 'quarterly' | 'months' | 'biweekly' | 'weeks' | 'days' | 'hours'; +``` + +### TickFrequencyDefinition + +Definition of a tick frequency for time ordinal axes. + +```typescript +type TickFrequencyDefinition = { + /** + * Returns the number of ticks in the given date range for this tick frequency. + * @returns The number of ticks in the [from, to] range. + */ + getTickNumber: (from: Date, to: Date) => number; + /** + * Decides if the current date should be shown as a tick. + * @returns Whether the current date is a tick or not. + */ + isTick: (prev: Date, value: Date) => boolean; + /** + * Format the tick value for display. + * @returns The formatted date string. + */ + format: (date: Date) => string; +}; +``` + +### TickItem + +```typescript +type TickItem = { + /** + * The value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + value?: any; + /** + * The formatted value of the tick. + * It is only `undefined` if it's the tick closing the last band. + */ + formattedValue?: string; + /** + * The offset in pixels relative to the SVG origin. + * For an x-axis, it is relative to the left side of the SVG. + * For a y-axis, it is relative to the top side of the SVG. + */ + offset: number; + /** + * The offset in pixels relative to the tick position. + * For an x-axis, a positive value means the label is shifted to the right of the tick. + * For a y-axis, a positive value means the label is shifted downwards from the tick. + */ + labelOffset: number; +}; +``` + +### UseAnimateParams + +```typescript +type UseAnimateParams = { + /** + * Function that returns the interpolation function for animating props. + * @returns + * Interpolation function that takes a time value between 0 and 1 and returns the interpolated + * props at time t. This function is called on every frame of the animation. + */ + createInterpolator: (lastProps: Props, newProps: Props) => (t: number) => Props; + /** + * Transforms the interpolated props to be passed to `applyProps`, which usually means transforming them to element + * attributes, e.g., transforming an array of points into a `d` attribute for a path. + * @returns The transformed props. + */ + transformProps: (props: Props) => T; + /** + * Applies the transformed props to the element. Usually this will be a call to `element.setAttribute("x", x)` or + * to `element.style.width = width` so that updating the element does not go through the React lifecycle (i.e., not + * causing a re-render), with the objective of improving performance. + * + * This function is called on every frame of the animation. + */ + applyProps: (element: Elem, props: T) => void; + /** If `true`, the animation will be skipped and the final props will be applied immediately. */ + skip?: boolean; + /** Initial props to animate from. If not provided, defaults to the props passed as the first argument of `useAnimate`. */ + initialProps?: Props; + /** Optional ref to merge with the ref returned from this hook. */ + ref?: React.Ref; +}; +``` + +### UseAnimateReturn + +```typescript +type UseAnimateReturn = { + /** Ref to be passed to the element to animate. */ + ref: React.Ref; +}; +``` + +### UseAxesTooltipParams + +```typescript +type UseAxesTooltipParams = { + /** + * The axis directions to consider. + * If not defined, all directions are considered + */ + directions?: ('x' | 'y' | 'rotation')[]; +}; +``` + +### UseAxesTooltipReturnValue + +```typescript +type UseAxesTooltipReturnValue = { axisDirection: 'x' | 'y' | 'radius' | 'rotation'; +mainAxis: { /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ +id: AxisId; +/** The data used by `'band'` and `'point'` scales. */ +data?: any[]; +/** The key used to retrieve `data` from the `dataset` prop. */ +dataKey?: string; +/** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ +valueGetter?: ((item: DatasetElementType) => any); +colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string); type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'piecewise'; thresholds: (number | Date)[]; colors: string[]; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) }; +/** + * Formats the axis value. + * @returns The string to display. + */ +valueFormatter?: ((value: any, context: AxisValueFormatterContext) => string); +/** The label of the axis. */ +label?: string; +/** A CSS class name applied to the root element. */ +className?: string; +/** + * If true, the axis line is disabled. + * @default false + */ +disableLine?: boolean; +/** + * If true, the ticks are disabled. + * @default false + */ +disableTicks?: boolean; +/** The style applied to ticks text. */ +tickLabelStyle?: ChartsTextStyle; +/** The style applied to the axis label. */ +labelStyle?: ChartsTextStyle; +/** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ +tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); +/** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ +tickSpacing?: number; +/** + * The size of the ticks. + * @default 6 + */ +tickSize?: number; +/** Override or extend the styles applied to the component. */ +classes?: Partial; +/** + * Overridable component slots. + * @default {} + */ +slots?: Partial; +/** + * The props used for each component slot. + * @default {} + */ +slotProps?: Partial; +sx?: SxProps; +/** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMaxStep?: number; +/** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMinStep?: number; +/** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ +tickNumber?: number; +/** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ +tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; +/** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ +tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; +/** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ +tickLabelPlacement?: 'middle' | 'tick'; +/** If `true`, hide this value in the tooltip */ +hideTooltip?: boolean; +/** If `true`, Reverse the axis scaleBand. */ +reverse?: boolean; +/** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ +domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); +/** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ +ignoreTooltip?: boolean; +zoom?: boolean | ZoomOptions | false & DefaultizedZoomOptions | true & DefaultizedZoomOptions | { minStart?: number; maxEnd?: number; step?: number; minSpan?: number; maxSpan?: number; panning?: boolean; filterMode?: ZoomFilterMode; slider?: ZoomSliderOptions; axisId: AxisId; axisDirection: 'x' | 'y'; slider: DefaultedZoomSliderOptions; reverse: boolean; minStart: number; maxEnd: number; step: number; minSpan: number; maxSpan: number; panning: boolean; filterMode: ZoomFilterMode }; +/** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ +offset?: number; +scaleType: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +scale: ScaleBand<{ toString: function toString() { [native code] } }> | ScalePoint<{ toString: function toString() { [native code] } }> | ScaleLogarithmic | ScaleSymLog | ScalePower | ScaleTime | ScaleLinear; +colorScale?: ScaleOrdinal | ScaleOrdinal | ScaleSequential | ScaleThreshold | ScaleThreshold; +/** Indicate if the axis should be consider by a tooltip with `trigger='axis'`. */ +triggerTooltip?: boolean }; +axisId: AxisId; +axisValue: AxisValueT; +axisFormattedValue: string; +dataIndex: number; +seriesItems: SeriesItem[] } +``` + +### UseBarSeriesContextReturnValue + +```typescript +type UseBarSeriesContextReturnValue = SeriesProcessorResult<'bar'>; +``` + +### UseBarSeriesReturnValue + +```typescript +type UseBarSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'bar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * Defines how stacked series handle negative values. + * @default 'diverging' + */ + stackOffset?: StackOffsetType; + /** + * If provided, the function will be used to format the label of the bar. + * It can be set to 'value' to display the current value. + * @returns The formatted label. + */ + barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined); + /** + * The placement of the bar label. It accepts the following values: + * - 'center': the label is centered on the bar + * - 'outside': the label is placed after the end of the bar, from the point of the view of the origin. For a vertical positive bar, the label is above its top edge; for a horizontal negative bar, the label is placed to the left of its leftmost limit. + * @default 'center' + */ + barLabelPlacement?: 'center' | 'outside'; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** The id of this series. */ + id: string; + /** Data associated to each bar. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** + * Layout of the bars. All bar should have the same layout. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * If provided, the value will be used as the minimum size of the bar in pixels. + * This is useful to avoid bars with a size of 0. + * + * The property is ignored if the series value is `null` or `0`. + * It also doesn't work with stacked series. + * @default 0px + */ + minBarSize: number; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UseChartCartesianAxisSignature + +```typescript +type UseChartCartesianAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartCartesianAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartCartesianAxisDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartCartesianAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature, UseChartBrushSignature]; +}; +``` + +### UseChartClosestPointSignature + +```typescript +type UseChartClosestPointSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVoronoiParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVoronoiDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVoronoiInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVoronoiState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [ + UseChartInteractionSignature, + UseChartHighlightSignature, + UseChartTooltipSignature, + ]; +}; +``` + +### UseChartHighlightSignature + +```typescript +type UseChartHighlightSignature< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartHighlightParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartHighlightDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartHighlightInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartHighlightState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartInteractionSignature + +```typescript +type UseChartInteractionSignature = { + /** The raw properties that can be passed to the plugin. */ + params: {}; + /** The params after being processed with the default values. */ + defaultizedParams: {}; + /** An imperative api available for internal use. */ + instance: UseChartInteractionInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartInteractionState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartPolarAxisSignature + +```typescript +type UseChartPolarAxisSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartPolarAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartPolarAxisParameters; + /** An imperative api available for internal use. */ + instance: UseChartPolarAxisInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartPolarAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: [UseChartInteractionSignature]; +}; +``` + +### UseChartProExportSignature + +```typescript +type UseChartProExportSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProExportParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProExportParameters; + /** An imperative api available for internal use. */ + instance: UseChartProExportInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProExportState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProExportPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartProZoomSignature + +```typescript +type UseChartProZoomSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartProZoomParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartProZoomDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartProZoomInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartProZoomState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: UseChartProZoomPublicApi; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature, UseChartBrushSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartTooltipSignature + +```typescript +type UseChartTooltipSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartTooltipParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartTooltipDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartTooltipInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartTooltipState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartVisibilityManagerInstance + +```typescript +type UseChartVisibilityManagerInstance< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** Hide an item by its identifier. */ + hideItem: hideItem; + /** Show an item by its identifier. */ + showItem: showItem; + /** Toggle the visibility of an item by its identifier. */ + toggleItemVisibility: toggleItemVisibility; +}; +``` + +### UseChartVisibilityManagerParameters + +````typescript +type UseChartVisibilityManagerParameters< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: (hiddenItems: VisibilityIdentifierWithType[]) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: (VisibilityIdentifierWithType | VisibilityIdentifier)[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | VisibilityIdentifierWithType + | VisibilityIdentifier + )[]; +}; +```` + +### UseChartVisibilityManagerSignature + +```typescript +type UseChartVisibilityManagerSignature< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartVisibilityManagerParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartVisibilityManagerDefaultizedParameters; + /** An imperative api available for internal use. */ + instance: UseChartVisibilityManagerInstance; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartVisibilityManagerState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: [UseChartSeriesSignature]; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseChartZAxisSignature + +```typescript +type UseChartZAxisSignature = { + /** The raw properties that can be passed to the plugin. */ + params: UseChartZAxisParameters; + /** The params after being processed with the default values. */ + defaultizedParams: UseChartZAxisParameters; + /** An imperative api available for internal use. */ + instance: {}; + /** The state is the mutable data that will actually be stored in the plugin state and can be accessed by other plugins. */ + state: UseChartZAxisState; + /** + * The public imperative API that will be exposed to the user. + * Accessed through the `apiRef` property of the plugin. + */ + publicAPI: {}; + /** Any plugins that this plugin depends on. */ + dependencies: []; + /** Same as dependencies but the plugin might not have been initialized. */ + optionalDependencies: []; +}; +``` + +### UseFunnelSeriesContextReturnValue + +```typescript +type UseFunnelSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseFunnelSeriesReturnValue + +```typescript +type UseFunnelSeriesReturnValue = { + dataPoints: FunnelDataPoints[][]; + data: MakeRequired[]; + funnelDirection: 'increasing' | 'decreasing'; + /** The id of this series. */ + id: string; + type: 'funnel'; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The radius, in pixels, of the corners of the funnel sections. + * @default 8 + */ + borderRadius?: number; + /** + * Layout of the funnel. + * @default 'vertical' + */ + layout: 'horizontal' | 'vertical'; + /** + * The type of curve to use for the line. + * + * - `bump`: A curve that creates a smooth transition between points, with a bump in the middle. + * - `linear`: A straight line between points. + * - `linear-sharp`: A straight line between points, the smaller end of the funnel is a triangle. + * - `step`: A step line that creates a staircase effect. + * - `pyramid`: A pyramid shape that connects the points. + * - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape. + * + * Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation). + * @default 'linear' + */ + curve?: FunnelCurveType; + /** + * The label configuration for the funnel plot. + * Allows to customize the position and margin of the label that is displayed on the funnel sections. + * + * If set to `false`, the label will not be displayed. + * @default { vertical: 'middle', horizontal: 'center' } + */ + sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => false | FunnelLabelOptions) | false; + /** + * Defines if the funnel sections are filled or outlined. + * + * An `outlined` funnel will have a stroke around the sections and a translucent fill. + * A `filled` funnel will have a solid fill and no stroke. + * @default 'filled' + */ + variant?: 'filled' | 'outlined'; +}; +``` + +### UseHeatmapSeriesContextReturnValue + +```typescript +type UseHeatmapSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseHeatmapSeriesReturnValue + +```typescript +type UseHeatmapSeriesReturnValue = { + /** Maps the `xIndex` and `yIndex` to the corresponding value of the cell. */ + heatmapData: HeatmapData; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a heatmap value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => HeatmapValueType; + type: 'heatmap'; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of this series. */ + id: string; + /** + * Data associated to each cell in the heatmap. + * Each entry is a tuple [xIndex, yIndex, value]. + */ + data: HeatmapValueType[]; + /** + * Function that formats values to be displayed in a tooltip. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: ( + value: number | null, + context: { xIndex: number; yIndex: number }, + ) => string | null; +}; +``` + +### UseItemTooltipReturnValue + +```typescript +type UseItemTooltipReturnValue< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | HeatmapValueType + | ScatterValueType + | DefaultizedPieValueType + | MakeRequired + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### UseLineSeriesContextReturnValue + +```typescript +type UseLineSeriesContextReturnValue = SeriesProcessorResult<'line'>; +``` + +### UseLineSeriesReturnValue + +```typescript +type UseLineSeriesReturnValue = { + hidden: boolean; + /** The key used to retrieve data from the dataset. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the series value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => number | null; + type: 'line'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** + * The value of the line at the base of the series area. + * + * - `'min'` the area will fill the space **under** the line. + * - `'max'` the area will fill the space **above** the line. + * - `number` the area will fill the space between this value and the line + * @default 0 + */ + baseline?: number | 'min' | 'max'; + /** + * Defines how stacked series handle negative values. + * @default 'none' + */ + stackOffset?: StackOffsetType; + /** + * The key that identifies the stacking group. + * Series with the same `stack` property will be stacked together. + */ + stack?: string; + /** + * The order in which series' of the same group are stacked together. + * @default 'none' + */ + stackOrder?: StackOrderType; + /** If `true`, the series is rendered as an area instead of a line. */ + area?: boolean; + /** + * The type of curve to use for the line. + * Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation). + * @default 'monotoneX' + */ + curve?: CurveType; + /** + * If `true`, step curve starts and end at the first and last point. + * By default the line is extended to fill the space before and after. + */ + strictStepCurve?: boolean; + /** + * Define which items of the series should display a mark. + * If can be a boolean that applies to all items. + * Or a callback that gets some item properties and returns true if the item should be displayed. + */ + showMark?: boolean | ((params: ShowMarkParams) => boolean); + /** + * The shape of the mark elements. + * Using 'circle' renders a `` element, while all other options render a `` instead. The path causes a small decrease in performance. + * By default, each series has a different shape, cycling through `'circle'`, `'square'`, `'diamond'`, `'cross'`, `'star'`, `'triangle'`, `'wye'`. + * If there are more than 7 series, the shapes will repeat. + */ + shape?: MarkShape; + /** + * Do not render the line highlight item if set to `true`. + * @default false + */ + disableHighlight?: boolean; + /** + * If `true`, line and area connect points separated by `null` values. + * @default false + */ + connectNulls?: boolean; + /** The id of this series. */ + id: string; + /** Data associated to the line. */ + data: (number | null)[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + visibleStackedData: [number, number][]; + stackedData: [number, number][]; +}; +``` + +### UsePieSeriesContextReturnValue + +```typescript +type UsePieSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UsePieSeriesReturnValue + +```typescript +type UsePieSeriesReturnValue = { + data: DefaultizedPieValueType[]; + type: 'pie'; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * The x coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + * @default '50%' + */ + cx?: number | string; + /** + * The y coordinate of the pie center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + * @default '50%' + */ + cy?: number | string; + /** + * The start angle (deg) of the first item. + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg) of the last item. + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default 0 + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius between circle center and the arc label. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The sorting strategy used to order pie slices. + * Can be 'none', 'asc', 'desc', or a sorting function. + * @default 'none' + */ + sortingValues?: ChartsPieSorting; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + id?: PieItemId; + color: string; + labelMarkType?: ChartsLabelMarkType; + value: number; + formattedValue: string; + hidden: boolean; + label?: string; + }) => string); + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** Override the arc attributes when it is faded. */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** The id of this series. */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; +}; +``` + +### UseRadarAxisParams + +```typescript +type UseRadarAxisParams = { + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### UseRadarItemTooltipReturnValue + +```typescript +type UseRadarItemTooltipReturnValue = { + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; + values: ItemTooltipValue<'radar'>[]; +}; +``` + +### UseRadarSeriesContextReturnValue + +```typescript +type UseRadarSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseRadarSeriesReturnValue + +```typescript +type UseRadarSeriesReturnValue = { + hidden: boolean; + type: 'radar'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** The id of this series. */ + id: string; + data: number[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; +}; +``` + +### UseSankeySeriesContextReturnValue + +```typescript +type UseSankeySeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseSankeySeriesLayoutReturnValue + +```typescript +type UseSankeySeriesLayoutReturnValue = { sankeyLayout: SankeyLayout }; +``` + +### UseSankeySeriesReturnValue + +```typescript +type UseSankeySeriesReturnValue = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### UseScatterSeriesContextReturnValue + +```typescript +type UseScatterSeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseScatterSeriesReturnValue + +```typescript +type UseScatterSeriesReturnValue = { + preview: MakeRequired; + hidden: boolean; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return a scatter value. + * Can be used as an alternative to `datasetKeys`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => ScatterValueType; + type: 'scatter'; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; + /** The id of the z-axis used to render the series. */ + zAxisId?: string; + /** + * The keys used to retrieve data from the dataset. + * + * When this prop is provided, all of `x`, `y`, and `id` must be provided. + * While `z` is optional. + */ + datasetKeys?: { x: string; y: string; z?: string; id?: string }; + /** The id of this series. */ + id: string; + data: ScatterValueType[]; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter: SeriesValueFormatter; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color: string; + /** Size of the markers in the scatter plot, in pixels. */ + markerSize: number; +}; +``` + +### VisibilityIdentifier + +```typescript +type VisibilityIdentifier< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type?: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId?: string; + seriesId: string; +}; +``` + +### VisibilityIdentifierWithType + +```typescript +type VisibilityIdentifierWithType< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', +> = { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; +}; +``` + +### XAxis + +```typescript +type XAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'x'; + /** + * The minimum gap in pixels between two tick labels. + * If two tick labels are closer than this minimum gap, one of them will be hidden. + * @default 4 + */ + tickLabelMinGap?: number; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'top' | 'bottom' | 'none'; + /** + * The height of the axis. + * Set to `'auto'` to automatically calculate the height based on tick label measurements. + * @default 45 if an axis label is provided, 25 otherwise. + */ + height?: number | 'auto'; + zoom?: boolean | ZoomOptions; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### YAxis + +```typescript +type YAxis< + S extends 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear' = + | 'band' + | 'point' + | 'log' + | 'symlog' + | 'pow' + | 'sqrt' + | 'time' + | 'utc' + | 'linear', + V = any, +> = { + /** The data used by `'band'` and `'point'` scales. */ + data?: V[]; + /** The key used to retrieve `data` from the `dataset` prop. */ + dataKey?: string; + /** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => V; + colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig; + /** + * Formats the axis value. + * @returns The string to display. + */ + valueFormatter?: ( + value: V, + context: AxisValueFormatterContext, + ) => string; + /** The label of the axis. */ + label?: string; + axis?: 'y'; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If true, the axis line is disabled. + * @default false + */ + disableLine?: boolean; + /** + * If true, the ticks are disabled. + * @default false + */ + disableTicks?: boolean; + /** The style applied to ticks text. */ + tickLabelStyle?: ChartsTextStyle; + /** The style applied to the axis label. */ + labelStyle?: ChartsTextStyle; + /** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ + tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); + /** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ + tickSpacing?: number; + /** + * The size of the ticks. + * @default 6 + */ + tickSize?: number; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: Partial; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: Partial; + sx?: SxProps; + /** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMaxStep?: number; + /** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ + tickMinStep?: number; + /** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ + tickNumber?: number; + /** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ + tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; + /** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ + tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; + /** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ + tickLabelPlacement?: 'middle' | 'tick'; + /** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ + offset?: number; + scaleType?: 'band' | 'point' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; + /** If `true`, hide this value in the tooltip */ + hideTooltip?: boolean; + /** If `true`, Reverse the axis scaleBand. */ + reverse?: boolean; + /** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ + domainLimit?: + | 'nice' + | 'strict' + | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); + /** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ + ignoreTooltip?: boolean; + /** + * Position of the axis. + * + * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data. + * + * Set to 'none' to hide the axis. + * + * The first axis in the list will always have a default position. + */ + position?: 'left' | 'right' | 'none'; + zoom?: boolean | ZoomOptions; + /** + * The width of the axis. + * Set to `'auto'` to automatically calculate the width based on tick label measurements. + * @default 65 if an axis label is provided, 45 otherwise. + */ + width?: number | 'auto'; + /** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ + id?: AxisId; +}; +``` + +### yellowPaletteDark + +```typescript +type yellowPaletteDark = string[]; +``` + +### yellowPaletteLight + +```typescript +type yellowPaletteLight = string[]; +``` + +### ZoomData + +```typescript +type ZoomData = { + /** The id of the zoomed axis. */ + axisId: AxisId; + /** The starting percentage of the zoom range. In the range of 0 to 100. */ + start: number; + /** The ending percentage of the zoom range. In the range of 0 to 100. */ + end: number; +}; +``` + +### ZoomFilterMode + +```typescript +type ZoomFilterMode = 'keep' | 'discard'; +``` + +### ZoomOptions + +```typescript +type ZoomOptions = { + /** + * The starting percentage of the zoom range. In the range of 0 to 100. + * @default 0 + */ + minStart?: number; + /** + * The ending percentage of the zoom range. In the range of 0 to 100. + * @default 100 + */ + maxEnd?: number; + /** + * The step size of the zooming function. Defines the granularity of the zoom. + * @default 5 + */ + step?: number; + /** + * Restricts the minimum span size in the range of 0 to 100. + * + * If the span size is smaller than the minSpan, the span will be resized to the minSpan. + * @default 10 + */ + minSpan?: number; + /** + * Restricts the maximum span size in the range of 0 to 100. + * + * If the span size is larger than the maxSpan, the span will be resized to the maxSpan. + * @default 100 + */ + maxSpan?: number; + /** + * Set to `false` to disable panning. Useful when you want to pan programmatically, + * or to show only a specific section of the chart. + * @default true + */ + panning?: boolean; + /** + * Defines how to filter the axis data when it is outside of the zoomed range of this axis. + * + * - `keep`: The data outside the zoomed range is kept. And the other axes will stay the same. + * - `discard`: The data outside the zoomed range is discarded for the other axes. + * The other axes will be adjusted to fit the zoomed range. + * @default 'keep' + */ + filterMode?: ZoomFilterMode; + /** Configures the zoom slider. The slider is an element that shows the zoomed range and allows its manipulation. */ + slider?: ZoomSliderOptions; +}; +``` + +### ZoomSliderOptions + +```typescript +type ZoomSliderOptions = { + /** If `true`, the slider will be shown. */ + enabled?: boolean; + /** + * The size reserved for the zoom slider. The actual size of the slider might be smaller, so + * increasing this value effectively increases the margin around the slider. + * This means the height for the x-axis and the width for the y-axis. + * @default 48 if preview is enabled, 28 otherwise. + */ + size?: number; + /** + * Defines when the tooltip with the zoom values should be shown. + * - 'always': The tooltip is always shown. + * - 'hover': The tooltip is shown when hovering over the track or thumb. + * - 'never': The tooltip is never shown. + * @default 'hover' + */ + showTooltip?: ZoomSliderShowTooltip; + /** + * If `true`, a preview of the chart will be shown in the slider. + * Can also be an object to configure which series are shown in the preview. + */ + preview?: boolean | ZoomSliderPreviewOptions; +}; +``` + +### ZoomSliderShowTooltip + +```typescript +type ZoomSliderShowTooltip = 'always' | 'hover' | 'never'; +``` + +## External Types + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + barItemIdentifier: { type: 'bar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; +}) => { + identifier: { type: 'pie'; seriesId: string; dataIndex: number }; + color: string; + label: string | undefined; + value: unknown; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { pie?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; + seriesLayout: { pie?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + type: 'pie'; + data: unknown; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id?: string | undefined; + valueFormatter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + color?: string | undefined; + colorGetter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => unknown; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: { + type: 'pie'; + seriesId: string; + dataIndex: number; +}) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: { type: 'pie'; seriesId: string; dataIndex: number }) => { + type: 'pie'; + seriesId: string; + dataIndex: number; +}; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = ( + state: unknown, + point: { x: number; y: number }, +) => { type: 'pie'; seriesId: string; dataIndex: number } | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | null + | undefined, + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number | undefined } | null, +) => unknown; +``` + +### SeriesValueFormatter + +```typescript +type SeriesValueFormatter = (value: number, context: { dataIndex: number }) => string | null; +``` + +### hideItem + +```typescript +type hideItem = (identifier: unknown) => void; +``` + +### showItem + +```typescript +type showItem = (identifier: unknown) => void; +``` + +### toggleItemVisibility + +```typescript +type toggleItemVisibility = ( + identifier: + | unknown + | { + type: 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey'; + seriesId: string; + }, +) => void; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### Exclude + +```typescript +type Exclude = 'band' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc' | 'linear'; +``` + +### TriggerOptions + +```typescript +type TriggerOptions = 'item' | 'axis' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.chart-print-export-options.ts b/docs/pages/x/api/charts/types.chart-print-export-options.ts new file mode 100644 index 0000000000000..28418fd5a39b8 --- /dev/null +++ b/docs/pages/x/api/charts/types.chart-print-export-options.ts @@ -0,0 +1,4 @@ +import { ChartPrintExportOptions } from '@mui/x-charts-pro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartPrintExportOptions = createTypes(import.meta.url, ChartPrintExportOptions); diff --git a/docs/pages/x/api/charts/types.charts-axis-highlight.md b/docs/pages/x/api/charts/types.charts-axis-highlight.md new file mode 100644 index 0000000000000..d2a6f3391770c --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-axis-highlight.md @@ -0,0 +1,560 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-axis-highlight.md' + +## API Reference + +### ChartsAxisHighlight + +Demos: + +- [Custom components](https://mui.com/x/react-charts/components/) + +API: + +- [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/) + +**ChartsAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :--- | :------------------------ | :------ | :---------- | +| x | `ChartsAxisHighlightType` | - | - | +| y | `ChartsAxisHighlightType` | - | - | + +## Additional Types + +### chartsAxisHighlightClasses + +```typescript +type chartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClasses + +```typescript +type ChartsAxisHighlightClasses = { + /** Styles applied to the root element. */ + root: string; +}; +``` + +### ChartsAxisHighlightClassKey + +```typescript +type ChartsAxisHighlightClassKey = 'root'; +``` + +### ChartsAxisHighlightPath + +```typescript +type ChartsAxisHighlightPath = StyledComponent< + MUIStyledCommonProps & { ownerState: { axisHighlight: ChartsAxisHighlightType } }, + Pick< + React.SVGProps, + | 'string' + | 'path' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'name' + | 'fill' + | 'values' + | 'suppressHydrationWarning' + | 'className' + | 'color' + | 'height' + | 'id' + | 'lang' + | 'max' + | 'media' + | 'method' + | 'min' + | 'nonce' + | 'part' + | 'target' + | 'type' + | 'width' + | 'role' + | 'tabIndex' + | 'crossOrigin' + | 'accentHeight' + | 'accumulate' + | 'additive' + | 'alignmentBaseline' + | 'allowReorder' + | 'alphabetic' + | 'amplitude' + | 'arabicForm' + | 'ascent' + | 'attributeName' + | 'attributeType' + | 'autoReverse' + | 'azimuth' + | 'baseFrequency' + | 'baselineShift' + | 'baseProfile' + | 'bbox' + | 'begin' + | 'bias' + | 'by' + | 'calcMode' + | 'capHeight' + | 'clip' + | 'clipPathUnits' + | 'clipRule' + | 'colorInterpolation' + | 'colorInterpolationFilters' + | 'colorProfile' + | 'colorRendering' + | 'contentScriptType' + | 'contentStyleType' + | 'cursor' + | 'cx' + | 'cy' + | 'd' + | 'decelerate' + | 'descent' + | 'diffuseConstant' + | 'direction' + | 'display' + | 'divisor' + | 'dominantBaseline' + | 'dur' + | 'dx' + | 'dy' + | 'edgeMode' + | 'elevation' + | 'enableBackground' + | 'end' + | 'exponent' + | 'externalResourcesRequired' + | 'fillOpacity' + | 'fillRule' + | 'filterRes' + | 'filterUnits' + | 'floodColor' + | 'floodOpacity' + | 'focusable' + | 'fontFamily' + | 'fontSize' + | 'fontSizeAdjust' + | 'fontStretch' + | 'fontStyle' + | 'fontVariant' + | 'fontWeight' + | 'format' + | 'fr' + | 'from' + | 'fx' + | 'fy' + | 'g1' + | 'g2' + | 'glyphName' + | 'glyphOrientationHorizontal' + | 'glyphOrientationVertical' + | 'glyphRef' + | 'gradientTransform' + | 'gradientUnits' + | 'hanging' + | 'horizAdvX' + | 'horizOriginX' + | 'href' + | 'ideographic' + | 'imageRendering' + | 'in2' + | 'in' + | 'intercept' + | 'k1' + | 'k2' + | 'k3' + | 'k4' + | 'k' + | 'kernelMatrix' + | 'kernelUnitLength' + | 'kerning' + | 'keyPoints' + | 'keySplines' + | 'keyTimes' + | 'lengthAdjust' + | 'letterSpacing' + | 'lightingColor' + | 'limitingConeAngle' + | 'local' + | 'markerEnd' + | 'markerHeight' + | 'markerMid' + | 'markerStart' + | 'markerUnits' + | 'markerWidth' + | 'maskContentUnits' + | 'maskUnits' + | 'mathematical' + | 'mode' + | 'numOctaves' + | 'offset' + | 'opacity' + | 'operator' + | 'order' + | 'orient' + | 'orientation' + | 'origin' + | 'overflow' + | 'overlinePosition' + | 'overlineThickness' + | 'paintOrder' + | 'panose1' + | 'pathLength' + | 'patternContentUnits' + | 'patternTransform' + | 'patternUnits' + | 'pointerEvents' + | 'points' + | 'pointsAtX' + | 'pointsAtY' + | 'pointsAtZ' + | 'preserveAlpha' + | 'preserveAspectRatio' + | 'primitiveUnits' + | 'r' + | 'radius' + | 'refX' + | 'refY' + | 'renderingIntent' + | 'repeatCount' + | 'repeatDur' + | 'requiredExtensions' + | 'requiredFeatures' + | 'restart' + | 'result' + | 'rotate' + | 'rx' + | 'ry' + | 'scale' + | 'seed' + | 'shapeRendering' + | 'slope' + | 'spacing' + | 'specularConstant' + | 'specularExponent' + | 'speed' + | 'spreadMethod' + | 'startOffset' + | 'stdDeviation' + | 'stemh' + | 'stemv' + | 'stitchTiles' + | 'stopColor' + | 'stopOpacity' + | 'strikethroughPosition' + | 'strikethroughThickness' + | 'stroke' + | 'strokeDasharray' + | 'strokeDashoffset' + | 'strokeLinecap' + | 'strokeLinejoin' + | 'strokeMiterlimit' + | 'strokeOpacity' + | 'strokeWidth' + | 'surfaceScale' + | 'systemLanguage' + | 'tableValues' + | 'targetX' + | 'targetY' + | 'textAnchor' + | 'textDecoration' + | 'textLength' + | 'textRendering' + | 'to' + | 'transform' + | 'u1' + | 'u2' + | 'underlinePosition' + | 'underlineThickness' + | 'unicode' + | 'unicodeBidi' + | 'unicodeRange' + | 'unitsPerEm' + | 'vAlphabetic' + | 'vectorEffect' + | 'version' + | 'vertAdvY' + | 'vertOriginX' + | 'vertOriginY' + | 'vHanging' + | 'vIdeographic' + | 'viewBox' + | 'viewTarget' + | 'visibility' + | 'vMathematical' + | 'widths' + | 'wordSpacing' + | 'writingMode' + | 'x1' + | 'x2' + | 'x' + | 'xChannelSelector' + | 'xHeight' + | 'xlinkActuate' + | 'xlinkArcrole' + | 'xlinkHref' + | 'xlinkRole' + | 'xlinkShow' + | 'xlinkTitle' + | 'xlinkType' + | 'xmlBase' + | 'xmlLang' + | 'xmlns' + | 'xmlnsXlink' + | 'xmlSpace' + | 'y1' + | 'y2' + | 'y' + | 'yChannelSelector' + | 'z' + | 'zoomAndPan' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'children' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'ref' + | 'key' + >, + {} +>; +``` + +### ChartsAxisHighlightProps + +```typescript +type ChartsAxisHighlightProps = { x?: ChartsAxisHighlightType; y?: ChartsAxisHighlightType }; +``` + +### ChartsAxisHighlightType + +```typescript +type ChartsAxisHighlightType = 'none' | 'line' | 'band'; +``` diff --git a/docs/pages/x/api/charts/types.charts-axis-highlight.ts b/docs/pages/x/api/charts/types.charts-axis-highlight.ts new file mode 100644 index 0000000000000..f4627df114af4 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-axis-highlight.ts @@ -0,0 +1,4 @@ +import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsAxisHighlight = createTypes(import.meta.url, ChartsAxisHighlight); diff --git a/docs/pages/x/api/charts/types.charts-axis-tooltip-content.md b/docs/pages/x/api/charts/types.charts-axis-tooltip-content.md new file mode 100644 index 0000000000000..c32758bcbe22c --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-axis-tooltip-content.md @@ -0,0 +1,2050 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-axis-tooltip-content.md' + +## API Reference + +### ChartsAxisTooltipContent + +**ChartsAxisTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | The sort in which series items are displayed in the tooltip. When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. | +| sx | `SxProps` | - | - | + +### ChartsItemTooltipContent + +**ChartsItemTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sx | `SxProps` | - | - | + +### ChartsTooltip + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| sort | `'none' \| 'desc' \| 'asc'` | `'none'` | Defines the sort order in which series items are displayed in the axis tooltip. When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. Only applies when `trigger='axis'`. | +| trigger | `'item' \| 'axis' \| 'none'` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'pointer' \| 'node' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### ChartsTooltipContainer + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltipContainer Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `TriggerOptions` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'pointer' \| 'node' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | +| children | `React.ReactNode` | - | - | + +### useAxesTooltip + +Returns the axes to display in the tooltip and the series item related to them. + +**useAxesTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| params | `UseAxesTooltipParams` | - | - | + +**useAxesTooltip Return Value:** + +```tsx +type ReturnValue = + | UseAxesTooltipReturnValue<'bar' | 'line' | 'scatter' | 'radar', string | number | Date>[] + | null; +``` + +### useItemTooltip + +Returns a config object when the tooltip contains a single item to display. +Some specific charts like radar need more complex structure. Use specific hook like `useRadarItemTooltip` for them. + +**useItemTooltip Return Value:** + +The tooltip item config + +```tsx +type ReturnValue = UseItemTooltipReturnValue<'bar' | 'line' | 'scatter' | 'pie'> | null; +``` + +### useRadarItemTooltip + +Contains an object per value with their content and the label of the associated metric. + +**useRadarItemTooltip Return Value:** + +The tooltip item configs + +```tsx +type ReturnValue = UseRadarItemTooltipReturnValue | null; +``` + +## Additional Types + +### ChartsAxisTooltipContentClasses + +```typescript +type ChartsAxisTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsAxisTooltipContentProps + +```typescript +type ChartsAxisTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; + /** + * The sort in which series items are displayed in the tooltip. + * When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### ChartsItemTooltipContentClasses + +```typescript +type ChartsItemTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsItemTooltipContentProps + +```typescript +type ChartsItemTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; +}; +``` + +### ChartsTooltipCell + +```typescript +type ChartsTooltipCell = StyledComponent< + Pick< + TypographyOwnProps & + CommonProps & + Omit< + React.DetailedHTMLProps, HTMLSpanElement>, + | 'color' + | 'children' + | 'style' + | 'className' + | 'sx' + | 'classes' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variant' + | 'variantMapping' + >, + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'title' + | 'ref' + | 'key' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'sx' + | 'classes' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variant' + | 'variantMapping' + > & + MUIStyledCommonProps & { component?: React.ElementType }, + {}, + {} +>; +``` + +### chartsTooltipClasses + +```typescript +type chartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClasses + +```typescript +type ChartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClassKey + +```typescript +type ChartsTooltipClassKey = 'root' | 'paper' | 'table' | 'row' | 'cell' | 'mark' | 'axisValueCell'; +``` + +### ChartsTooltipContainerClasses + +```typescript +type ChartsTooltipContainerClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipContainerProps + +```typescript +type ChartsTooltipContainerProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'pointer' | 'node' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + children?: React.ReactNode; +}; +``` + +### ChartsTooltipContainerSlotProps + +```typescript +type ChartsTooltipContainerSlotProps = {}; +``` + +### ChartsTooltipContainerSlots + +```typescript +type ChartsTooltipContainerSlots = {}; +``` + +### ChartsTooltipPaper + +```typescript +type ChartsTooltipPaper = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLDivElement>, + | 'ref' + | 'key' + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + >, + {} +>; +``` + +### ChartsTooltipProps + +```typescript +type ChartsTooltipProps = { + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'pointer' | 'node' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Defines the sort order in which series items are displayed in the axis tooltip. + * When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. + * Only applies when `trigger='axis'`. + * @default 'none' + */ + sort?: 'none' | 'desc' | 'asc'; +}; +``` + +### ChartsTooltipRow + +```typescript +type ChartsTooltipRow = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableRowElement>, + | 'ref' + | 'key' + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + >, + {} +>; +``` + +### ChartsTooltipSlotProps + +```typescript +type ChartsTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial>; +}; +``` + +### ChartsTooltipSlots + +```typescript +type ChartsTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ChartsTooltipProps, + | 'symbol' + | 'object' + | 'table' + | 'mark' + | 'line' + | 'data' + | 'legend' + | 'circle' + | 'label' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipTable + +```typescript +type ChartsTooltipTable = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableElement>, + | 'ref' + | 'key' + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'summary' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'border' + | 'width' + | 'bgcolor' + | 'align' + | 'cellPadding' + | 'cellSpacing' + | 'frame' + | 'rules' + >, + {} +>; +``` + +### ItemTooltip + +```typescript +type ItemTooltip = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | ScatterValueType + | DefaultizedPieValueType + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### SeriesItem + +```typescript +type SeriesItem = { + seriesId: string; + color: string; + value: + | { open: number; high: number; low: number; close: number } + | number + | ScatterValueType + | null; + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string; + formattedLabel: string | null; + markType: ChartsLabelMarkType | undefined; + markShape: MarkShape | undefined; +}; +``` + +### UseAxesTooltipParams + +```typescript +type UseAxesTooltipParams = { + /** + * The axis directions to consider. + * If not defined, all directions are considered + */ + directions?: ('x' | 'y' | 'rotation')[]; +}; +``` + +### UseAxesTooltipReturnValue + +```typescript +type UseAxesTooltipReturnValue = { axisDirection: 'x' | 'y' | 'rotation' | 'radius'; +mainAxis: { /** The data used by `'band'` and `'point'` scales. */ +data?: any[]; +/** The label of the axis. */ +label?: string; +/** + * The props used for each component slot. + * @default {} + */ +slotProps?: Partial; +/** + * Overridable component slots. + * @default {} + */ +slots?: Partial; +/** A CSS class name applied to the root element. */ +className?: string; +/** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ +id: AxisId; +sx?: SxProps; +/** Override or extend the styles applied to the component. */ +classes?: Partial; +/** If `true`, Reverse the axis scaleBand. */ +reverse?: boolean; +/** + * If true, the axis line is disabled. + * @default false + */ +disableLine?: boolean; +/** + * If true, the ticks are disabled. + * @default false + */ +disableTicks?: boolean; +/** The style applied to ticks text. */ +tickLabelStyle?: ChartsTextStyle; +/** The style applied to the axis label. */ +labelStyle?: ChartsTextStyle; +/** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ +tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); +/** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ +tickSpacing?: number; +/** + * The size of the ticks. + * @default 6 + */ +tickSize?: number; +/** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMaxStep?: number; +/** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMinStep?: number; +/** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ +tickNumber?: number; +/** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ +tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; +/** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ +tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; +/** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ +tickLabelPlacement?: 'middle' | 'tick'; +colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig | { type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string); type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'piecewise'; thresholds: (number | Date)[]; colors: string[]; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] }; +/** The key used to retrieve `data` from the `dataset` prop. */ +dataKey?: string; +/** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ +valueGetter?: ((item: DatasetElementType) => any); +/** + * Formats the axis value. + * @returns The string to display. + */ +valueFormatter?: ((value: any, context: AxisValueFormatterContext) => string); +/** If `true`, hide this value in the tooltip */ +hideTooltip?: boolean; +/** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ +domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); +/** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ +ignoreTooltip?: boolean; +/** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ +offset?: number; +scaleType: 'time' | 'log' | 'linear' | 'symlog' | 'pow' | 'sqrt' | 'utc' | 'band' | 'point'; +scale: ScaleTime | ScaleLogarithmic | ScaleLinear | ScaleSymLog | ScalePower | ScaleBand<{ toString: function toString() { [native code] } }> | ScalePoint<{ toString: function toString() { [native code] } }>; +colorScale?: ScaleSequential | ScaleThreshold | ScaleThreshold | ScaleOrdinal | ScaleOrdinal; +/** Indicate if the axis should be consider by a tooltip with `trigger='axis'`. */ +triggerTooltip?: boolean }; +axisId: AxisId; +axisValue: AxisValueT; +axisFormattedValue: string; +dataIndex: number; +seriesItems: SeriesItem[] } +``` + +### UseItemTooltipReturnValue + +```typescript +type UseItemTooltipReturnValue = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | ScatterValueType + | DefaultizedPieValueType + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### UseRadarItemTooltipReturnValue + +```typescript +type UseRadarItemTooltipReturnValue = { + /** The series mark shape. */ + markShape?: MarkShape; + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + values: ItemTooltipValue<'radar'>[]; +}; +``` + +## External Types + +### MarkShape + +```typescript +type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### TriggerOptions + +```typescript +type TriggerOptions = 'item' | 'axis' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.charts-axis-tooltip-content.ts b/docs/pages/x/api/charts/types.charts-axis-tooltip-content.ts new file mode 100644 index 0000000000000..e997a21c635e3 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-axis-tooltip-content.ts @@ -0,0 +1,4 @@ +import { ChartsAxisTooltipContent } from '@mui/x-charts/ChartsTooltip'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsAxisTooltipContent = createTypes(import.meta.url, ChartsAxisTooltipContent); diff --git a/docs/pages/x/api/charts/types.charts-axis.md b/docs/pages/x/api/charts/types.charts-axis.md new file mode 100644 index 0000000000000..03531ba89d055 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-axis.md @@ -0,0 +1,181 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-axis.md' + +## API Reference + +### ChartsAxis + +Demos: + +- [Axis](https://mui.com/x/react-charts/axis/) + +API: + +- [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/) + +**ChartsAxis Props:** + +| Prop | Type | Default | Description | +| :-------- | :-------------------- | :------ | :-------------------------------------- | +| slotProps | `ChartsAxisSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsAxisSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### axisClasses + +```typescript +type axisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### ChartsAxisClasses + +```typescript +type ChartsAxisClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the main line element. */ + line: string; + /** Styles applied to group including the tick and its label. */ + tickContainer: string; + /** Styles applied to ticks. */ + tick: string; + /** + * Styles applied to ticks label. + * + * ⚠️ For performance reasons, only the inline styles get considered for bounding box computation. + * Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. + */ + tickLabel: string; + /** Styles applied to the group containing the axis label. */ + label: string; + /** Styles applied to x-axes. */ + directionX: string; + /** Styles applied to y-axes. */ + directionY: string; + /** Styles applied to the top axis. */ + top: string; + /** Styles applied to the bottom axis. */ + bottom: string; + /** Styles applied to the left axis. */ + left: string; + /** Styles applied to the right axis. */ + right: string; +}; +``` + +### ChartsAxisClassKey + +```typescript +type ChartsAxisClassKey = + | 'root' + | 'line' + | 'tickContainer' + | 'tick' + | 'tickLabel' + | 'label' + | 'directionX' + | 'directionY' + | 'top' + | 'bottom' + | 'left' + | 'right'; +``` + +### ChartsAxisProps + +```typescript +type ChartsAxisProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsAxisSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsAxisSlotProps; +}; +``` + +### ChartsAxisSlotProps + +```typescript +type ChartsAxisSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; +}; +``` + +### ChartsAxisSlots + +```typescript +type ChartsAxisSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; +}; +``` diff --git a/docs/pages/x/api/charts/types.charts-axis.ts b/docs/pages/x/api/charts/types.charts-axis.ts new file mode 100644 index 0000000000000..36e8a2014a62d --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-axis.ts @@ -0,0 +1,4 @@ +import { ChartsAxis } from '@mui/x-charts/ChartsAxis'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsAxis = createTypes(import.meta.url, ChartsAxis); diff --git a/docs/pages/x/api/charts/types.charts-brush-overlay.md b/docs/pages/x/api/charts/types.charts-brush-overlay.md new file mode 100644 index 0000000000000..d7d2461064232 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-brush-overlay.md @@ -0,0 +1,62 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-brush-overlay.md' + +## API Reference + +### ChartsBrushOverlay + +Component that renders visual feedback during brush interaction + +**ChartsBrushOverlay Props:** + +| Prop | Type | Default | Description | +| :-------- | :------- | :------ | :-------------------------------------------- | +| className | `string` | - | A CSS class name applied to the root element. | + +## Additional Types + +### brushOverlayClasses + +```typescript +type brushOverlayClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the brush lines. */ + rect: string; + /** Styles applied when the brush is selecting the x axis. */ + x: string; + /** Styles applied when the brush is selecting the y axis. */ + y: string; +}; +``` + +### BrushOverlayClasses + +```typescript +type BrushOverlayClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the brush lines. */ + rect: string; + /** Styles applied when the brush is selecting the x axis. */ + x: string; + /** Styles applied when the brush is selecting the y axis. */ + y: string; +}; +``` + +### BrushOverlayClassKey + +```typescript +type BrushOverlayClassKey = 'root' | 'rect' | 'x' | 'y'; +``` + +### ChartsBrushOverlayProps + +```typescript +type ChartsBrushOverlayProps = { + /** A CSS class name applied to the root element. */ + className?: string; +}; +``` diff --git a/docs/pages/x/api/charts/types.charts-brush-overlay.ts b/docs/pages/x/api/charts/types.charts-brush-overlay.ts new file mode 100644 index 0000000000000..f60246694de2e --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-brush-overlay.ts @@ -0,0 +1,4 @@ +import { ChartsBrushOverlay } from '@mui/x-charts/ChartsBrushOverlay'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsBrushOverlay = createTypes(import.meta.url, ChartsBrushOverlay); diff --git a/docs/pages/x/api/charts/types.charts-clip-path.md b/docs/pages/x/api/charts/types.charts-clip-path.md new file mode 100644 index 0000000000000..705d6e0409ae4 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-clip-path.md @@ -0,0 +1,35 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-clip-path.md' + +## API Reference + +### ChartsClipPath + +API: + +- [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/) + +**ChartsClipPath Props:** + +| Prop | Type | Default | Description | +| :----- | :----------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| offset | `{ top?: number; right?: number; bottom?: number; left?: number }` | - | Offset, in pixels, of the clip path rectangle from the drawing area. A positive value will move the rectangle outside the drawing area. | +| id\* | `string` | - | The id of the clip path. | + +## Additional Types + +### ChartsClipPathProps + +```typescript +type ChartsClipPathProps = { + /** The id of the clip path. */ + id: string; + /** + * Offset, in pixels, of the clip path rectangle from the drawing area. + * + * A positive value will move the rectangle outside the drawing area. + */ + offset?: { top?: number; right?: number; bottom?: number; left?: number }; +}; +``` diff --git a/docs/pages/x/api/charts/types.charts-clip-path.ts b/docs/pages/x/api/charts/types.charts-clip-path.ts new file mode 100644 index 0000000000000..848f58004e11c --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-clip-path.ts @@ -0,0 +1,4 @@ +import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsClipPath = createTypes(import.meta.url, ChartsClipPath); diff --git a/docs/pages/x/api/charts/types.charts-container-premium.md b/docs/pages/x/api/charts/types.charts-container-premium.md new file mode 100644 index 0000000000000..59813872f5b8e --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-container-premium.md @@ -0,0 +1,199 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-container-premium.md' + +## API Reference + +### ChartsContainerPremium + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPremium` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPremium API](https://mui.com/x/api/charts/charts-container-premium/) + +**ChartsContainerPremium Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| RangeBarSeriesType \| OHLCSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'rangeBar' \| 'ohlc' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +## Additional Types + +### ChartsContainerPremiumProps + +```typescript +type ChartsContainerPremiumProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsContainerPremiumSlotProps + +```typescript +type ChartsContainerPremiumSlotProps = {}; +``` + +### ChartsContainerPremiumSlots + +```typescript +type ChartsContainerPremiumSlots = {}; +``` + +## External Types + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` diff --git a/docs/pages/x/api/charts/types.charts-container-premium.ts b/docs/pages/x/api/charts/types.charts-container-premium.ts new file mode 100644 index 0000000000000..a275308d97529 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-container-premium.ts @@ -0,0 +1,4 @@ +import { ChartsContainerPremium } from '@mui/x-charts-premium/ChartsContainerPremium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsContainerPremium = createTypes(import.meta.url, ChartsContainerPremium); diff --git a/docs/pages/x/api/charts/types.charts-container-pro.md b/docs/pages/x/api/charts/types.charts-container-pro.md new file mode 100644 index 0000000000000..6ccbe34e56009 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-container-pro.md @@ -0,0 +1,161 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-container-pro.md' + +## API Reference + +### ChartsContainerPro + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProviderPro` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/) + +**ChartsContainerPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(BarSeriesType \| HeatmapSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +## Additional Types + +### ChartProApi + +```typescript +type ChartProApi< + ChartType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'composition' + | undefined = undefined, + Signatures extends ChartAnyPluginSignature[] = {}, +> = ChartProApiOriginal; +``` + +### ChartsContainerProProps + +```typescript +type ChartsContainerProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & ChartsSurfaceProps; +``` + +### ChartsContainerProSlotProps + +```typescript +type ChartsContainerProSlotProps = {}; +``` + +### ChartsContainerProSlots + +```typescript +type ChartsContainerProSlots = {}; +``` + +## External Types + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` diff --git a/docs/pages/x/api/charts/types.charts-container-pro.ts b/docs/pages/x/api/charts/types.charts-container-pro.ts new file mode 100644 index 0000000000000..4cda0205b57ef --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-container-pro.ts @@ -0,0 +1,4 @@ +import { ChartsContainerPro } from '@mui/x-charts-pro/ChartsContainerPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsContainerPro = createTypes(import.meta.url, ChartsContainerPro); diff --git a/docs/pages/x/api/charts/types.charts-container.md b/docs/pages/x/api/charts/types.charts-container.md new file mode 100644 index 0000000000000..f835894178834 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-container.md @@ -0,0 +1,242 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-container.md' + +## API Reference + +### ChartsContainer + +It sets up the data providers as well as the `` for the chart. + +This is a combination of both the `ChartsDataProvider` and `ChartsSurface` components. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsContainer API](https://mui.com/x/api/charts/charts-container/) + +**ChartsContainer Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableHitArea | `boolean` | - | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `(VisibilityIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| VisibilityIdentifier<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `HighlightItemIdentifier<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| HighlightItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `(VisibilityIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| VisibilityIdentifier<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: (VisibilityIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'>)[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: HighlightItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking close to an item. This is only available for scatter plot for now. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radiusAxis | `(AxisConfig<'linear', any, ChartsRadiusAxisProps>)[]` | - | The configuration of the radial-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| rotationAxis | `RotationAxis[]` | - | The configuration of the rotation-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| series | `(BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `SeriesItemIdentifier<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| SeriesItemIdentifierWithType<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'> \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +## Additional Types + +### ChartsContainerProps + +```typescript +type ChartsContainerProps< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartCartesianAxisSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartPolarAxisSignature, + UseChartTooltipSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartInteractionSignature, + UseChartHighlightSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartVisibilityManagerSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartClosestPointSignature, + UseChartKeyboardNavigationSignature + >, +> = { + /** Array of plugins used to add features to the chart. */ + plugins?: [] | [ChartPlugin]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: ChartSeriesConfig & ChartSeriesConfig; + /** Localized text for chart components. */ + localeText?: Partial; + /** Slots to customize charts' components. */ + slots?: Partial; + /** The props for the slots. */ + slotProps?: Partial; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: number | Partial; + /** + * The array of series to display. + * Each type of series has its own specificity. + * Please refer to the appropriate docs page to learn more about it. + */ + series?: ( + | BarSeriesType + | LineSeriesType + | ScatterSeriesType + | PieSeriesType> + | RadarSeriesType + )[]; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: {} | LineExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + className?: string; + sx?: SxProps; + children?: React.ReactNode; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; +}; +``` + +### ChartsContainerSlotProps + +```typescript +type ChartsContainerSlotProps = { + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ChartsContainerSlots + +```typescript +type ChartsContainerSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` + +## External Types + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: any; + params: any; + store: { state: any; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.charts-container.ts b/docs/pages/x/api/charts/types.charts-container.ts new file mode 100644 index 0000000000000..b12f76bbefd3c --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-container.ts @@ -0,0 +1,4 @@ +import { ChartsContainer } from '@mui/x-charts/ChartsContainer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsContainer = createTypes(import.meta.url, ChartsContainer); diff --git a/docs/pages/x/api/charts/types.charts-data-provider-premium.md b/docs/pages/x/api/charts/types.charts-data-provider-premium.md new file mode 100644 index 0000000000000..6c3cbfe5d655b --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-data-provider-premium.md @@ -0,0 +1,677 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-data-provider-premium.md' + +## API Reference + +### ChartsDataProviderPremium + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPremium API](https://mui.com/x/api/charts/charts-data-provider-premium/) + +**ChartsDataProviderPremium Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| RangeBarSeriesType \| OHLCSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'rangeBar' \| 'ohlc' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +## Additional Types + +### ChartsDataProviderPremiumProps + +```typescript +type ChartsDataProviderPremiumProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartPolarAxisSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartHighlightSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartVisibilityManagerSignature< + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'rangeBar' + | 'ohlc' + | 'heatmap' + | 'funnel' + | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderPremiumSlotProps + +```typescript +type ChartsDataProviderPremiumSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderPremiumSlots + +```typescript +type ChartsDataProviderPremiumSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### defaultSeriesConfigPremium + +```typescript +type defaultSeriesConfigPremium = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + rangeBar: ChartSeriesTypeConfig<'rangeBar'>; + ohlc: ChartSeriesTypeConfig<'ohlc'>; +}; +``` + +## External Types + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; +}) => { + identifier: { type: 'pie'; seriesId: string; dataIndex: number }; + color: string; + label: string | undefined; + value: unknown; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { pie?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; + seriesLayout: { pie?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + type: 'pie'; + data: unknown; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id?: string | undefined; + valueFormatter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + color?: string | undefined; + colorGetter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => unknown; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: { + type: 'pie'; + seriesId: string; + dataIndex: number; +}) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: { type: 'pie'; seriesId: string; dataIndex: number }) => { + type: 'pie'; + seriesId: string; + dataIndex: number; +}; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = ( + state: unknown, + point: { x: number; y: number }, +) => { type: 'pie'; seriesId: string; dataIndex: number } | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | null + | undefined, + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number | undefined } | null, +) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.charts-data-provider-premium.ts b/docs/pages/x/api/charts/types.charts-data-provider-premium.ts new file mode 100644 index 0000000000000..3c8b278753684 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-data-provider-premium.ts @@ -0,0 +1,4 @@ +import { ChartsDataProviderPremium } from '@mui/x-charts-premium/ChartsDataProviderPremium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsDataProviderPremium = createTypes(import.meta.url, ChartsDataProviderPremium); diff --git a/docs/pages/x/api/charts/types.charts-data-provider-pro.md b/docs/pages/x/api/charts/types.charts-data-provider-pro.md new file mode 100644 index 0000000000000..69fd66b096d43 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-data-provider-pro.md @@ -0,0 +1,618 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-data-provider-pro.md' + +## API Reference + +### ChartsDataProviderPro + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +API: + +- [ChartsDataProviderPro API](https://mui.com/x/api/charts/charts-data-provider-pro/) + +**ChartsDataProviderPro Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(HeatmapSeriesType \| BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType \| FunnelSeriesType \| SankeySeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar' \| 'heatmap' \| 'funnel' \| 'sankey'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `{ baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; baseDivider?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; orientation?: 'horizontal' \| 'vertical' }; baseMenuItem?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { autoFocus?: boolean; children?: React.ReactNode; inert?: boolean; dense?: boolean; disabled?: boolean; iconStart?: React.ReactNode; iconEnd?: React.ReactNode; selected?: boolean; value?: number \| string \| string[]; style?: React.CSSProperties }; baseMenuList?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; children?: React.ReactNode; autoFocus?: boolean; autoFocusItem?: boolean }; basePopper?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; open: boolean; children?: React.ReactNode; clickAwayTouchEvent?: false \| ClickAwayTouchEventHandler; clickAwayMouseEvent?: false \| ClickAwayMouseEventHandler; flip?: boolean; focusTrap?: boolean; onExited?: ((node: HTMLElement \| null) => void); onClickAway?: ((event: MouseEvent \| TouchEvent) => void); onDidShow?: (() => void); onDidHide?: (() => void); id?: string; target?: Element \| null; transition?: boolean; placement?: Placement }; baseTooltip?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { children: ReactElement; enterDelay?: number; title: React.ReactNode; disableInteractive?: boolean }; baseButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; baseIconButton?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number; size?: 'small' \| 'medium' \| 'large' }; zoomInIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; zoomOutIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' }; exportIcon?: React.DOMAttributes & { className?: string; style?: React.CSSProperties } & { titleAccess?: string; fontSize?: 'small' \| 'medium' \| 'large' \| 'inherit' } }` | - | The props for the slots. | +| slots | `{ baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; baseDivider?: React.ComponentType; baseMenuItem?: React.ComponentType; baseMenuList?: React.ComponentType; basePopper?: React.ComponentType; baseTooltip?: React.ComponentType; baseButton?: React.ComponentType; baseIconButton?: React.ComponentType; zoomInIcon?: React.ComponentType; zoomOutIcon?: React.ComponentType; exportIcon?: React.ComponentType }` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +## Additional Types + +### ChartsDataProviderProProps + +```typescript +type ChartsDataProviderProProps< + SeriesType extends + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' = 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartTooltipSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartInteractionSignature, + UseChartCartesianAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartPolarAxisSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartHighlightSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + >, + UseChartProZoomSignature, + UseChartProExportSignature, + UseChartVisibilityManagerSignature< + 'bar' | 'line' | 'scatter' | 'pie' | 'radar' | 'heatmap' | 'funnel' | 'sankey' + > + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + } & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderProSlotProps + +```typescript +type ChartsDataProviderProSlotProps = { + baseDivider: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### ChartsDataProviderProSlots + +```typescript +type ChartsDataProviderProSlots = { + baseDivider: React.ComponentType; + baseMenuItem: React.ComponentType; + baseMenuList: React.ComponentType; + basePopper: React.ComponentType; + baseTooltip: React.ComponentType; + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon: React.ComponentType; +}; +``` + +### defaultSeriesConfigPro + +```typescript +type defaultSeriesConfigPro = { + bar: ChartSeriesTypeConfig<'bar'>; + line: ChartSeriesTypeConfig<'line'>; + scatter: ChartSeriesTypeConfig<'scatter'>; + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + /** A processor to add series layout when the layout does not depend from other series. */ + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + /** + * A function to serialize the series item identifier into a unique string. + * @returns A unique string representation of the identifier. + */ + identifierSerializer: IdentifierSerializer<'pie'>; + /** + * A function to clean a series item identifier, returning only the properties + * relevant to the series type. + * @returns A cleaned identifier with only the relevant properties. + */ + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; +}; +``` + +## External Types + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: unknown; + type: 'pie'; + color?: string | undefined; + colorGetter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; +}) => { + identifier: { type: 'pie'; seriesId: string; dataIndex: number }; + color: string; + label: string | undefined; + value: unknown; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { pie?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; + seriesLayout: { pie?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + type: 'pie'; + data: unknown; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id?: string | undefined; + valueFormatter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + color?: string | undefined; + colorGetter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => unknown; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: { + type: 'pie'; + seriesId: string; + dataIndex: number; +}) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: { type: 'pie'; seriesId: string; dataIndex: number }) => { + type: 'pie'; + seriesId: string; + dataIndex: number; +}; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = ( + state: unknown, + point: { x: number; y: number }, +) => { type: 'pie'; seriesId: string; dataIndex: number } | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | null + | undefined, + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number | undefined } | null, +) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.charts-data-provider-pro.ts b/docs/pages/x/api/charts/types.charts-data-provider-pro.ts new file mode 100644 index 0000000000000..2de9730a9e7a9 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-data-provider-pro.ts @@ -0,0 +1,4 @@ +import { ChartsDataProviderPro } from '@mui/x-charts-pro/ChartsDataProviderPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsDataProviderPro = createTypes(import.meta.url, ChartsDataProviderPro); diff --git a/docs/pages/x/api/charts/types.charts-data-provider.md b/docs/pages/x/api/charts/types.charts-data-provider.md new file mode 100644 index 0000000000000..12349d70633a3 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-data-provider.md @@ -0,0 +1,118 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-data-provider.md' + +## API Reference + +### ChartsDataProvider + +Orchestrates the data providers for the chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/react-charts/composition/) + +API: + +- [ChartsDataProvider API](https://mui.com/x/api/charts/charts-data-provider/) + +**ChartsDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| experimentalFeatures | `LineExperimentalFeatures \| {}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `ConvertSignaturesIntoPlugins` | - | Array of plugins used to add features to the chart. | +| series | `(BarSeriesType \| LineSeriesType \| ScatterSeriesType \| PieSeriesType> \| RadarSeriesType)[]` | - | The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it. | +| seriesConfig | `ChartSeriesConfig & ChartSeriesConfig<'bar' \| 'line' \| 'scatter' \| 'pie' \| 'radar'>` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | + +## Additional Types + +### ChartsDataProviderProps + +```typescript +type ChartsDataProviderProps< + SeriesType extends 'bar' | 'line' | 'scatter' | 'pie' | 'radar' = + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar', + TSignatures extends ChartAnyPluginSignature[] = AllPluginSignatures< + UseChartZAxisSignature, + UseChartBrushSignature, + UseChartCartesianAxisSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartPolarAxisSignature, + UseChartTooltipSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartInteractionSignature, + UseChartHighlightSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartVisibilityManagerSignature<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>, + UseChartClosestPointSignature, + UseChartKeyboardNavigationSignature + >, +> = UseChartBaseProps & + MergeSignaturesProperty< + [ + UseChartElementRefSignature, + UseChartIdSignature, + UseChartSeriesConfigSignature, + UseChartExperimentalFeaturesSignature, + UseChartDimensionsSignature, + UseChartSeriesSignature, + UseChartAnimationSignature, + UseChartInteractionListenerSignature, + TSignatures, + ], + 'params' + > & + Pick, 'plugins'> & + __type & + ChartsLocalizationProviderProps & { + slots?: Partial; + slotProps?: Partial; + }; +``` + +### ChartsDataProviderSlotProps + +```typescript +type ChartsDataProviderSlotProps = { + baseButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ChartsDataProviderSlots + +```typescript +type ChartsDataProviderSlots = { + baseButton: React.ComponentType; + baseIconButton: React.ComponentType; +}; +``` diff --git a/docs/pages/x/api/charts/types.charts-data-provider.ts b/docs/pages/x/api/charts/types.charts-data-provider.ts new file mode 100644 index 0000000000000..5ae65085e1ecc --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-data-provider.ts @@ -0,0 +1,4 @@ +import { ChartsDataProvider } from '@mui/x-charts/ChartsDataProvider'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsDataProvider = createTypes(import.meta.url, ChartsDataProvider); diff --git a/docs/pages/x/api/charts/types.charts-grid.ts b/docs/pages/x/api/charts/types.charts-grid.ts new file mode 100644 index 0000000000000..b5e0345bd1539 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-grid.ts @@ -0,0 +1,4 @@ +import { ChartsGrid } from '@mui/x-charts/ChartsGrid'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsGrid = createTypes(import.meta.url, ChartsGrid); diff --git a/docs/pages/x/api/charts/types.charts-item-tooltip-content.ts b/docs/pages/x/api/charts/types.charts-item-tooltip-content.ts new file mode 100644 index 0000000000000..ac9fb30afd8a8 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-item-tooltip-content.ts @@ -0,0 +1,4 @@ +import { ChartsItemTooltipContent } from '@mui/x-charts/ChartsTooltip'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsItemTooltipContent = createTypes(import.meta.url, ChartsItemTooltipContent); diff --git a/docs/pages/x/api/charts/types.charts-legend.md b/docs/pages/x/api/charts/types.charts-legend.md new file mode 100644 index 0000000000000..7d00e2c28a7a5 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-legend.md @@ -0,0 +1,631 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-legend.md' + +## API Reference + +### ChartsLegend + +**ChartsLegend Props:** + +| Prop | Type | Default | Description | +| :---------------------- | :----------------------------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | - | The direction of the legend layout. The default depends on the chart. | +| onItemClick | `((event: React.MouseEvent, legendItem: SeriesLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| toggleVisibilityOnClick | `boolean` | `false` | If `true`, clicking on a legend item will toggle the visibility of the corresponding series. | +| className | `string` | - | - | + +### ContinuousColorLegend + +**ContinuousColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------------------------------------- | :--------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| gradientId | `string` | `auto-generated id` | The id for the gradient to use. If not provided, it will use the generated gradient from the axis configuration. The `gradientId` will be used as `fill="url(#gradientId)"`. | +| labelPosition | `'start' \| 'end' \| 'extremes'` | `'end'` | Where to position the labels relative to the gradient. | +| maxLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the maximum side of the gradient. Can either be a string, or a function. If not defined, the formatted maximal value is display. | +| minLabel | `string \| LabelFormatter` | `formattedValue` | The label to display at the minimum side of the gradient. Can either be a string, or a function. | +| reverse | `boolean` | `false` | If `true`, the gradient and labels will be reversed. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| thickness | `number` | `12` | The thickness of the gradient | +| className | `string` | - | - | + +### piecewiseColorDefaultLabelFormatter + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| params | `PiecewiseLabelFormatterParams` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### PiecewiseColorLegend + +**PiecewiseColorLegend Props:** + +| Prop | Type | Default | Description | +| :------------- | :------------------------------------------------------------------------------------------------------------------------------- | :--------------------- | :------------------------------------------------------------------ | +| axisDirection | `'x' \| 'y' \| 'z'` | `'z'` | The axis direction containing the color configuration to represent. | +| axisId | `AxisId` | `The first axis item.` | The id of the axis item with the color configuration to represent. | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| direction | `Direction` | `'horizontal'` | The direction of the legend layout. | +| labelFormatter | `((params: PiecewiseLabelFormatterParams) => string \| null)` | - | Format the legend labels. | +| labelPosition | `'start' \| 'end' \| 'extremes' \| 'inline-start' \| 'inline-end'` | `'extremes'` | Where to position the labels relative to the color marks. | +| onItemClick | `((event: React.MouseEvent, legendItem: PiecewiseColorLegendItemContext, index: number) => void)` | - | Callback fired when a legend item is clicked. | +| slotProps | `ChartsLegendSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsLegendSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| tabIndex | `number` | - | - | +| className | `string` | - | - | + +## Additional Types + +### ChartsLegendClasses + +```typescript +type ChartsLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### ChartsLegendPosition + +```typescript +type ChartsLegendPosition = { + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; +}; +``` + +### ChartsLegendProps + +```typescript +type ChartsLegendProps = { + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * If `true`, clicking on a legend item will toggle the visibility of the corresponding series. + * @default false + */ + toggleVisibilityOnClick?: boolean; + className?: string; + sx?: SxProps; + tabIndex?: number; +}; +``` + +### ChartsLegendSlotExtension + +```typescript +type ChartsLegendSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsLegendSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsLegendSlotProps; +}; +``` + +### ChartsLegendSlotProps + +```typescript +type ChartsLegendSlotProps = { + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; +}; +``` + +### ChartsLegendSlots + +```typescript +type ChartsLegendSlots = { + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; +}; +``` + +### ColorLegendSelector + +```typescript +type ColorLegendSelector = { + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### continuousColorLegendClasses + +```typescript +type continuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendClasses + +```typescript +type ContinuousColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list item with the gradient. */ + gradient: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the gradient. */ + start: string; + /** Styles applied to the legend with the labels after the gradient. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the gradient. */ + extremes: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### ContinuousColorLegendProps + +```typescript +type ContinuousColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * The label to display at the minimum side of the gradient. + * Can either be a string, or a function. + * @default formattedValue + */ + minLabel?: string | LabelFormatter; + /** + * The label to display at the maximum side of the gradient. + * Can either be a string, or a function. + * If not defined, the formatted maximal value is display. + * @default formattedValue + */ + maxLabel?: string | LabelFormatter; + /** + * The id for the gradient to use. + * If not provided, it will use the generated gradient from the axis configuration. + * The `gradientId` will be used as `fill="url(#gradientId)"`. + * @default auto-generated id + */ + gradientId?: string; + /** + * Where to position the labels relative to the gradient. + * @default 'end' + */ + labelPosition?: 'start' | 'end' | 'extremes'; + /** + * If `true`, the gradient and labels will be reversed. + * @default false + */ + reverse?: boolean; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; + /** + * The thickness of the gradient + * @default 12 + */ + thickness?: number; +}; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### legendClasses + +```typescript +type legendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item around each series in the legend. */ + item: string; + /** Styles applied to a series element. */ + series: string; + /** Styles applied to hidden items. */ + hidden: string; + /** Styles applied to series mark element. */ + mark: string; + /** Styles applied to the series label. */ + label: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; +}; +``` + +### LegendItemContext + +```typescript +type LegendItemContext = SeriesLegendItemContext | PiecewiseColorLegendItemContext; +``` + +### LegendItemParams + +```typescript +type LegendItemParams = { + /** The type of the series */ + type: 'line' | 'bar' | 'scatter' | 'pie' | 'radar'; + markType: ChartsLabelMarkType | undefined; + /** The identifier of the series */ + seriesId?: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The minimum value of the category */ + minValue?: number | Date | null; + /** The maximum value of the category */ + maxValue?: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### piecewiseColorLegendClasses + +```typescript +type piecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendClasses + +```typescript +type PiecewiseColorLegendClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the list item that renders the `minLabel`. */ + minLabel: string; + /** Styles applied to the list item that renders the `maxLabel`. */ + maxLabel: string; + /** Styles applied to the list items. */ + item: string; + /** Styles applied to the legend in column layout. */ + vertical: string; + /** Styles applied to the legend in row layout. */ + horizontal: string; + /** Styles applied to the legend with the labels before the color marks. */ + start: string; + /** Styles applied to the legend with the labels after the color marks. */ + end: string; + /** Styles applied to the legend with the labels on the extremes of the color marks. */ + extremes: string; + /** Styles applied to the legend with the labels inlined before the color marks. */ + inlineStart: string; + /** Styles applied to the legend with the labels inlined after the color marks. */ + inlineEnd: string; + /** Styles applied to the marks. */ + mark: string; + /** Styles applied to the series label. */ + label: string; +}; +``` + +### PiecewiseColorLegendItemContext + +```typescript +type PiecewiseColorLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'piecewiseColor'; + /** The minimum value of the category */ + minValue: number | Date | null; + /** The maximum value of the category */ + maxValue: number | Date | null; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### PiecewiseColorLegendProps + +```typescript +type PiecewiseColorLegendProps = { + /** + * The direction of the legend layout. + * @default 'horizontal' + */ + direction?: Direction; + /** + * Format the legend labels. + * @returns The displayed label, `''` to skip the label but show the color mark, or `null` to skip it entirely. + */ + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + /** + * Where to position the labels relative to the color marks. + * @default 'extremes' + */ + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + /** Callback fired when a legend item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The axis direction containing the color configuration to represent. + * @default 'z' + */ + axisDirection?: 'x' | 'y' | 'z'; + /** + * The id of the axis item with the color configuration to represent. + * @default The first axis item. + */ + axisId?: AxisId; +}; +``` + +### PiecewiseLabelFormatterParams + +```typescript +type PiecewiseLabelFormatterParams = { + /** The index of the entry. */ + index: number; + /** The length of the entries array. */ + length: number; + /** The min value of the piece. `null` is infinite. */ + min: number | Date | null; + /** The max value of the piece. `null` is infinite. */ + max: number | Date | null; + /** The formatted min value of the piece. `null` is infinite. */ + formattedMin: string | null; + /** The formatted max value of the piece. `null` is infinite. */ + formattedMax: string | null; +}; +``` + +### SeriesLegendItemContext + +```typescript +type SeriesLegendItemContext = { + /** + * The type of the legend item + * - `series` is used for series legend item + * - `piecewiseColor` is used for piecewise color legend item + */ + type: 'series'; + /** The identifier of the series */ + seriesId: string; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +### SeriesLegendItemParams + +```typescript +type SeriesLegendItemParams = { + /** The identifier of the series */ + seriesId: string; + /** The type of the series */ + type: 'line' | 'bar' | 'scatter' | 'pie' | 'radar'; + markType: ChartsLabelMarkType | undefined; + markShape?: MarkShape; + /** The data index of the item in the series data array */ + dataIndex?: number; + /** The color used in the legend */ + color: string; + /** The label displayed in the legend */ + label: string; +}; +``` + +## External Types + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### MarkShape + +```typescript +type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; +``` diff --git a/docs/pages/x/api/charts/types.charts-legend.ts b/docs/pages/x/api/charts/types.charts-legend.ts new file mode 100644 index 0000000000000..6c8c92397d144 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-legend.ts @@ -0,0 +1,4 @@ +import { ChartsLegend } from '@mui/x-charts/ChartsLegend'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsLegend = createTypes(import.meta.url, ChartsLegend); diff --git a/docs/pages/x/api/charts/types.charts-localization-provider.ts b/docs/pages/x/api/charts/types.charts-localization-provider.ts new file mode 100644 index 0000000000000..436757f9e3518 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-localization-provider.ts @@ -0,0 +1,4 @@ +import { ChartsLocalizationProvider } from '@mui/x-charts/ChartsLocalizationProvider'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsLocalizationProvider = createTypes(import.meta.url, ChartsLocalizationProvider); diff --git a/docs/pages/x/api/charts/types.charts-reference-line.ts b/docs/pages/x/api/charts/types.charts-reference-line.ts new file mode 100644 index 0000000000000..5318ec159a5f3 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-reference-line.ts @@ -0,0 +1,4 @@ +import { ChartsReferenceLine } from '@mui/x-charts/ChartsReferenceLine'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsReferenceLine = createTypes(import.meta.url, ChartsReferenceLine); diff --git a/docs/pages/x/api/charts/types.charts-surface.ts b/docs/pages/x/api/charts/types.charts-surface.ts new file mode 100644 index 0000000000000..24a04346b0de2 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-surface.ts @@ -0,0 +1,4 @@ +import { ChartsSurface } from '@mui/x-charts/ChartsSurface'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsSurface = createTypes(import.meta.url, ChartsSurface); diff --git a/docs/pages/x/api/charts/types.charts-text.ts b/docs/pages/x/api/charts/types.charts-text.ts new file mode 100644 index 0000000000000..451185729d7ca --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-text.ts @@ -0,0 +1,4 @@ +import { ChartsText } from '@mui/x-charts/ChartsText'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsText = createTypes(import.meta.url, ChartsText); diff --git a/docs/pages/x/api/charts/types.charts-toolbar-image-export-trigger.ts b/docs/pages/x/api/charts/types.charts-toolbar-image-export-trigger.ts new file mode 100644 index 0000000000000..cdf4b0b1f14d9 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-toolbar-image-export-trigger.ts @@ -0,0 +1,4 @@ +import { ChartsToolbarImageExportTrigger } from '@mui/x-charts-pro/ChartsToolbarPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsToolbarImageExportTrigger = createTypes(import.meta.url, ChartsToolbarImageExportTrigger); diff --git a/docs/pages/x/api/charts/types.charts-toolbar-print-export-trigger.ts b/docs/pages/x/api/charts/types.charts-toolbar-print-export-trigger.ts new file mode 100644 index 0000000000000..0292b7c652e96 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-toolbar-print-export-trigger.ts @@ -0,0 +1,4 @@ +import { ChartsToolbarPrintExportTrigger } from '@mui/x-charts-pro/ChartsToolbarPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsToolbarPrintExportTrigger = createTypes(import.meta.url, ChartsToolbarPrintExportTrigger); diff --git a/docs/pages/x/api/charts/types.charts-toolbar-pro.ts b/docs/pages/x/api/charts/types.charts-toolbar-pro.ts new file mode 100644 index 0000000000000..a64ec7b5f6a22 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-toolbar-pro.ts @@ -0,0 +1,4 @@ +import { ChartsToolbarPro } from '@mui/x-charts-pro/ChartsToolbarPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsToolbarPro = createTypes(import.meta.url, ChartsToolbarPro); diff --git a/docs/pages/x/api/charts/types.charts-toolbar-zoom-in-trigger.ts b/docs/pages/x/api/charts/types.charts-toolbar-zoom-in-trigger.ts new file mode 100644 index 0000000000000..674d6e8a72225 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-toolbar-zoom-in-trigger.ts @@ -0,0 +1,4 @@ +import { ChartsToolbarZoomInTrigger } from '@mui/x-charts-pro/ChartsToolbarPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsToolbarZoomInTrigger = createTypes(import.meta.url, ChartsToolbarZoomInTrigger); diff --git a/docs/pages/x/api/charts/types.charts-toolbar-zoom-out-trigger.ts b/docs/pages/x/api/charts/types.charts-toolbar-zoom-out-trigger.ts new file mode 100644 index 0000000000000..9c695124d04ea --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-toolbar-zoom-out-trigger.ts @@ -0,0 +1,4 @@ +import { ChartsToolbarZoomOutTrigger } from '@mui/x-charts-pro/ChartsToolbarPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsToolbarZoomOutTrigger = createTypes(import.meta.url, ChartsToolbarZoomOutTrigger); diff --git a/docs/pages/x/api/charts/types.charts-tooltip-container.md b/docs/pages/x/api/charts/types.charts-tooltip-container.md new file mode 100644 index 0000000000000..1b7a732d1090a --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-tooltip-container.md @@ -0,0 +1,2050 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.charts-tooltip-container.md' + +## API Reference + +### ChartsAxisTooltipContent + +**ChartsAxisTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sort | `'none' \| 'asc' \| 'desc'` | `'none'` | The sort in which series items are displayed in the tooltip. When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. | +| sx | `SxProps` | - | - | + +### ChartsItemTooltipContent + +**ChartsItemTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------ | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| sx | `SxProps` | - | - | + +### ChartsTooltip + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| sort | `'none' \| 'desc' \| 'asc'` | `'none'` | Defines the sort order in which series items are displayed in the axis tooltip. When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. Only applies when `trigger='axis'`. | +| trigger | `'item' \| 'axis' \| 'none'` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'pointer' \| 'node' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### ChartsTooltipContainer + +Demos: + +- [ChartsTooltip](https://mui.com/x/react-charts/tooltip/) + +API: + +- [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/) + +**ChartsTooltipContainer Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `TriggerOptions` | `'axis'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse;'axis': Shows values associated with the hovered x value;'none': Does not display tooltip. | +| anchor | `'pointer' \| 'node' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | +| children | `React.ReactNode` | - | - | + +### useAxesTooltip + +Returns the axes to display in the tooltip and the series item related to them. + +**useAxesTooltip Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------- | :------ | :---------- | +| params | `UseAxesTooltipParams` | - | - | + +**useAxesTooltip Return Value:** + +```tsx +type ReturnValue = + | UseAxesTooltipReturnValue<'bar' | 'line' | 'scatter' | 'radar', string | number | Date>[] + | null; +``` + +### useItemTooltip + +Returns a config object when the tooltip contains a single item to display. +Some specific charts like radar need more complex structure. Use specific hook like `useRadarItemTooltip` for them. + +**useItemTooltip Return Value:** + +The tooltip item config + +```tsx +type ReturnValue = UseItemTooltipReturnValue<'bar' | 'line' | 'scatter' | 'pie'> | null; +``` + +### useRadarItemTooltip + +Contains an object per value with their content and the label of the associated metric. + +**useRadarItemTooltip Return Value:** + +The tooltip item configs + +```tsx +type ReturnValue = UseRadarItemTooltipReturnValue | null; +``` + +## Additional Types + +### ChartsAxisTooltipContentClasses + +```typescript +type ChartsAxisTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsAxisTooltipContentProps + +```typescript +type ChartsAxisTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; + /** + * The sort in which series items are displayed in the tooltip. + * When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value. + * @default 'none' + */ + sort?: 'none' | 'asc' | 'desc'; +}; +``` + +### ChartsItemTooltipContentClasses + +```typescript +type ChartsItemTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsItemTooltipContentProps + +```typescript +type ChartsItemTooltipContentProps = { + /** Override or extend the styles applied to the component. */ + classes?: Partial; + sx?: SxProps; +}; +``` + +### ChartsTooltipCell + +```typescript +type ChartsTooltipCell = StyledComponent< + Pick< + TypographyOwnProps & + CommonProps & + Omit< + React.DetailedHTMLProps, HTMLSpanElement>, + | 'color' + | 'children' + | 'style' + | 'className' + | 'sx' + | 'classes' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variant' + | 'variantMapping' + >, + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'title' + | 'ref' + | 'key' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'sx' + | 'classes' + | 'align' + | 'gutterBottom' + | 'noWrap' + | 'variant' + | 'variantMapping' + > & + MUIStyledCommonProps & { component?: React.ElementType }, + {}, + {} +>; +``` + +### chartsTooltipClasses + +```typescript +type chartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClasses + +```typescript +type ChartsTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipClassKey + +```typescript +type ChartsTooltipClassKey = 'root' | 'paper' | 'table' | 'row' | 'cell' | 'mark' | 'axisValueCell'; +``` + +### ChartsTooltipContainerClasses + +```typescript +type ChartsTooltipContainerClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### ChartsTooltipContainerProps + +```typescript +type ChartsTooltipContainerProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'pointer' | 'node' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + children?: React.ReactNode; +}; +``` + +### ChartsTooltipContainerSlotProps + +```typescript +type ChartsTooltipContainerSlotProps = {}; +``` + +### ChartsTooltipContainerSlots + +```typescript +type ChartsTooltipContainerSlots = {}; +``` + +### ChartsTooltipPaper + +```typescript +type ChartsTooltipPaper = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLDivElement>, + | 'ref' + | 'key' + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + >, + {} +>; +``` + +### ChartsTooltipProps + +```typescript +type ChartsTooltipProps = { + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse; + * - 'axis': Shows values associated with the hovered x value; + * - 'none': Does not display tooltip. + * @default 'axis' + */ + trigger?: 'item' | 'axis' | 'none'; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'pointer' | 'node' | 'chart'; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; + /** + * Defines the sort order in which series items are displayed in the axis tooltip. + * When set to `none`, series are displayed in the same order they are provided in the series property. Otherwise they are sorted by their value. + * Only applies when `trigger='axis'`. + * @default 'none' + */ + sort?: 'none' | 'desc' | 'asc'; +}; +``` + +### ChartsTooltipRow + +```typescript +type ChartsTooltipRow = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableRowElement>, + | 'ref' + | 'key' + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + >, + {} +>; +``` + +### ChartsTooltipSlotProps + +```typescript +type ChartsTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial>; +}; +``` + +### ChartsTooltipSlots + +```typescript +type ChartsTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ChartsTooltipProps, + | 'symbol' + | 'object' + | 'table' + | 'mark' + | 'line' + | 'data' + | 'legend' + | 'circle' + | 'label' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### ChartsTooltipTable + +```typescript +type ChartsTooltipTable = StyledComponent< + MUIStyledCommonProps, + Pick< + React.DetailedHTMLProps, HTMLTableElement>, + | 'ref' + | 'key' + | 'hidden' + | 'color' + | 'children' + | 'slot' + | 'style' + | 'summary' + | 'title' + | 'defaultChecked' + | 'defaultValue' + | 'suppressContentEditableWarning' + | 'suppressHydrationWarning' + | 'accessKey' + | 'autoCapitalize' + | 'autoFocus' + | 'className' + | 'contentEditable' + | 'contextMenu' + | 'dir' + | 'draggable' + | 'enterKeyHint' + | 'id' + | 'lang' + | 'nonce' + | 'spellCheck' + | 'tabIndex' + | 'translate' + | 'radioGroup' + | 'role' + | 'about' + | 'content' + | 'datatype' + | 'inlist' + | 'prefix' + | 'property' + | 'rel' + | 'resource' + | 'rev' + | 'typeof' + | 'vocab' + | 'autoCorrect' + | 'autoSave' + | 'itemProp' + | 'itemScope' + | 'itemType' + | 'itemID' + | 'itemRef' + | 'results' + | 'security' + | 'unselectable' + | 'popover' + | 'popoverTargetAction' + | 'popoverTarget' + | 'inert' + | 'inputMode' + | 'is' + | 'exportparts' + | 'part' + | 'tw' + | 'aria-activedescendant' + | 'aria-atomic' + | 'aria-autocomplete' + | 'aria-braillelabel' + | 'aria-brailleroledescription' + | 'aria-busy' + | 'aria-checked' + | 'aria-colcount' + | 'aria-colindex' + | 'aria-colindextext' + | 'aria-colspan' + | 'aria-controls' + | 'aria-current' + | 'aria-describedby' + | 'aria-description' + | 'aria-details' + | 'aria-disabled' + | 'aria-dropeffect' + | 'aria-errormessage' + | 'aria-expanded' + | 'aria-flowto' + | 'aria-grabbed' + | 'aria-haspopup' + | 'aria-hidden' + | 'aria-invalid' + | 'aria-keyshortcuts' + | 'aria-label' + | 'aria-labelledby' + | 'aria-level' + | 'aria-live' + | 'aria-modal' + | 'aria-multiline' + | 'aria-multiselectable' + | 'aria-orientation' + | 'aria-owns' + | 'aria-placeholder' + | 'aria-posinset' + | 'aria-pressed' + | 'aria-readonly' + | 'aria-relevant' + | 'aria-required' + | 'aria-roledescription' + | 'aria-rowcount' + | 'aria-rowindex' + | 'aria-rowindextext' + | 'aria-rowspan' + | 'aria-selected' + | 'aria-setsize' + | 'aria-sort' + | 'aria-valuemax' + | 'aria-valuemin' + | 'aria-valuenow' + | 'aria-valuetext' + | 'dangerouslySetInnerHTML' + | 'onCopy' + | 'onCopyCapture' + | 'onCut' + | 'onCutCapture' + | 'onPaste' + | 'onPasteCapture' + | 'onCompositionEnd' + | 'onCompositionEndCapture' + | 'onCompositionStart' + | 'onCompositionStartCapture' + | 'onCompositionUpdate' + | 'onCompositionUpdateCapture' + | 'onFocus' + | 'onFocusCapture' + | 'onBlur' + | 'onBlurCapture' + | 'onChange' + | 'onChangeCapture' + | 'onBeforeInput' + | 'onBeforeInputCapture' + | 'onInput' + | 'onInputCapture' + | 'onReset' + | 'onResetCapture' + | 'onSubmit' + | 'onSubmitCapture' + | 'onInvalid' + | 'onInvalidCapture' + | 'onLoad' + | 'onLoadCapture' + | 'onError' + | 'onErrorCapture' + | 'onKeyDown' + | 'onKeyDownCapture' + | 'onKeyPress' + | 'onKeyPressCapture' + | 'onKeyUp' + | 'onKeyUpCapture' + | 'onAbort' + | 'onAbortCapture' + | 'onCanPlay' + | 'onCanPlayCapture' + | 'onCanPlayThrough' + | 'onCanPlayThroughCapture' + | 'onDurationChange' + | 'onDurationChangeCapture' + | 'onEmptied' + | 'onEmptiedCapture' + | 'onEncrypted' + | 'onEncryptedCapture' + | 'onEnded' + | 'onEndedCapture' + | 'onLoadedData' + | 'onLoadedDataCapture' + | 'onLoadedMetadata' + | 'onLoadedMetadataCapture' + | 'onLoadStart' + | 'onLoadStartCapture' + | 'onPause' + | 'onPauseCapture' + | 'onPlay' + | 'onPlayCapture' + | 'onPlaying' + | 'onPlayingCapture' + | 'onProgress' + | 'onProgressCapture' + | 'onRateChange' + | 'onRateChangeCapture' + | 'onSeeked' + | 'onSeekedCapture' + | 'onSeeking' + | 'onSeekingCapture' + | 'onStalled' + | 'onStalledCapture' + | 'onSuspend' + | 'onSuspendCapture' + | 'onTimeUpdate' + | 'onTimeUpdateCapture' + | 'onVolumeChange' + | 'onVolumeChangeCapture' + | 'onWaiting' + | 'onWaitingCapture' + | 'onAuxClick' + | 'onAuxClickCapture' + | 'onClick' + | 'onClickCapture' + | 'onContextMenu' + | 'onContextMenuCapture' + | 'onDoubleClick' + | 'onDoubleClickCapture' + | 'onDrag' + | 'onDragCapture' + | 'onDragEnd' + | 'onDragEndCapture' + | 'onDragEnter' + | 'onDragEnterCapture' + | 'onDragExit' + | 'onDragExitCapture' + | 'onDragLeave' + | 'onDragLeaveCapture' + | 'onDragOver' + | 'onDragOverCapture' + | 'onDragStart' + | 'onDragStartCapture' + | 'onDrop' + | 'onDropCapture' + | 'onMouseDown' + | 'onMouseDownCapture' + | 'onMouseEnter' + | 'onMouseLeave' + | 'onMouseMove' + | 'onMouseMoveCapture' + | 'onMouseOut' + | 'onMouseOutCapture' + | 'onMouseOver' + | 'onMouseOverCapture' + | 'onMouseUp' + | 'onMouseUpCapture' + | 'onSelect' + | 'onSelectCapture' + | 'onTouchCancel' + | 'onTouchCancelCapture' + | 'onTouchEnd' + | 'onTouchEndCapture' + | 'onTouchMove' + | 'onTouchMoveCapture' + | 'onTouchStart' + | 'onTouchStartCapture' + | 'onPointerDown' + | 'onPointerDownCapture' + | 'onPointerMove' + | 'onPointerMoveCapture' + | 'onPointerUp' + | 'onPointerUpCapture' + | 'onPointerCancel' + | 'onPointerCancelCapture' + | 'onPointerEnter' + | 'onPointerLeave' + | 'onPointerOver' + | 'onPointerOverCapture' + | 'onPointerOut' + | 'onPointerOutCapture' + | 'onGotPointerCapture' + | 'onGotPointerCaptureCapture' + | 'onLostPointerCapture' + | 'onLostPointerCaptureCapture' + | 'onScroll' + | 'onScrollCapture' + | 'onScrollEnd' + | 'onScrollEndCapture' + | 'onWheel' + | 'onWheelCapture' + | 'onAnimationStart' + | 'onAnimationStartCapture' + | 'onAnimationEnd' + | 'onAnimationEndCapture' + | 'onAnimationIteration' + | 'onAnimationIterationCapture' + | 'onToggle' + | 'onBeforeToggle' + | 'onTransitionCancel' + | 'onTransitionCancelCapture' + | 'onTransitionEnd' + | 'onTransitionEndCapture' + | 'onTransitionRun' + | 'onTransitionRunCapture' + | 'onTransitionStart' + | 'onTransitionStartCapture' + | 'border' + | 'width' + | 'bgcolor' + | 'align' + | 'cellPadding' + | 'cellSpacing' + | 'frame' + | 'rules' + >, + {} +>; +``` + +### ItemTooltip + +```typescript +type ItemTooltip = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | ScatterValueType + | DefaultizedPieValueType + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### SeriesItem + +```typescript +type SeriesItem = { + seriesId: string; + color: string; + value: + | { open: number; high: number; low: number; close: number } + | number + | ScatterValueType + | null; + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string; + formattedLabel: string | null; + markType: ChartsLabelMarkType | undefined; + markShape: MarkShape | undefined; +}; +``` + +### UseAxesTooltipParams + +```typescript +type UseAxesTooltipParams = { + /** + * The axis directions to consider. + * If not defined, all directions are considered + */ + directions?: ('x' | 'y' | 'rotation')[]; +}; +``` + +### UseAxesTooltipReturnValue + +```typescript +type UseAxesTooltipReturnValue = { axisDirection: 'x' | 'y' | 'rotation' | 'radius'; +mainAxis: { /** The data used by `'band'` and `'point'` scales. */ +data?: any[]; +/** The label of the axis. */ +label?: string; +/** + * The props used for each component slot. + * @default {} + */ +slotProps?: Partial; +/** + * Overridable component slots. + * @default {} + */ +slots?: Partial; +/** A CSS class name applied to the root element. */ +className?: string; +/** + * ID used to identify the axis. + * + * The ID must be unique across all axes in this chart. + */ +id: AxisId; +sx?: SxProps; +/** Override or extend the styles applied to the component. */ +classes?: Partial; +/** If `true`, Reverse the axis scaleBand. */ +reverse?: boolean; +/** + * If true, the axis line is disabled. + * @default false + */ +disableLine?: boolean; +/** + * If true, the ticks are disabled. + * @default false + */ +disableTicks?: boolean; +/** The style applied to ticks text. */ +tickLabelStyle?: ChartsTextStyle; +/** The style applied to the axis label. */ +labelStyle?: ChartsTextStyle; +/** + * Defines which ticks get its label displayed. Its value can be: + * - 'auto' In such case, labels are displayed if they do not overlap with the previous one. + * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. + * @default 'auto' + */ +tickLabelInterval?: 'auto' | ((value: any, index: number) => boolean); +/** + * The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. + * @default 0 + */ +tickSpacing?: number; +/** + * The size of the ticks. + * @default 6 + */ +tickSize?: number; +/** + * Maximal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMaxStep?: number; +/** + * Minimal step between two ticks. + * When using time data, the value is assumed to be in ms. + * Not supported by categorical axis (band, points). + */ +tickMinStep?: number; +/** + * The number of ticks. This number is not guaranteed. + * Not supported by categorical axis (band, points). + */ +tickNumber?: number; +/** + * Defines which ticks are displayed. + * Its value can be: + * - 'auto' In such case the ticks are computed based on axis scale and other parameters. + * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale. + * - an array containing the values where ticks should be displayed. + * @default 'auto' + * @see + */ +tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[]; +/** + * The placement of ticks in regard to the band interval. + * Only used if scale is 'band'. + * @default 'extremities' + */ +tickPlacement?: 'start' | 'end' | 'middle' | 'extremities'; +/** + * The placement of ticks label. Can be the middle of the band, or the tick position. + * Only used if scale is 'band'. + * @default 'middle' + */ +tickLabelPlacement?: 'middle' | 'tick'; +colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig | { type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string); type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] } | { type: 'piecewise'; thresholds: (number | Date)[]; colors: string[]; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'continuous'; min?: number | Date; max?: number | Date; color: [string, string] | ((t: number) => string) } | { type: 'ordinal'; values?: (string | number | Date)[]; colors: string[]; unknownColor?: string; type: 'piecewise'; thresholds: (number | Date)[]; colors: string[] }; +/** The key used to retrieve `data` from the `dataset` prop. */ +dataKey?: string; +/** + * A function to extract and transform the value from the `dataset` item. + * It receives the full dataset item and should return the axis value. + * Can be used as an alternative to `dataKey`. + * @returns The transformed value. + */ +valueGetter?: ((item: DatasetElementType) => any); +/** + * Formats the axis value. + * @returns The string to display. + */ +valueFormatter?: ((value: any, context: AxisValueFormatterContext) => string); +/** If `true`, hide this value in the tooltip */ +hideTooltip?: boolean; +/** + * Defines the axis scale domain based on the min/max values of series linked to it. + * - 'nice': Rounds the domain at human friendly values. + * - 'strict': Set the domain to the min/max value provided. No extra space is added. + * - function: Receives the calculated extremums as parameters, and should return the axis domain. + */ +domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => { min: NumberValue; max: NumberValue }); +/** If `true`, the axis will be ignored by the tooltip with `trigger='axis'`. */ +ignoreTooltip?: boolean; +/** + * The offset of the axis in pixels. It can be used to move the axis from its default position. + * X-axis: A top axis will move up, and a bottom axis will move down. + * Y-axis: A left axis will move left, and a right axis will move right. + * @default 0 + */ +offset?: number; +scaleType: 'time' | 'log' | 'linear' | 'symlog' | 'pow' | 'sqrt' | 'utc' | 'band' | 'point'; +scale: ScaleTime | ScaleLogarithmic | ScaleLinear | ScaleSymLog | ScalePower | ScaleBand<{ toString: function toString() { [native code] } }> | ScalePoint<{ toString: function toString() { [native code] } }>; +colorScale?: ScaleSequential | ScaleThreshold | ScaleThreshold | ScaleOrdinal | ScaleOrdinal; +/** Indicate if the axis should be consider by a tooltip with `trigger='axis'`. */ +triggerTooltip?: boolean }; +axisId: AxisId; +axisValue: AxisValueT; +axisFormattedValue: string; +dataIndex: number; +seriesItems: SeriesItem[] } +``` + +### UseItemTooltipReturnValue + +```typescript +type UseItemTooltipReturnValue = { + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The value. */ + value: + | number + | { open: number; high: number; low: number; close: number } + | ScatterValueType + | DefaultizedPieValueType + | null; + /** The value formatted with context set to "tooltip". */ + formattedValue: + | { open: string | null; high: string | null; low: string | null; close: string | null } + | string + | null; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + /** The series mark shape. */ + markShape?: MarkShape; +}; +``` + +### UseRadarItemTooltipReturnValue + +```typescript +type UseRadarItemTooltipReturnValue = { + /** The series mark shape. */ + markShape?: MarkShape; + /** An object that identifies the item to display. */ + identifier: SeriesItemIdentifierWithType<'bar' | 'line' | 'scatter' | 'pie' | 'radar'>; + /** The color associated with the item. */ + color: string; + /** The metric label. */ + label: string | undefined; + /** The series mark type. */ + markType: ChartsLabelMarkType | undefined; + values: ItemTooltipValue<'radar'>[]; +}; +``` + +## External Types + +### MarkShape + +```typescript +type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### TriggerOptions + +```typescript +type TriggerOptions = 'item' | 'axis' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.charts-tooltip-container.ts b/docs/pages/x/api/charts/types.charts-tooltip-container.ts new file mode 100644 index 0000000000000..a61918464d2f8 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-tooltip-container.ts @@ -0,0 +1,4 @@ +import { ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsTooltipContainer = createTypes(import.meta.url, ChartsTooltipContainer); diff --git a/docs/pages/x/api/charts/types.charts-tooltip.ts b/docs/pages/x/api/charts/types.charts-tooltip.ts new file mode 100644 index 0000000000000..dacd734429a63 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-tooltip.ts @@ -0,0 +1,4 @@ +import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsTooltip = createTypes(import.meta.url, ChartsTooltip); diff --git a/docs/pages/x/api/charts/types.charts-wrapper.ts b/docs/pages/x/api/charts/types.charts-wrapper.ts new file mode 100644 index 0000000000000..ea8b28593d7f4 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-wrapper.ts @@ -0,0 +1,4 @@ +import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsWrapper = createTypes(import.meta.url, ChartsWrapper); diff --git a/docs/pages/x/api/charts/types.charts-x-axis.ts b/docs/pages/x/api/charts/types.charts-x-axis.ts new file mode 100644 index 0000000000000..491ce76a88a6b --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-x-axis.ts @@ -0,0 +1,4 @@ +import { ChartsXAxis } from '@mui/x-charts/ChartsXAxis'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsXAxis = createTypes(import.meta.url, ChartsXAxis); diff --git a/docs/pages/x/api/charts/types.charts-y-axis.ts b/docs/pages/x/api/charts/types.charts-y-axis.ts new file mode 100644 index 0000000000000..b1d150d520ab4 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-y-axis.ts @@ -0,0 +1,4 @@ +import { ChartsYAxis } from '@mui/x-charts/ChartsYAxis'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsYAxis = createTypes(import.meta.url, ChartsYAxis); diff --git a/docs/pages/x/api/charts/types.charts-zoom-slider.ts b/docs/pages/x/api/charts/types.charts-zoom-slider.ts new file mode 100644 index 0000000000000..2cbf7b2d6cde6 --- /dev/null +++ b/docs/pages/x/api/charts/types.charts-zoom-slider.ts @@ -0,0 +1,4 @@ +import { ChartsZoomSlider } from '@mui/x-charts-pro/ChartsZoomSlider'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChartsZoomSlider = createTypes(import.meta.url, ChartsZoomSlider); diff --git a/docs/pages/x/api/charts/types.continuous-color-legend.ts b/docs/pages/x/api/charts/types.continuous-color-legend.ts new file mode 100644 index 0000000000000..8760ae923508d --- /dev/null +++ b/docs/pages/x/api/charts/types.continuous-color-legend.ts @@ -0,0 +1,4 @@ +import { ContinuousColorLegend } from '@mui/x-charts/ChartsLegend'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesContinuousColorLegend = createTypes(import.meta.url, ContinuousColorLegend); diff --git a/docs/pages/x/api/charts/types.focused-funnel-section.ts b/docs/pages/x/api/charts/types.focused-funnel-section.ts new file mode 100644 index 0000000000000..000f1920033e3 --- /dev/null +++ b/docs/pages/x/api/charts/types.focused-funnel-section.ts @@ -0,0 +1,4 @@ +import { FocusedFunnelSection } from '@mui/x-charts-pro/FunnelChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFocusedFunnelSection = createTypes(import.meta.url, FocusedFunnelSection); diff --git a/docs/pages/x/api/charts/types.focused-heatmap-cell.ts b/docs/pages/x/api/charts/types.focused-heatmap-cell.ts new file mode 100644 index 0000000000000..0041d0a0c80c4 --- /dev/null +++ b/docs/pages/x/api/charts/types.focused-heatmap-cell.ts @@ -0,0 +1,4 @@ +import { FocusedHeatmapCell } from '@mui/x-charts-pro/Heatmap'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFocusedHeatmapCell = createTypes(import.meta.url, FocusedHeatmapCell); diff --git a/docs/pages/x/api/charts/types.focused-radar-mark.ts b/docs/pages/x/api/charts/types.focused-radar-mark.ts new file mode 100644 index 0000000000000..1faa3d5fc31ce --- /dev/null +++ b/docs/pages/x/api/charts/types.focused-radar-mark.ts @@ -0,0 +1,4 @@ +import { FocusedRadarMark } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFocusedRadarMark = createTypes(import.meta.url, FocusedRadarMark); diff --git a/docs/pages/x/api/charts/types.focused-range-bar.md b/docs/pages/x/api/charts/types.focused-range-bar.md new file mode 100644 index 0000000000000..e51c510756ee9 --- /dev/null +++ b/docs/pages/x/api/charts/types.focused-range-bar.md @@ -0,0 +1,1680 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.focused-range-bar.md' + +## API Reference + +### BarChartPremium + +Demos: + +- [Bars](https://mui.com/x/react-charts/bars/) +- [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [BarChart API](https://mui.com/x/api/charts/bar-chart/) + +**BarChartPremium Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | - | The configuration of axes highlight. Default is set to 'band' in the bar direction. Depends on `layout` prop. | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'bar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } \| VisibilityIdentifier<'bar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| layout | `'horizontal' \| 'vertical'` | `'vertical'` | The direction of the bar elements. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onItemClick | `onItemClick` | - | Callback fired when a bar or range bar item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: BarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| plugins | `[ChartPlugin, ChartPlugin, ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin>, ChartPlugin, ChartPlugin, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the bar plot. `svg-single`: Renders every bar in a `` element.`svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/bars/#performance | +| series\* | `(RangeBarSeriesType \| BarSeries)[]` | - | The series to display in the bar chart. An array of \[\[BarSeries]] or \[\[RangeBarSeries]] objects. | +| seriesConfig | `{ bar: ChartSeriesTypeConfig<'bar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `BarChartPremiumSlotProps` | `{}` | The props used for each component slot. | +| slots | `BarChartPremiumSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `BarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### FocusedRangeBar + +### RangeBarPlot + +Demos: + +- [Range Bar](https://mui.com/x/react-charts/range-bar/) + +API: + +- [RangeBarPlot API](https://mui.com/x/api/charts/range-bar-plot/) + +**RangeBarPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------- | :---------- | :-------------------------------------------- | +| borderRadius | `number` | - | Defines the border radius of the bar element. | +| onItemClick | `((event: React.MouseEvent, barItemIdentifier: RangeBarItemIdentifier) => void)` | - | Callback fired when a bar item is clicked. | +| skipAnimation | `boolean` | `undefined` | If `true`, animations are skipped. | +| slotProps | `RangeBarPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `RangeBarPlotSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### BAR_CHART_PREMIUM_PLUGINS + +```typescript +type BAR_CHART_PREMIUM_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, +]; +``` + +### BarChartPremiumPluginSignatures + +```typescript +type BarChartPremiumPluginSignatures = BarChartProPluginSignatures; +``` + +### BarChartPremiumProps + +````typescript +type BarChartPremiumProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: BarChartPremiumSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: BarChartPremiumSlotProps; + /** Callback fired when a bar or range bar item is clicked. */ + onItemClick?: onItemClick; + /** + * The series to display in the bar chart. + * An array of [[BarSeries]] or [[RangeBarSeries]] objects. + */ + series: (RangeBarSeriesType | BarSeries)[]; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + children?: React.ReactNode; + className?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + sx?: SxProps; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The direction of the bar elements. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { bar: ChartSeriesTypeConfig<'bar'> }; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, + ChartPlugin, + ]; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: BarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: BarItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'bar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'bar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'bar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'bar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'bar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'bar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'bar' } + | VisibilityIdentifier<'bar'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * The type of renderer to use for the bar plot. + * - `svg-single`: Renders every bar in a `` element. + * - `svg-batch`: Batch renders bars in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/bars/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The configuration of axes highlight. + * Default is set to 'band' in the bar direction. + * Depends on `layout` prop. + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; +}; +```` + +### BarChartPremiumSlotProps + +```typescript +type BarChartPremiumSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'pointer' | 'node'; sort?: undefined } + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'desc' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + bar?: SlotComponentPropsFromProps; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + barLabel?: SlotComponentPropsFromProps; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### BarChartPremiumSlots + +```typescript +type BarChartPremiumSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { trigger?: 'none'; anchor?: 'pointer'; sort?: undefined } + | { trigger?: 'item'; anchor?: 'pointer' | 'node'; sort?: undefined } + | { trigger?: 'axis'; anchor?: 'pointer' | 'chart'; sort?: 'none' | 'desc' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'legend' + | 'line' + | 'circle' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +### rangeBarClasses + +```typescript +type rangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClasses + +```typescript +type RangeBarClasses = { + /** Styles applied to the range bar plot element. */ + root: string; + /** Styles applied to the group surrounding a series' bar elements. */ + series: string; + /** Styles applied to the group surrounding a series' labels. */ + seriesLabels: string; +}; +``` + +### RangeBarClassKey + +```typescript +type RangeBarClassKey = 'root' | 'series' | 'seriesLabels'; +``` + +### RangeBarPlotProps + +```typescript +type RangeBarPlotProps = { + /** + * If `true`, animations are skipped. + * @default undefined + */ + skipAnimation?: boolean; + /** Callback fired when a bar item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + barItemIdentifier: RangeBarItemIdentifier, + ) => void; + /** Defines the border radius of the bar element. */ + borderRadius?: number; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RangeBarPlotSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: RangeBarPlotSlots; +}; +``` + +### RangeBarPlotSlotProps + +```typescript +type RangeBarPlotSlotProps = { + bar?: SlotComponentPropsFromProps; + barLabel?: SlotComponentPropsFromProps; +}; +``` + +### RangeBarPlotSlots + +```typescript +type RangeBarPlotSlots = { + /** + * The component that renders the bar. + * @default BarElementPath + */ + bar?: React.JSXElementConstructor; + /** + * The component that renders the bar label. + * @default BarLabel + */ + barLabel?: React.JSXElementConstructor; +}; +``` + +### RangeBarSeries + +```typescript +type RangeBarSeries = { + type: 'rangeBar'; + /** Data associated to each range bar. */ + data?: (RangeBarValueType | null)[]; + /** + * A function to transform the dataset item into a range bar value. + * @returns The transformed value. + */ + valueGetter?: (item: DatasetElementType) => RangeBarValueType | null; + /** The keys used to retrieve data from the dataset. Must be provided if the `dataset` prop is used. */ + datasetKeys?: { start: string; end: string }; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** + * Layout of the bars. All bars should have the same layout. + * @default 'vertical' + */ + layout?: 'horizontal' | 'vertical'; + /** The id of this series. */ + id?: SeriesId; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope< + | 'rangeBar' + | 'bar' + | 'line' + | 'scatter' + | 'pie' + | 'radar' + | 'heatmap' + | 'funnel' + | 'sankey' + | 'ohlc' + >; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + /** The id of the x-axis used to render the series. */ + xAxisId?: AxisId; + /** The id of the y-axis used to render the series. */ + yAxisId?: AxisId; +}; +``` + +## External Types + +### SeriesValueFormatter + +```typescript +type SeriesValueFormatter = ( + value: unknown | null, + context: { dataIndex: number }, +) => string | null; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` + +### onItemClick + +```typescript +type onItemClick = ( + event: MouseEvent, + itemIdentifier: + | { type: 'bar'; seriesId: string; dataIndex: number } + | { type: 'rangeBar'; seriesId: string; dataIndex: number }, +) => void; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` diff --git a/docs/pages/x/api/charts/types.focused-range-bar.ts b/docs/pages/x/api/charts/types.focused-range-bar.ts new file mode 100644 index 0000000000000..df323fa1ae09b --- /dev/null +++ b/docs/pages/x/api/charts/types.focused-range-bar.ts @@ -0,0 +1,4 @@ +import { FocusedRangeBar } from '@mui/x-charts-premium/BarChartPremium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFocusedRangeBar = createTypes(import.meta.url, FocusedRangeBar); diff --git a/docs/pages/x/api/charts/types.focused-sankey-link.ts b/docs/pages/x/api/charts/types.focused-sankey-link.ts new file mode 100644 index 0000000000000..0ffd1c1a03a76 --- /dev/null +++ b/docs/pages/x/api/charts/types.focused-sankey-link.ts @@ -0,0 +1,4 @@ +import { FocusedSankeyLink } from '@mui/x-charts-pro/SankeyChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFocusedSankeyLink = createTypes(import.meta.url, FocusedSankeyLink); diff --git a/docs/pages/x/api/charts/types.focused-sankey-node.ts b/docs/pages/x/api/charts/types.focused-sankey-node.ts new file mode 100644 index 0000000000000..a3d4b34b85ad2 --- /dev/null +++ b/docs/pages/x/api/charts/types.focused-sankey-node.ts @@ -0,0 +1,4 @@ +import { FocusedSankeyNode } from '@mui/x-charts-pro/SankeyChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFocusedSankeyNode = createTypes(import.meta.url, FocusedSankeyNode); diff --git a/docs/pages/x/api/charts/types.funnel-chart.ts b/docs/pages/x/api/charts/types.funnel-chart.ts new file mode 100644 index 0000000000000..dee632000801d --- /dev/null +++ b/docs/pages/x/api/charts/types.funnel-chart.ts @@ -0,0 +1,4 @@ +import { FunnelChart } from '@mui/x-charts-pro/FunnelChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFunnelChart = createTypes(import.meta.url, FunnelChart); diff --git a/docs/pages/x/api/charts/types.funnel-plot.ts b/docs/pages/x/api/charts/types.funnel-plot.ts new file mode 100644 index 0000000000000..95388e847b710 --- /dev/null +++ b/docs/pages/x/api/charts/types.funnel-plot.ts @@ -0,0 +1,4 @@ +import { FunnelPlot } from '@mui/x-charts-pro/FunnelChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFunnelPlot = createTypes(import.meta.url, FunnelPlot); diff --git a/docs/pages/x/api/charts/types.funnel-series.ts b/docs/pages/x/api/charts/types.funnel-series.ts new file mode 100644 index 0000000000000..4214d9d1482ad --- /dev/null +++ b/docs/pages/x/api/charts/types.funnel-series.ts @@ -0,0 +1,4 @@ +import { FunnelSeries } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesFunnelSeries = createTypes(import.meta.url, FunnelSeries); diff --git a/docs/pages/x/api/charts/types.gauge-container.ts b/docs/pages/x/api/charts/types.gauge-container.ts new file mode 100644 index 0000000000000..72925684e3d57 --- /dev/null +++ b/docs/pages/x/api/charts/types.gauge-container.ts @@ -0,0 +1,4 @@ +import { GaugeContainer } from '@mui/x-charts/Gauge'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesGaugeContainer = createTypes(import.meta.url, GaugeContainer); diff --git a/docs/pages/x/api/charts/types.gauge.md b/docs/pages/x/api/charts/types.gauge.md new file mode 100644 index 0000000000000..d0f5b4bb69987 --- /dev/null +++ b/docs/pages/x/api/charts/types.gauge.md @@ -0,0 +1,364 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.gauge.md' + +## API Reference + +### Gauge + +**Gauge Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| classes | `Partial` | - | - | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeContainer + +**GaugeContainer Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | `number \| null` | - | The value of the gauge. Set to `null` to not display a value. | +| cornerRadius | `number \| string` | `0` | The radius applied to arc corners (similar to border radius). Set it to '50%' to get rounded arc. | +| cx | `number \| string` | - | The x coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the width the drawing area. | +| cy | `number \| string` | - | The y coordinate of the arc center. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the height the drawing area. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| endAngle | `number` | `360` | The end angle (deg). | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| innerRadius | `number \| string` | `'80%'` | The radius between circle center and the beginning of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| outerRadius | `number \| string` | `'100%'` | The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as '50%'. The '100%' is the maximal radius that fit into the drawing area. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| startAngle | `number` | `0` | The start angle (deg). | +| sx | `SxProps` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| valueMax | `number` | `100` | The maximal value of the gauge. | +| valueMin | `number` | `0` | The minimal value of the gauge. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### GaugeReferenceArc + +### GaugeValueArc + +**GaugeValueArc Props:** + +| Prop | Type | Default | Description | +| :------------ | :-------- | :------ | :---------- | +| skipAnimation | `boolean` | - | - | + +### GaugeValueText + +**GaugeValueText Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------- | :------ | :------------------------------------- | +| lineHeight | `number` | - | Height of a text line (in `em`). | +| needsComputation | `boolean` | `false` | If `true`, the line width is computed. | +| ownerState | `any` | - | - | +| text | `string \| ((params: GaugeFormatterParams) => string \| null)` | - | - | +| style | `ChartsTextStyle` | - | Style applied to text elements. | + +### useGaugeState + +**useGaugeState Return Value:** + +```tsx +type ReturnValue = { + value: number | null; + valueMin: number; + valueMax: number; + startAngle: number; + endAngle: number; + innerRadius: number; + outerRadius: number; + cornerRadius: number; + cx: number; + cy: number; + maxRadius: number; + valueAngle: number | null; +}; +``` + +## Additional Types + +### gaugeClasses + +```typescript +type gaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClasses + +```typescript +type GaugeClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the arc displaying the value. */ + valueArc: string; + /** Styles applied to the arc displaying the range of available values. */ + referenceArc: string; + /** Styles applied to the value text. */ + valueText: string; +}; +``` + +### GaugeClassKey + +```typescript +type GaugeClassKey = 'root' | 'valueArc' | 'referenceArc' | 'valueText'; +``` + +### GaugeContainerProps + +```typescript +type GaugeContainerProps = { + children?: React.ReactNode; + className?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + sx?: SxProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; +}; +``` + +### GaugeFormatterParams + +```typescript +type GaugeFormatterParams = { value: number | null; valueMin: number; valueMax: number }; +``` + +### GaugeProps + +```typescript +type GaugeProps = { + classes?: Partial; + children?: React.ReactNode; + className?: string; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + sx?: SxProps; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The value of the gauge. + * Set to `null` to not display a value. + */ + value?: number | null; + /** + * The minimal value of the gauge. + * @default 0 + */ + valueMin?: number; + /** + * The maximal value of the gauge. + * @default 100 + */ + valueMax?: number; + /** + * The start angle (deg). + * @default 0 + */ + startAngle?: number; + /** + * The end angle (deg). + * @default 360 + */ + endAngle?: number; + /** + * The radius between circle center and the beginning of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '80%' + */ + innerRadius?: number | string; + /** + * The radius between circle center and the end of the arc. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the maximal radius that fit into the drawing area. + * @default '100%' + */ + outerRadius?: number | string; + /** + * The radius applied to arc corners (similar to border radius). + * Set it to '50%' to get rounded arc. + * @default 0 + */ + cornerRadius?: number | string; + /** + * The x coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the width the drawing area. + */ + cx?: number | string; + /** + * The y coordinate of the arc center. + * Can be a number (in px) or a string with a percentage such as '50%'. + * The '100%' is the height the drawing area. + */ + cy?: number | string; + text?: string | ((params: GaugeFormatterParams) => string | null); +}; +``` + +### GaugeValueTextProps + +```typescript +type GaugeValueTextProps = { + text?: string | ((params: GaugeFormatterParams) => string | null); + /** Style applied to text elements. */ + style?: ChartsTextStyle; + /** Height of a text line (in `em`). */ + lineHeight?: number; + ownerState?: any; + /** + * If `true`, the line width is computed. + * @default false + */ + needsComputation?: boolean; +}; +``` diff --git a/docs/pages/x/api/charts/types.gauge.ts b/docs/pages/x/api/charts/types.gauge.ts new file mode 100644 index 0000000000000..655c922d03fc4 --- /dev/null +++ b/docs/pages/x/api/charts/types.gauge.ts @@ -0,0 +1,4 @@ +import { Gauge } from '@mui/x-charts/Gauge'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesGauge = createTypes(import.meta.url, Gauge); diff --git a/docs/pages/x/api/charts/types.heatmap-cell.ts b/docs/pages/x/api/charts/types.heatmap-cell.ts new file mode 100644 index 0000000000000..b9e4c9cc7002c --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap-cell.ts @@ -0,0 +1,4 @@ +import { HeatmapCell } from '@mui/x-charts-pro/Heatmap'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesHeatmapCell = createTypes(import.meta.url, HeatmapCell); diff --git a/docs/pages/x/api/charts/types.heatmap-plot.ts b/docs/pages/x/api/charts/types.heatmap-plot.ts new file mode 100644 index 0000000000000..a0cf2d10d4755 --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap-plot.ts @@ -0,0 +1,4 @@ +import { HeatmapPlot } from '@mui/x-charts-pro/Heatmap'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesHeatmapPlot = createTypes(import.meta.url, HeatmapPlot); diff --git a/docs/pages/x/api/charts/types.heatmap-premium.md b/docs/pages/x/api/charts/types.heatmap-premium.md new file mode 100644 index 0000000000000..522ef79a394c0 --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap-premium.md @@ -0,0 +1,1242 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.heatmap-premium.md' + +## API Reference + +### HeatmapPremium + +**HeatmapPremium Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| borderRadius | `number` | - | The border radius of the heatmap cells in pixels. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialZoom | `ZoomData[]` | - | The list of zoom data related to each axis. Used to initialize the zoom in a specific configuration without controlling it. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, item: SeriesItemIdentifierWithType<'line' \| 'heatmap' \| 'bar' \| 'scatter' \| 'pie' \| 'radar' \| 'funnel' \| 'sankey' \| 'rangeBar' \| 'ohlc'>) => void)` | - | The callback fired when an item is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: HeatmapItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| onZoomChange | `((zoomData: ZoomData[]) => void)` | - | Callback fired when the zoom has changed. | +| renderer | `'svg-single' \| 'webgl'` | - | The type of renderer to use for the heatmap plot. `svg-single`: Renders every scatter item in a `` element.`webgl`: Renders heatmap cells using WebGL for better performance, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/heatmap/#performance | +| series\* | `HeatmapSeries[]` | - | The series to display in the bar chart. An array of \[\[HeatmapSeries]] objects. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| slotProps | `HeatmapPremiumSlotProps` | `{}` | The props used for each component slot. | +| slots | `HeatmapPremiumSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltip | `ChartsTooltipProps` | - | The configuration of the tooltip. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `HeatmapItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis\* | `(MakeOptional, 'id'>, 'scaleType'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| zoomData | `ZoomData[]` | - | The list of zoom data related to each axis. | +| zoomInteractionConfig | `ZoomInteractionConfig` | - | Configuration for zoom interactions. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +## Additional Types + +### HeatmapPremiumProps + +```typescript +type HeatmapPremiumProps = { + /** + * The type of renderer to use for the heatmap plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `webgl`: Renders heatmap cells using WebGL for better performance, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/heatmap/#performance + */ + renderer?: 'svg-single' | 'webgl'; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis: MakeOptional, 'id'>, 'scaleType'>[]; + /** + * The series to display in the bar chart. + * An array of [[HeatmapSeries]] objects. + */ + series: HeatmapSeries[]; + /** + * The configuration of the tooltip. + * @see + */ + tooltip?: ChartsTooltipProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The border radius of the heatmap cells in pixels. */ + borderRadius?: number; + /** + * Overridable component slots. + * @default {} + */ + slots?: HeatmapSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: HeatmapSlotProps; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + children?: React.ReactNode; + className?: string; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + sx?: SxProps; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** The callback fired when an item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + item: SeriesItemIdentifierWithType< + | 'line' + | 'heatmap' + | 'bar' + | 'scatter' + | 'pie' + | 'radar' + | 'funnel' + | 'sankey' + | 'rangeBar' + | 'ohlc' + >, + ) => void; + apiRef?: React.RefObject | undefined>; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: HeatmapItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: HeatmapItemIdentifier | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } + | Omit<{ type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'heatmap'; seriesId: string; xIndex: number; yIndex: number } | null, + ) => void; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The list of zoom data related to each axis. + * Used to initialize the zoom in a specific configuration without controlling it. + */ + initialZoom?: ZoomData[]; + /** Callback fired when the zoom has changed. */ + onZoomChange?: (zoomData: ZoomData[]) => void; + /** The list of zoom data related to each axis. */ + zoomData?: ZoomData[]; + /** Configuration for zoom interactions. */ + zoomInteractionConfig?: ZoomInteractionConfig; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +``` + +### HeatmapPremiumSlotProps + +```typescript +type HeatmapPremiumSlotProps = { + tooltip?: Partial; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + cell?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseDivider?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; orientation?: 'horizontal' | 'vertical' }; + baseMenuItem?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + autoFocus?: boolean; + children?: React.ReactNode; + inert?: boolean; + dense?: boolean; + disabled?: boolean; + iconStart?: React.ReactNode; + iconEnd?: React.ReactNode; + selected?: boolean; + value?: number | string | string[]; + style?: React.CSSProperties; + }; + baseMenuList?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + children?: React.ReactNode; + autoFocus?: boolean; + autoFocusItem?: boolean; + }; + basePopper?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + open: boolean; + children?: React.ReactNode; + clickAwayTouchEvent?: false | ClickAwayTouchEventHandler; + clickAwayMouseEvent?: false | ClickAwayMouseEventHandler; + flip?: boolean; + focusTrap?: boolean; + onExited?: (node: HTMLElement | null) => void; + onClickAway?: (event: MouseEvent | TouchEvent) => void; + onDidShow?: () => void; + onDidHide?: () => void; + id?: string; + target?: Element | null; + transition?: boolean; + placement?: Placement; + }; + baseTooltip?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + children: ReactElement; + enterDelay?: number; + title: React.ReactNode; + disableInteractive?: boolean; + }; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { titleAccess?: string; fontSize?: 'small' | 'medium' | 'large' | 'inherit' }; +}; +``` + +### HeatmapPremiumSlots + +```typescript +type HeatmapPremiumSlots = { + /** + * Custom component for the tooltip. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + HeatmapTooltipProps, + | 'symbol' + | 'object' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'line' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the legend. + * @default ContinuousColorLegendProps + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'line' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'line' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * The component that renders the heatmap cell. + * @default HeatmapCell + */ + cell?: React.ElementType; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProProps, + | 'symbol' + | 'object' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'slot' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'style' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'clipPath' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'filter' + | 'foreignObject' + | 'g' + | 'image' + | 'line' + | 'linearGradient' + | 'marker' + | 'mask' + | 'metadata' + | 'mpath' + | 'path' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseDivider?: React.ComponentType; + baseMenuItem?: React.ComponentType; + baseMenuList?: React.ComponentType; + basePopper?: React.ComponentType; + baseTooltip?: React.ComponentType; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom in button. + * @default ChartsZoomInIcon + */ + zoomInIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's zoom out button. + * @default ChartsZoomOutIcon + */ + zoomOutIcon?: React.ComponentType; + /** + * Icon displayed on the toolbar's export button. + * @default ChartsExportIcon + */ + exportIcon?: React.ComponentType; +}; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ClickAwayTouchEventHandler + +```typescript +type ClickAwayTouchEventHandler = 'onTouchStart' | 'onTouchEnd'; +``` + +### ClickAwayMouseEventHandler + +```typescript +type ClickAwayMouseEventHandler = + | 'onClick' + | 'onMouseDown' + | 'onMouseUp' + | 'onPointerDown' + | 'onPointerUp'; +``` diff --git a/docs/pages/x/api/charts/types.heatmap-premium.ts b/docs/pages/x/api/charts/types.heatmap-premium.ts new file mode 100644 index 0000000000000..a541083c021f9 --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap-premium.ts @@ -0,0 +1,4 @@ +import { HeatmapPremium } from '@mui/x-charts-premium/HeatmapPremium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesHeatmapPremium = createTypes(import.meta.url, HeatmapPremium); diff --git a/docs/pages/x/api/charts/types.heatmap-series.ts b/docs/pages/x/api/charts/types.heatmap-series.ts new file mode 100644 index 0000000000000..c196de77b0bee --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap-series.ts @@ -0,0 +1,4 @@ +import { HeatmapSeries } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesHeatmapSeries = createTypes(import.meta.url, HeatmapSeries); diff --git a/docs/pages/x/api/charts/types.heatmap-tooltip-content.ts b/docs/pages/x/api/charts/types.heatmap-tooltip-content.ts new file mode 100644 index 0000000000000..d274d930e0475 --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap-tooltip-content.ts @@ -0,0 +1,4 @@ +import { HeatmapTooltipContent } from '@mui/x-charts-pro/Heatmap'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesHeatmapTooltipContent = createTypes(import.meta.url, HeatmapTooltipContent); diff --git a/docs/pages/x/api/charts/types.heatmap-tooltip.ts b/docs/pages/x/api/charts/types.heatmap-tooltip.ts new file mode 100644 index 0000000000000..0de4d865a5e0c --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap-tooltip.ts @@ -0,0 +1,4 @@ +import { HeatmapTooltip } from '@mui/x-charts-pro/Heatmap'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesHeatmapTooltip = createTypes(import.meta.url, HeatmapTooltip); diff --git a/docs/pages/x/api/charts/types.heatmap.ts b/docs/pages/x/api/charts/types.heatmap.ts new file mode 100644 index 0000000000000..f3f26e49e8fc2 --- /dev/null +++ b/docs/pages/x/api/charts/types.heatmap.ts @@ -0,0 +1,4 @@ +import { Heatmap } from '@mui/x-charts-pro/Heatmap'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesHeatmap = createTypes(import.meta.url, Heatmap); diff --git a/docs/pages/x/api/charts/types.legend-item-params.ts b/docs/pages/x/api/charts/types.legend-item-params.ts new file mode 100644 index 0000000000000..f331a65a86952 --- /dev/null +++ b/docs/pages/x/api/charts/types.legend-item-params.ts @@ -0,0 +1,4 @@ +import { LegendItemParams } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLegendItemParams = createTypes(import.meta.url, LegendItemParams); diff --git a/docs/pages/x/api/charts/types.line-chart-pro.ts b/docs/pages/x/api/charts/types.line-chart-pro.ts new file mode 100644 index 0000000000000..b0bf19fbe739f --- /dev/null +++ b/docs/pages/x/api/charts/types.line-chart-pro.ts @@ -0,0 +1,4 @@ +import { LineChartPro } from '@mui/x-charts-pro/LineChartPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLineChartPro = createTypes(import.meta.url, LineChartPro); diff --git a/docs/pages/x/api/charts/types.line-chart.ts b/docs/pages/x/api/charts/types.line-chart.ts new file mode 100644 index 0000000000000..21a1c581a5ee6 --- /dev/null +++ b/docs/pages/x/api/charts/types.line-chart.ts @@ -0,0 +1,4 @@ +import { LineChart } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLineChart = createTypes(import.meta.url, LineChart); diff --git a/docs/pages/x/api/charts/types.line-element.ts b/docs/pages/x/api/charts/types.line-element.ts new file mode 100644 index 0000000000000..722504c437054 --- /dev/null +++ b/docs/pages/x/api/charts/types.line-element.ts @@ -0,0 +1,4 @@ +import { LineElement } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLineElement = createTypes(import.meta.url, LineElement); diff --git a/docs/pages/x/api/charts/types.line-highlight-element.ts b/docs/pages/x/api/charts/types.line-highlight-element.ts new file mode 100644 index 0000000000000..3a975b8ee431f --- /dev/null +++ b/docs/pages/x/api/charts/types.line-highlight-element.ts @@ -0,0 +1,4 @@ +import { LineHighlightElement } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLineHighlightElement = createTypes(import.meta.url, LineHighlightElement); diff --git a/docs/pages/x/api/charts/types.line-highlight-plot.md b/docs/pages/x/api/charts/types.line-highlight-plot.md new file mode 100644 index 0000000000000..2787aa15251e1 --- /dev/null +++ b/docs/pages/x/api/charts/types.line-highlight-plot.md @@ -0,0 +1,1963 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.line-highlight-plot.md' + +## API Reference + +### AnimatedArea + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/animated-area/) + +**AnimatedArea Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `AreaElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AnimatedLine + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [AnimatedLine API](https://mui.com/x/api/charts/animated-line/) + +**AnimatedLine Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------- | :------ | :--------------------------------- | +| d\* | `string` | - | - | +| ownerState\* | `LineElementOwnerState` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | + +### AreaElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) + +API: + +- [AreaElement API](https://mui.com/x/api/charts/area-element/) + +**AreaElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### AreaPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Areas demonstration](https://mui.com/x/react-charts/areas-demo/) +- [Stacking](https://mui.com/x/react-charts/stacking/) + +API: + +- [AreaPlot API](https://mui.com/x/api/charts/area-plot/) + +**AreaPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line area item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `AreaElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `AreaElementSlots` | `{}` | Overridable component slots. | + +### FocusedLineMark + +### LineChart + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineChart API](https://mui.com/x/api/charts/line-chart/) + +**LineChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'line' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableLineItemHighlight | `boolean` | - | If `true`, render the line highlight item. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `AnimatedAreaProps` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedAxis | `AxisItemIdentifier[]` | - | The controlled axis highlight. Identified by the axis id, and data index. | +| highlightedItem | `{ type: 'line'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } \| VisibilityIdentifier<'line'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when an area element is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onHighlightedAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onLineClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line element is clicked. | +| onMarkClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a mark element is clicked. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: LineItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `LineSeries[]` | - | The series to display in the line chart. An array of \[\[LineSeries]] objects. | +| seriesConfig | `{ line: ChartSeriesTypeConfig<'line'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `LineItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### LineElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineElement API](https://mui.com/x/api/charts/line-element/) + +**LineElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :--------------------- | :------ | :-------------------------------------- | +| hidden | `boolean` | - | If `true`, the line is hidden. | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| d\* | `string` | - | - | +| gradientId | `string` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### LineHighlightElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/) + +**LineHighlightElement Props:** + +| Prop | Type | Default | Description | +| :--------- | :------------------------------------------------------------------------------ | :------ | :---------- | +| color\* | `string` | - | - | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | - | +| x\* | `number` | - | - | +| y\* | `number` | - | - | + +### LineHighlightPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/) + +**LineHighlightPlot Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------- | :------ | :-------------------------------------- | +| slotProps | `LineHighlightPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineHighlightPlotSlots` | `{}` | Overridable component slots. | + +### LinePlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [LinePlot API](https://mui.com/x/api/charts/line-plot/) + +**LinePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :------------------------------------------ | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `LineElementSlotProps` | `{}` | The props used for each component slot. | +| slots | `LineElementSlots` | `{}` | Overridable component slots. | + +### MarkElement + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkElement API](https://mui.com/x/api/charts/mark-element/) + +**MarkElement Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------ | :------ | :-------------------------------------------------- | +| hidden | `boolean` | `false` | If `true`, the marker is hidden. | +| classes | `Partial` | - | - | +| dataIndex\* | `number` | - | The index to the element in the series' data array. | +| isFaded | `boolean` | `false` | If `true`, the marker is faded. | +| isHighlighted | `boolean` | `false` | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | - | +| shape\* | `'circle' \| 'cross' \| 'diamond' \| 'square' \| 'star' \| 'triangle' \| 'wye'` | - | The shape of the marker. | +| skipAnimation | `boolean` | - | - | + +### MarkPlot + +Demos: + +- [Lines](https://mui.com/x/react-charts/lines/) +- [Line demonstration](https://mui.com/x/react-charts/line-demo/) + +API: + +- [MarkPlot API](https://mui.com/x/api/charts/mark-plot/) + +**MarkPlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------------- | +| onItemClick | `((event: React.MouseEvent, lineItemIdentifier: LineItemIdentifier) => void)` | - | Callback fired when a line mark item is clicked. | +| skipAnimation | `boolean` | - | - | +| slotProps | `MarkPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `MarkPlotSlots` | `{}` | Overridable component slots. | + +## Additional Types + +### AnimatedAreaProps + +```typescript +type AnimatedAreaProps = { + ownerState: AreaElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AnimatedLineProps + +```typescript +type AnimatedLineProps = { + ownerState: LineElementOwnerState; + d: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementOwnerState + +```typescript +type AreaElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; +}; +``` + +### AreaElementProps + +```typescript +type AreaElementProps = { + d: string; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaElementSlotProps + +```typescript +type AreaElementSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaElementSlots + +```typescript +type AreaElementSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### AreaPlotProps + +```typescript +type AreaPlotProps = { + /** Callback fired when a line area item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: AreaElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: AreaElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### AreaPlotSlotProps + +```typescript +type AreaPlotSlotProps = { + area?: SlotComponentPropsFromProps; +}; +``` + +### AreaPlotSlots + +```typescript +type AreaPlotSlots = { + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; +}; +``` + +### LINE_CHART_PLUGINS + +```typescript +type LINE_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### LineChartPluginSignatures + +```typescript +type LineChartPluginSignatures = LineChartPluginSignatures; +``` + +### LineChartProps + +````typescript +type LineChartProps = { + /** + * The series to display in the line chart. + * An array of [[LineSeries]] objects. + */ + series: LineSeries[]; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * The configuration of axes highlight. + * @default { x: 'line' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** If `true`, render the line highlight item. */ + disableLineItemHighlight?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineChartSlotProps; + /** Callback fired when an area element is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a line element is clicked. */ + onLineClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** Callback fired when a mark element is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { line: ChartSeriesTypeConfig<'line'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: LineItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: LineItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis highlight. + * Identified by the axis id, and data index. + */ + highlightedAxis?: AxisItemIdentifier[]; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'line'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'line'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'line'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'line'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'line'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'line'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'line' } + | VisibilityIdentifier<'line'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### LineChartSlotProps + +```typescript +type LineChartSlotProps = { + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + area?: SlotComponentPropsFromProps; + line?: SlotComponentPropsFromProps; + mark?: Partial; + lineHighlight?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### LineChartSlots + +```typescript +type LineChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + /** + * The component that renders the area. + * @default AnimatedArea + */ + area?: React.JSXElementConstructor; + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; + mark?: React.JSXElementConstructor; + lineHighlight?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'area' + | 'line' + | 'mark' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'marker' + | 'label' + | 'text' + | 'p' + | 'a' + | 'abbr' + | 'address' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'big' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'link' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'search' + | 'script' + | 'section' + | 'select' + | 'small' + | 'source' + | 'span' + | 'strong' + | 'sub' + | 'summary' + | 'sup' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### lineClasses + +```typescript +type lineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClasses + +```typescript +type LineClasses = { + /** Styles applied to the area element. */ + area: string; + /** Styles applied to the line element. */ + line: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to a mark element when it is animated. */ + markAnimate: string; + /** Styles applied to the highlight element. */ + highlight: string; + /** Styles applied to the AreaPlot root element. */ + areaPlot: string; + /** Styles applied to the LinePlot root element. */ + linePlot: string; + /** Styles applied to the MarkPlot root element. */ + markPlot: string; +}; +``` + +### LineClassKey + +```typescript +type LineClassKey = + | 'area' + | 'line' + | 'mark' + | 'markAnimate' + | 'highlight' + | 'areaPlot' + | 'linePlot' + | 'markPlot'; +``` + +### LineElementOwnerState + +```typescript +type LineElementOwnerState = { + seriesId: string; + color: string; + gradientId?: string; + isFaded: boolean; + isHighlighted: boolean; + classes?: Partial; + /** If `true`, the line is hidden. */ + hidden?: boolean; +}; +``` + +### LineElementProps + +```typescript +type LineElementProps = { + d: string; + /** If `true`, the line is hidden. */ + hidden?: boolean; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + color: string; + classes?: Partial; + seriesId: string; + gradientId?: string; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LineElementSlotProps + +```typescript +type LineElementSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LineElementSlots + +```typescript +type LineElementSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineHighlightElementProps + +```typescript +type LineHighlightElementProps = ( + | { shape: 'circle' } + | { shape: 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' } +) & { seriesId: string; color: string; x: number; y: number }; +``` + +### LineHighlightPlotProps + +```typescript +type LineHighlightPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: LineHighlightPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineHighlightPlotSlotProps; +}; +``` + +### LineHighlightPlotSlotProps + +```typescript +type LineHighlightPlotSlotProps = { + lineHighlight?: SlotComponentPropsFromProps; +}; +``` + +### LineHighlightPlotSlots + +```typescript +type LineHighlightPlotSlots = { + lineHighlight?: React.JSXElementConstructor; +}; +``` + +### LinePlotProps + +```typescript +type LinePlotProps = { + /** Callback fired when a line item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + /** + * Overridable component slots. + * @default {} + */ + slots?: LineElementSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: LineElementSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; +}; +``` + +### LinePlotSlotProps + +```typescript +type LinePlotSlotProps = { + line?: SlotComponentPropsFromProps; +}; +``` + +### LinePlotSlots + +```typescript +type LinePlotSlots = { + /** + * The component that renders the line. + * @default LineElementPath + */ + line?: React.JSXElementConstructor; +}; +``` + +### LineSeries + +```typescript +type LineSeries = MakeOptional; +``` + +### MarkElementProps + +```typescript +type MarkElementProps = { + classes?: Partial; + seriesId: string; + skipAnimation?: boolean; + /** + * If `true`, the marker is hidden. + * @default false + */ + hidden?: boolean; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The shape of the marker. */ + shape: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'; + /** The index to the element in the series' data array. */ + dataIndex: number; + /** + * If `true`, the marker is faded. + * @default false + */ + isFaded?: boolean; + /** + * If `true`, the marker is highlighted. + * @default false + */ + isHighlighted?: boolean; +}; +``` + +### MarkPlotProps + +```typescript +type MarkPlotProps = { + /** + * Overridable component slots. + * @default {} + */ + slots?: MarkPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: MarkPlotSlotProps; + /** Callback fired when a line mark item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + lineItemIdentifier: LineItemIdentifier, + ) => void; + skipAnimation?: boolean; +}; +``` + +### MarkPlotSlotProps + +```typescript +type MarkPlotSlotProps = { mark?: Partial }; +``` + +### MarkPlotSlots + +```typescript +type MarkPlotSlots = { mark?: React.JSXElementConstructor }; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.line-highlight-plot.ts b/docs/pages/x/api/charts/types.line-highlight-plot.ts new file mode 100644 index 0000000000000..5aa4a6ee82e2f --- /dev/null +++ b/docs/pages/x/api/charts/types.line-highlight-plot.ts @@ -0,0 +1,4 @@ +import { LineHighlightPlot } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLineHighlightPlot = createTypes(import.meta.url, LineHighlightPlot); diff --git a/docs/pages/x/api/charts/types.line-plot.ts b/docs/pages/x/api/charts/types.line-plot.ts new file mode 100644 index 0000000000000..6700a98e46bcd --- /dev/null +++ b/docs/pages/x/api/charts/types.line-plot.ts @@ -0,0 +1,4 @@ +import { LinePlot } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLinePlot = createTypes(import.meta.url, LinePlot); diff --git a/docs/pages/x/api/charts/types.line-series.ts b/docs/pages/x/api/charts/types.line-series.ts new file mode 100644 index 0000000000000..fb0f49055ec11 --- /dev/null +++ b/docs/pages/x/api/charts/types.line-series.ts @@ -0,0 +1,4 @@ +import { LineSeries } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesLineSeries = createTypes(import.meta.url, LineSeries); diff --git a/docs/pages/x/api/charts/types.mark-element.ts b/docs/pages/x/api/charts/types.mark-element.ts new file mode 100644 index 0000000000000..29c46f019bc80 --- /dev/null +++ b/docs/pages/x/api/charts/types.mark-element.ts @@ -0,0 +1,4 @@ +import { MarkElement } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesMarkElement = createTypes(import.meta.url, MarkElement); diff --git a/docs/pages/x/api/charts/types.mark-plot.ts b/docs/pages/x/api/charts/types.mark-plot.ts new file mode 100644 index 0000000000000..a4c2008a67445 --- /dev/null +++ b/docs/pages/x/api/charts/types.mark-plot.ts @@ -0,0 +1,4 @@ +import { MarkPlot } from '@mui/x-charts/LineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesMarkPlot = createTypes(import.meta.url, MarkPlot); diff --git a/docs/pages/x/api/charts/types.pie-arc-label-plot.ts b/docs/pages/x/api/charts/types.pie-arc-label-plot.ts new file mode 100644 index 0000000000000..ba4b5d9b622d1 --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-arc-label-plot.ts @@ -0,0 +1,4 @@ +import { PieArcLabelPlot } from '@mui/x-charts/PieChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPieArcLabelPlot = createTypes(import.meta.url, PieArcLabelPlot); diff --git a/docs/pages/x/api/charts/types.pie-arc-label.ts b/docs/pages/x/api/charts/types.pie-arc-label.ts new file mode 100644 index 0000000000000..a2a4129040ce3 --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-arc-label.ts @@ -0,0 +1,4 @@ +import { PieArcLabel } from '@mui/x-charts/PieChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPieArcLabel = createTypes(import.meta.url, PieArcLabel); diff --git a/docs/pages/x/api/charts/types.pie-arc-plot.ts b/docs/pages/x/api/charts/types.pie-arc-plot.ts new file mode 100644 index 0000000000000..9d23cc47c63d6 --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-arc-plot.ts @@ -0,0 +1,4 @@ +import { PieArcPlot } from '@mui/x-charts/PieChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPieArcPlot = createTypes(import.meta.url, PieArcPlot); diff --git a/docs/pages/x/api/charts/types.pie-arc.ts b/docs/pages/x/api/charts/types.pie-arc.ts new file mode 100644 index 0000000000000..ec76ea0cb8552 --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-arc.ts @@ -0,0 +1,4 @@ +import { PieArc } from '@mui/x-charts/PieChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPieArc = createTypes(import.meta.url, PieArc); diff --git a/docs/pages/x/api/charts/types.pie-chart-pro.ts b/docs/pages/x/api/charts/types.pie-chart-pro.ts new file mode 100644 index 0000000000000..46029cd229ef7 --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-chart-pro.ts @@ -0,0 +1,4 @@ +import { PieChartPro } from '@mui/x-charts-pro/PieChartPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPieChartPro = createTypes(import.meta.url, PieChartPro); diff --git a/docs/pages/x/api/charts/types.pie-chart.md b/docs/pages/x/api/charts/types.pie-chart.md new file mode 100644 index 0000000000000..359043384832e --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-chart.md @@ -0,0 +1,2013 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.pie-chart.md' + +## API Reference + +### FocusedPieArc + +**FocusedPieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color | `string` | - | - | +| cornerRadius | `number` | - | - | +| innerRadius | `number` | - | - | +| outerRadius | `number` | - | - | +| paddingAngle | `number` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | + +### getPieCoordinates + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------------------------------- | :------ | :---------- | +| series | `Pick` | - | - | +| drawing | `Pick` | - | - | + +**Return Value:** + +| Property | Type | Description | +| :---------------- | :------- | :---------- | +| `cx` | `number` | - | +| `cy` | `number` | - | +| `availableRadius` | `number` | - | + +### PieArc + +**PieArc Props:** + +| Prop | Type | Default | Description | +| :-------------- | :---------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| dataIndex\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| innerRadius\* | `number` | - | - | +| isFaded\* | `boolean` | - | - | +| isFocused\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| outerRadius\* | `number` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation | `boolean` | - | If `true`, the animation is disabled. | +| skipInteraction | `boolean` | - | If `true`, the default event handlers are disabled. Those are used, for example, to display a tooltip or highlight the arc on hover. | +| startAngle\* | `number` | - | - | + +### PieArcLabel + +**PieArcLabel Props:** + +| Prop | Type | Default | Description | +| :---------------- | :-------------------- | :------ | :---------- | +| hidden | `boolean` | - | - | +| arcLabelRadius\* | `number` | - | - | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| cornerRadius\* | `number` | - | - | +| endAngle\* | `number` | - | - | +| formattedArcLabel | `string \| null` | - | - | +| isFaded\* | `boolean` | - | - | +| isHighlighted\* | `boolean` | - | - | +| paddingAngle\* | `number` | - | - | +| seriesId\* | `string` | - | - | +| skipAnimation\* | `boolean` | - | - | +| startAngle\* | `number` | - | - | + +### PieArcLabelPlot + +**PieArcLabelPlot Props:** + +| Prop | Type | Default | Description | +| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabel | `'formattedValue' \| 'label' \| 'value' \| ((item: { color: string; id?: PieItemId; hidden: boolean; value: number; labelMarkType?: ChartsLabelMarkType; formattedValue: string; label?: string }) => string)` | - | The label displayed into the arc. | +| arcLabelMinAngle | `number` | `0` | The minimal angle required to display the arc label. | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcLabelPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcLabelPlotSlots` | `{}` | Overridable component slots. | + +### PieArcPlot + +**PieArcPlot Props:** + +| Prop | Type | Default | Description | +| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------- | :------------------------------------------------------------- | +| arcLabelRadius | `number` | `(innerRadius - outerRadius) / 2` | The radius between circle center and the arc label in px. | +| cornerRadius | `number` | `0` | The radius applied to arc corners (similar to border radius). | +| data\* | `DefaultizedPieValueType[]` | - | - | +| faded | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | `{ additionalRadius: -5 }` | Override the arc attributes when it is faded. | +| highlighted | `{ additionalRadius?: number; innerRadius?: number; outerRadius?: number; cornerRadius?: number; paddingAngle?: number; arcLabelRadius?: number; color?: string }` | - | Override the arc attributes when it is highlighted. | +| innerRadius | `number` | `0` | The radius between circle center and the beginning of the arc. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| outerRadius\* | `number` | - | The radius between circle center and the end of the arc. | +| paddingAngle | `number` | `0` | The padding angle (deg) between two arcs. | +| seriesId\* | `string` | - | The id of this series. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PieArcPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieArcPlotSlots` | `{}` | Overridable component slots. | + +### PieChart + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PieChart API](https://mui.com/x/api/charts/pie-chart/) + +**PieChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'pie'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } \| VisibilityIdentifier<'pie'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie arc is clicked. | +| onTooltipItemChange | `((tooltipItem: PieItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| plugins | `[ChartPlugin>, ChartPlugin, ChartPlugin>, ChartPlugin>, ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| series\* | `PieSeries[]` | - | The series to display in the pie chart. An array of \[\[PieSeries]] objects. | +| seriesConfig | `{ pie: { seriesProcessor: SeriesProcessor<'pie'>; seriesLayout?: SeriesLayoutGetter<'pie'>; colorProcessor: ColorProcessor<'pie'>; legendGetter: LegendGetter<'pie'>; tooltipGetter: TooltipGetter<'pie'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; identifierSerializer: IdentifierSerializer<'pie'>; identifierCleaner: IdentifierCleaner<'pie'>; getItemAtPosition?: GetItemAtPosition<'pie'>; descriptionGetter: DescriptionGetter<'pie'>; isHighlightedCreator: HighlightCreator<'pie'>; isFadedCreator: HighlightCreator<'pie'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `PieChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `PieChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `PieItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### PiePlot + +Demos: + +- [Pie](https://mui.com/x/react-charts/pie/) +- [Pie demonstration](https://mui.com/x/react-charts/pie-demo/) + +API: + +- [PiePlot API](https://mui.com/x/api/charts/pie-plot/) + +**PiePlot Props:** + +| Prop | Type | Default | Description | +| :------------ | :------------------------------------------------------------------------------------------------------------------------------------- | :------ | :----------------------------------------- | +| onItemClick | `((event: React.MouseEvent, pieItemIdentifier: PieItemIdentifier, item: DefaultizedPieValueType) => void)` | - | Callback fired when a pie item is clicked. | +| skipAnimation | `boolean` | `false` | If `true`, animations are skipped. | +| slotProps | `PiePlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `PiePlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +## Additional Types + +### PIE_CHART_PLUGINS + +```typescript +type PIE_CHART_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, +]; +``` + +### PieArcLabelPlotProps + +```typescript +type PieArcLabelPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcLabelPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcLabelPlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** The label displayed into the arc. */ + arcLabel?: + | 'formattedValue' + | 'label' + | 'value' + | ((item: { + color: string; + id?: PieItemId; + hidden: boolean; + value: number; + labelMarkType?: ChartsLabelMarkType; + formattedValue: string; + label?: string; + }) => string); + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** + * The minimal angle required to display the arc label. + * @default 0 + */ + arcLabelMinAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcLabelPlotSlotProps + +```typescript +type PieArcLabelPlotSlotProps = { pieArcLabel?: Partial }; +``` + +### PieArcLabelPlotSlots + +```typescript +type PieArcLabelPlotSlots = { pieArcLabel?: React.JSXElementConstructor }; +``` + +### PieArcLabelProps + +```typescript +type PieArcLabelProps = { + seriesId: string; + color: string; + isFaded: boolean; + isHighlighted: boolean; + skipAnimation: boolean; + classes?: Partial; + startAngle: number; + endAngle: number; + arcLabelRadius: number; + cornerRadius: number; + paddingAngle: number; + skipAnimation: boolean; + formattedArcLabel?: string | null; + hidden?: boolean; +}; +``` + +### PieArcOwnerState + +```typescript +type PieArcOwnerState = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; +}; +``` + +### PieArcPlotProps + +```typescript +type PieArcPlotProps = { + /** The id of this series. */ + seriesId: string; + /** + * Override the arc attributes when it is faded. + * @default { additionalRadius: -5 } + */ + faded?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieArcPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieArcPlotSlotProps; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + data: DefaultizedPieValueType[]; + /** + * The radius applied to arc corners (similar to border radius). + * @default 0 + */ + cornerRadius?: number; + /** + * The padding angle (deg) between two arcs. + * @default 0 + */ + paddingAngle?: number; + /** Override the arc attributes when it is highlighted. */ + highlighted?: { + additionalRadius?: number; + innerRadius?: number; + outerRadius?: number; + cornerRadius?: number; + paddingAngle?: number; + arcLabelRadius?: number; + color?: string; + }; + /** + * The radius between circle center and the beginning of the arc. + * @default 0 + */ + innerRadius?: number; + /** The radius between circle center and the end of the arc. */ + outerRadius: number; + /** + * The radius between circle center and the arc label in px. + * @default (innerRadius - outerRadius) / 2 + */ + arcLabelRadius?: number; +}; +``` + +### PieArcPlotSlotProps + +```typescript +type PieArcPlotSlotProps = { pieArc?: Partial }; +``` + +### PieArcPlotSlots + +```typescript +type PieArcPlotSlots = { pieArc?: React.JSXElementConstructor }; +``` + +### PieArcProps + +```typescript +type PieArcProps = { + seriesId: string; + dataIndex: number; + color: string; + isFaded: boolean; + isHighlighted: boolean; + isFocused: boolean; + classes?: Partial; + cornerRadius: number; + endAngle: number; + innerRadius: number; + onClick?: (event: React.MouseEvent) => void; + outerRadius: number; + paddingAngle: number; + startAngle: number; + /** If `true`, the animation is disabled. */ + skipAnimation?: boolean; + /** + * If `true`, the default event handlers are disabled. + * Those are used, for example, to display a tooltip or highlight the arc on hover. + */ + skipInteraction?: boolean; +}; +``` + +### PieChartPluginSignatures + +```typescript +type PieChartPluginSignatures = PieChartPluginSignatures; +``` + +### PieChartProps + +````typescript +type PieChartProps = { + /** + * The series to display in the pie chart. + * An array of [[PieSeries]] objects. + */ + series: PieSeries[]; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** Callback fired when a pie arc is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: PieChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PieChartSlotProps; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + sx?: SxProps; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** Array of plugins used to add features to the chart. */ + plugins?: [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + pie: { + seriesProcessor: SeriesProcessor<'pie'>; + seriesLayout?: SeriesLayoutGetter<'pie'>; + colorProcessor: ColorProcessor<'pie'>; + legendGetter: LegendGetter<'pie'>; + tooltipGetter: TooltipGetter<'pie'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'pie'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'pie'>; + keyboardFocusHandler?: KeyboardFocusHandler<'pie'>; + identifierSerializer: IdentifierSerializer<'pie'>; + identifierCleaner: IdentifierCleaner<'pie'>; + getItemAtPosition?: GetItemAtPosition<'pie'>; + descriptionGetter: DescriptionGetter<'pie'>; + isHighlightedCreator: HighlightCreator<'pie'>; + isFadedCreator: HighlightCreator<'pie'>; + }; + }; + /** Localized text for chart components. */ + localeText?: Partial; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: PieItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: PieItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'pie'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'pie'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'pie'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'pie'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'pie'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'pie' } + | VisibilityIdentifier<'pie'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; +}; +```` + +### PieChartSlotProps + +```typescript +type PieChartSlotProps = { + pieArc?: Partial; + pieArcLabel?: Partial; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item' } + | { anchor?: 'pointer'; trigger?: 'none' } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + sort?: undefined; + } + >; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### PieChartSlots + +```typescript +type PieChartSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'animate' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'mark' + | 'label' + | 'marker' + | 'p' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'line' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'animate' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'mark' + | 'label' + | 'marker' + | 'p' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'line' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item' } + | { anchor?: 'pointer'; trigger?: 'none' } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'animate' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'mark' + | 'label' + | 'marker' + | 'p' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'line' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'animate' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'mark' + | 'label' + | 'marker' + | 'p' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'line' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### pieClasses + +```typescript +type pieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClasses + +```typescript +type PieClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the `g` element that contains all pie arcs of a series. */ + series: string; + /** Styles applied to the `g` element that contains all pie arc labels of a series. */ + seriesLabels: string; + /** Styles applied to an individual pie arc element. */ + arc: string; + /** Styles applied to an individual pie arc label element. */ + arcLabel: string; + /** Styles applied when animation is not skipped. */ + animate: string; + /** Styles applied to the focused pie arc element. */ + focusIndicator: string; +}; +``` + +### PieClassKey + +```typescript +type PieClassKey = + | 'root' + | 'series' + | 'seriesLabels' + | 'arc' + | 'arcLabel' + | 'animate' + | 'focusIndicator'; +``` + +### PiePlotProps + +```typescript +type PiePlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: PiePlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: PiePlotSlotProps; + /** + * If `true`, animations are skipped. + * @default false + */ + skipAnimation?: boolean; + /** Callback fired when a pie item is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + pieItemIdentifier: PieItemIdentifier, + item: DefaultizedPieValueType, + ) => void; +}; +``` + +### PiePlotSlotProps + +```typescript +type PiePlotSlotProps = { pieArc?: Partial; pieArcLabel?: Partial }; +``` + +### PiePlotSlots + +```typescript +type PiePlotSlots = { + pieArc?: React.JSXElementConstructor; + pieArcLabel?: React.JSXElementConstructor; +}; +``` + +### PieSeries + +```typescript +type PieSeries = MakeOptional>, 'type'>; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: unknown; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + color?: string | undefined; + type: 'pie'; + cx?: number | string | undefined; + cy?: number | string | undefined; + cornerRadius?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + paddingAngle?: number | undefined; + startAngle?: number | undefined; + arcLabelRadius?: number | string | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + colorGetter?: unknown | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: unknown; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + color?: string | undefined; + type: 'pie'; + cx?: number | string | undefined; + cy?: number | string | undefined; + cornerRadius?: number | undefined; + endAngle?: number | undefined; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + paddingAngle?: number | undefined; + startAngle?: number | undefined; + arcLabelRadius?: number | string | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + colorGetter?: unknown | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; +}) => { + identifier: { type: 'pie'; seriesId: string; dataIndex: number }; + color: string; + label: string | undefined; + value: unknown; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { pie?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: { type: 'pie'; seriesId: string; dataIndex: number } | null; + seriesLayout: { pie?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + type: 'pie'; + data: unknown; + innerRadius?: number | string | undefined; + outerRadius?: number | string | undefined; + arcLabelRadius?: number | string | undefined; + cornerRadius?: number | undefined; + startAngle?: number | undefined; + endAngle?: number | undefined; + paddingAngle?: number | undefined; + sortingValues?: 'none' | 'asc' | 'desc' | unknown | undefined; + arcLabel?: 'formattedValue' | 'label' | 'value' | unknown | undefined; + arcLabelMinAngle?: number | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + highlighted?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + faded?: + | { + additionalRadius?: number | undefined; + innerRadius?: number | undefined; + outerRadius?: number | undefined; + cornerRadius?: number | undefined; + paddingAngle?: number | undefined; + arcLabelRadius?: number | undefined; + color?: string | undefined; + } + | undefined; + id?: string | undefined; + valueFormatter?: unknown | undefined; + highlightScope?: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | undefined; + labelMarkType?: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + color?: string | undefined; + colorGetter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => unknown; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: { + type: 'pie'; + seriesId: string; + dataIndex: number; +}) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: { type: 'pie'; seriesId: string; dataIndex: number }) => { + type: 'pie'; + seriesId: string; + dataIndex: number; +}; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = ( + state: unknown, + point: { x: number; y: number }, +) => { type: 'pie'; seriesId: string; dataIndex: number } | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + highlight?: 'none' | 'item' | 'series' | undefined; + fade?: 'none' | 'series' | 'global' | undefined; + } + | null + | undefined, + highlightedItem: { type: 'pie'; seriesId: string; dataIndex?: number | undefined } | null, +) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.pie-chart.ts b/docs/pages/x/api/charts/types.pie-chart.ts new file mode 100644 index 0000000000000..db3b65c511b5f --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-chart.ts @@ -0,0 +1,4 @@ +import { PieChart } from '@mui/x-charts/PieChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPieChart = createTypes(import.meta.url, PieChart); diff --git a/docs/pages/x/api/charts/types.pie-plot.ts b/docs/pages/x/api/charts/types.pie-plot.ts new file mode 100644 index 0000000000000..95a4778077bc3 --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-plot.ts @@ -0,0 +1,4 @@ +import { PiePlot } from '@mui/x-charts/PieChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPiePlot = createTypes(import.meta.url, PiePlot); diff --git a/docs/pages/x/api/charts/types.pie-series.ts b/docs/pages/x/api/charts/types.pie-series.ts new file mode 100644 index 0000000000000..cd30e0ea304fc --- /dev/null +++ b/docs/pages/x/api/charts/types.pie-series.ts @@ -0,0 +1,4 @@ +import { PieSeries } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPieSeries = createTypes(import.meta.url, PieSeries); diff --git a/docs/pages/x/api/charts/types.piecewise-color-legend.ts b/docs/pages/x/api/charts/types.piecewise-color-legend.ts new file mode 100644 index 0000000000000..949084f2add01 --- /dev/null +++ b/docs/pages/x/api/charts/types.piecewise-color-legend.ts @@ -0,0 +1,4 @@ +import { PiecewiseColorLegend } from '@mui/x-charts/ChartsLegend'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesPiecewiseColorLegend = createTypes(import.meta.url, PiecewiseColorLegend); diff --git a/docs/pages/x/api/charts/types.radar-axis-highlight.ts b/docs/pages/x/api/charts/types.radar-axis-highlight.ts new file mode 100644 index 0000000000000..3a4315e364420 --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-axis-highlight.ts @@ -0,0 +1,4 @@ +import { RadarAxisHighlight } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarAxisHighlight = createTypes(import.meta.url, RadarAxisHighlight); diff --git a/docs/pages/x/api/charts/types.radar-axis.ts b/docs/pages/x/api/charts/types.radar-axis.ts new file mode 100644 index 0000000000000..2e5f3596b448c --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-axis.ts @@ -0,0 +1,4 @@ +import { RadarAxis } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarAxis = createTypes(import.meta.url, RadarAxis); diff --git a/docs/pages/x/api/charts/types.radar-chart-pro.ts b/docs/pages/x/api/charts/types.radar-chart-pro.ts new file mode 100644 index 0000000000000..4a4db02215fc0 --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-chart-pro.ts @@ -0,0 +1,4 @@ +import { RadarChartPro } from '@mui/x-charts-pro/RadarChartPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarChartPro = createTypes(import.meta.url, RadarChartPro); diff --git a/docs/pages/x/api/charts/types.radar-chart.ts b/docs/pages/x/api/charts/types.radar-chart.ts new file mode 100644 index 0000000000000..9720243c712ce --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-chart.ts @@ -0,0 +1,4 @@ +import { RadarChart } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarChart = createTypes(import.meta.url, RadarChart); diff --git a/docs/pages/x/api/charts/types.radar-grid.ts b/docs/pages/x/api/charts/types.radar-grid.ts new file mode 100644 index 0000000000000..9170b9cbf30b2 --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-grid.ts @@ -0,0 +1,4 @@ +import { RadarGrid } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarGrid = createTypes(import.meta.url, RadarGrid); diff --git a/docs/pages/x/api/charts/types.radar-metric-labels.ts b/docs/pages/x/api/charts/types.radar-metric-labels.ts new file mode 100644 index 0000000000000..1b275ac9945f8 --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-metric-labels.ts @@ -0,0 +1,4 @@ +import { RadarMetricLabels } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarMetricLabels = createTypes(import.meta.url, RadarMetricLabels); diff --git a/docs/pages/x/api/charts/types.radar-series-area.md b/docs/pages/x/api/charts/types.radar-series-area.md new file mode 100644 index 0000000000000..603acd5effeb2 --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-series-area.md @@ -0,0 +1,1830 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.radar-series-area.md' + +## API Reference + +### FocusedRadarMark + +### RadarAxis + +**RadarAxis Props:** + +| Prop | Type | Default | Description | +| :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| angle | `number` | - | The absolute rotation angle of the metrics (in degree) If not defined the metric angle will be used. | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| divisions | `number` | `1` | The number of divisions with label. | +| dominantBaseline | `'auto' \| 'use-script' \| 'no-change' \| 'reset-size' \| 'ideographic' \| 'alphabetic' \| 'hanging' \| 'mathematical' \| 'central' \| 'middle' \| 'text-after-edge' \| 'text-before-edge' \| 'inherit' \| ((angle: number) => 'alphabetic' \| 'hanging' \| 'ideographic' \| 'mathematical' \| 'inherit' \| 'auto' \| 'text-before-edge' \| 'middle' \| 'central' \| 'text-after-edge' \| 'use-script' \| 'no-change' \| 'reset-size' \| undefined)` | - | The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). | +| labelOrientation | `'horizontal' \| 'rotated'` | `'horizontal'` | Defines how label align with the axis. 'horizontal': labels stay horizontal and their placement change with the axis angle.'rotated': labels are rotated 90deg relatively to their axis. | +| metric | `string` | - | The metric to get. If `undefined`, the hook returns `null` | +| textAnchor | `'start' \| 'middle' \| 'end' \| 'inherit' \| ((angle: number) => 'end' \| 'inherit' \| 'middle' \| 'start' \| undefined)` | - | The labels text anchor or a function returning the text anchor for a given axis angle (in degree). | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarAxisHighlight + +**RadarAxisHighlight Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial>` | - | Override or extend the styles applied to the component. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarChart + +Demos: + +- [Radar Chart](https://mui.com/x/react-charts/radar/) + +API: + +- [RadarChart API](https://mui.com/x/api/charts/radar-chart/) + +**RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### RadarDataProvider + +**RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### RadarGrid + +**RadarGrid Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------ | :------------------------------------------------------------------------------------- | :-------------------------------------------------------- | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | + +### RadarMetricLabels + +### RadarSeriesArea + +**RadarSeriesArea Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesMarks + +**RadarSeriesMarks Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onItemClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### RadarSeriesPlot + +**RadarSeriesPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| seriesId | `string` | - | The id of the series to display. If undefined all series are displayed. | +| className | `string` | - | A CSS class name applied to the root element. | + +### Unstable_RadarChart + +**Unstable_RadarChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| divisions | `number` | `5` | The number of divisions in the radar grid. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| highlightedItem | `{ type: 'radar'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| initialHiddenItems | `({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } \| VisibilityIdentifier<'radar'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAreaClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when an area is clicked. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onMarkClick | `((event: React.MouseEvent, radarItemIdentifier: RadarClickIdentifier) => void)` | - | Callback fired when a mark is clicked. | +| onTooltipItemChange | `((tooltipItem: RadarItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| shape | `'sharp' \| 'circular'` | `'sharp'` | The grid shape. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `RadarChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `RadarChartSlots` | `{}` | Overridable component slots. | +| stripeColor | `((index: number) => string) \| null` | `(index) => index % 2 === 1 ? (theme.vars \|\| theme).palette.text.secondary : 'none'` | Get stripe fill color. Set it to `null` to remove stripes | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `RadarItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | A CSS class name applied to the root element. | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### Unstable_RadarDataProvider + +**Unstable_RadarDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| experimentalFeatures | `{}` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlight | `'axis' \| 'series' \| 'none'` | `'axis'` | Indicates if the chart should highlight items per axis or per series. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `number \| Partial` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| plugins | `[] \| [ChartPlugin]` | - | Array of plugins used to add features to the chart. | +| radar\* | `RadarConfig` | - | The configuration of the radar scales. | +| series\* | `Readonly[]` | - | The series to display in the bar chart. An array of \[\[RadarSeries]] objects. | +| seriesConfig | `{ radar: ChartSeriesTypeConfig<'radar'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `Partial` | - | The props for the slots. | +| slots | `Partial` | - | Slots to customize charts' components. | +| theme | `'light' \| 'dark'` | - | - | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `string \| number \| bigint \| boolean \| ReactElement \| Iterable \| React.ReactPortal \| Promise \| null` | - | - | + +### useRadarAxis + +Returns an array with one item per metric with the different points to label. + +**useRadarAxis Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------- | :------ | :---------- | +| params | `UseRadarAxisParams` | - | - | + +**useRadarAxis Return Value:** + +```tsx +type ReturnValue = { + metric: string; + angle: number; + center: { x: number; y: number }; + labels: { x: number; y: number; value: number | Date; formattedValue: string }[]; +} | null; +``` + +## Additional Types + +### RADAR_PLUGINS + +```typescript +type RADAR_PLUGINS = [ + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, +]; +``` + +### RadarAxisHighlightProps + +```typescript +type RadarAxisHighlightProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial< + Pick + >; +}; +``` + +### RadarAxisProps + +```typescript +type RadarAxisProps = { + /** + * Defines how label align with the axis. + * - 'horizontal': labels stay horizontal and their placement change with the axis angle. + * - 'rotated': labels are rotated 90deg relatively to their axis. + * @default 'horizontal' + */ + labelOrientation?: 'horizontal' | 'rotated'; + /** The labels text anchor or a function returning the text anchor for a given axis angle (in degree). */ + textAnchor?: + | 'start' + | 'middle' + | 'end' + | 'inherit' + | ((angle: number) => 'end' | 'inherit' | 'middle' | 'start' | undefined); + /** The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree). */ + dominantBaseline?: + | 'auto' + | 'use-script' + | 'no-change' + | 'reset-size' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'central' + | 'middle' + | 'text-after-edge' + | 'text-before-edge' + | 'inherit' + | (( + angle: number, + ) => + | 'alphabetic' + | 'hanging' + | 'ideographic' + | 'mathematical' + | 'inherit' + | 'auto' + | 'text-before-edge' + | 'middle' + | 'central' + | 'text-after-edge' + | 'use-script' + | 'no-change' + | 'reset-size' + | undefined); + /** A CSS class name applied to the root element. */ + className?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial>; + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +### RadarChartPluginSignatures + +```typescript +type RadarChartPluginSignatures = RadarChartPluginSignatures; +``` + +### RadarChartProps + +````typescript +type RadarChartProps = { + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: RadarChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: RadarChartSlotProps; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + children?: React.ReactNode; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: RadarItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: RadarItemIdentifier | null) => void; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'radar'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'radar'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'radar'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'radar'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'radar'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'radar'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'radar' } + | VisibilityIdentifier<'radar'> + )[]; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + sx?: SxProps; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; +}; +```` + +### RadarChartSlotProps + +```typescript +type RadarChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### RadarChartSlots + +```typescript +type RadarChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'data' + | 'label' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'data' + | 'label' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'data' + | 'label' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'data' + | 'label' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### radarClasses + +```typescript +type radarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClasses + +```typescript +type RadarClasses = { + /** Styles applied to the radar axis root element. */ + axisRoot: string; + /** Styles applied to the radar axis line element. */ + axisLine: string; + /** Styles applied to every radar axis label element. */ + axisLabel: string; + /** Styles applied to every radial line element of the grid. */ + gridRadial: string; + /** Styles applied to every divider element of the grid. */ + gridDivider: string; + /** Styles applied to every stripe element of the grid. */ + gridStripe: string; + /** Styles applied to the series plot root element. */ + seriesRoot: string; + /** Styles applied to the series area element. */ + seriesArea: string; + /** Styles applied to the series mark element. */ + seriesMark: string; + /** Styles applied to the axis highlight root element. */ + axisHighlightRoot: string; + /** Styles applied to the axis highlight line element. */ + axisHighlightLine: string; + /** Styles applied to every axis highlight dot element. */ + axisHighlightDot: string; +}; +``` + +### RadarClassKey + +```typescript +type RadarClassKey = + | 'axisLine' + | 'axisLabel' + | 'axisRoot' + | 'gridRadial' + | 'gridDivider' + | 'gridStripe' + | 'seriesRoot' + | 'seriesArea' + | 'seriesMark' + | 'axisHighlightRoot' + | 'axisHighlightLine' + | 'axisHighlightDot'; +``` + +### RadarDataProviderProps + +```typescript +type RadarDataProviderProps< + TSignatures extends ChartAnyPluginSignature[] = RadarChartPluginSignatures, +> = { + /** Array of plugins used to add features to the chart. */ + plugins?: [] | [ChartPlugin]; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { radar: ChartSeriesTypeConfig<'radar'> }; + children?: + | string + | number + | bigint + | boolean + | ReactElement + | Iterable + | React.ReactPortal + | Promise + | null; + /** Localized text for chart components. */ + localeText?: Partial; + /** Slots to customize charts' components. */ + slots?: Partial; + /** The props for the slots. */ + slotProps?: Partial; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: {}; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: number | Partial; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** + * The series to display in the bar chart. + * An array of [[RadarSeries]] objects. + */ + series: Readonly[]; + /** The configuration of the radar scales. */ + radar: RadarConfig; + /** + * Indicates if the chart should highlight items per axis or per series. + * @default 'axis' + */ + highlight?: 'axis' | 'series' | 'none'; +}; +``` + +### RadarGridProps + +```typescript +type RadarGridProps = { + /** + * The number of divisions in the radar grid. + * @default 5 + */ + divisions?: number; + /** + * The grid shape. + * @default 'sharp' + */ + shape?: 'sharp' | 'circular'; + /** + * Get stripe fill color. Set it to `null` to remove stripes + * @default (index) => index % 2 === 1 ? (theme.vars || theme).palette.text.secondary : 'none' + * @returns The color to fill the stripe. + */ + stripeColor?: ((index: number) => string) | null; +}; +``` + +### RadarSeries + +```typescript +type RadarSeries = { + /** The id of this series. */ + id?: SeriesId; + data: number[]; + /** The label to display on the tooltip or the legend. It can be a string or a function. */ + label?: string | ((location: 'tooltip' | 'legend') => string); + /** If `true` hide marks at value position. */ + hideMark?: boolean; + /** If `true` fill the series area. */ + fillArea?: boolean; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The string to display or null if the value should not be shown. + */ + valueFormatter?: SeriesValueFormatter; + /** The scope to apply when the series is highlighted. */ + highlightScope?: HighlightScope<'radar' | 'bar' | 'line' | 'scatter' | 'pie'>; + /** + * Defines the mark type for the series. + * + * There is a default mark type for each series type. + */ + labelMarkType?: ChartsLabelMarkType; + /** + * Color to use when displaying the series. + * If `colorGetter` is provided, it will be used to get the color for each data point instead. + * Otherwise, this color will be used for all data points in the series. + */ + color?: string; + /** + * A function that returns a color based on the value and/or the data index of a point. + * The returned color is used when displaying the specific data point, e.g., a marker in a line chart. + * When the color of the entire series is required, e.g., in legends, the `color` property is used instead. + * @returns The color to use for the specific data point. + */ + colorGetter?: (data: ColorCallbackValue) => string; + type?: 'radar'; +}; +``` + +### RadarSeriesAreaProps + +```typescript +type RadarSeriesAreaProps = { + /** Callback fired when an area is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesMarksProps + +```typescript +type RadarSeriesMarksProps = { + /** Callback fired when a mark is clicked. */ + onItemClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### RadarSeriesPlotProps + +```typescript +type RadarSeriesPlotProps = { + /** Callback fired when an area is clicked. */ + onAreaClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** Callback fired when a mark is clicked. */ + onMarkClick?: ( + event: React.MouseEvent, + radarItemIdentifier: RadarClickIdentifier, + ) => void; + /** A CSS class name applied to the root element. */ + className?: string; + /** + * The id of the series to display. + * If undefined all series are displayed. + */ + seriesId?: string; + /** Override or extend the styles applied to the component. */ + classes?: Partial; +}; +``` + +### UseRadarAxisParams + +```typescript +type UseRadarAxisParams = { + /** + * The metric to get. + * If `undefined`, the hook returns `null` + */ + metric?: string; + /** + * The absolute rotation angle of the metrics (in degree) + * If not defined the metric angle will be used. + */ + angle?: number; + /** + * The number of divisions with label. + * @default 1 + */ + divisions?: number; +}; +``` + +## External Types + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: any; + params: any; + store: { state: any; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### SeriesValueFormatter + +```typescript +type SeriesValueFormatter = (value: number, context: { dataIndex: number }) => string | null; +``` diff --git a/docs/pages/x/api/charts/types.radar-series-area.ts b/docs/pages/x/api/charts/types.radar-series-area.ts new file mode 100644 index 0000000000000..14d2723be5445 --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-series-area.ts @@ -0,0 +1,4 @@ +import { RadarSeriesArea } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarSeriesArea = createTypes(import.meta.url, RadarSeriesArea); diff --git a/docs/pages/x/api/charts/types.radar-series-marks.ts b/docs/pages/x/api/charts/types.radar-series-marks.ts new file mode 100644 index 0000000000000..015075f9bee1f --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-series-marks.ts @@ -0,0 +1,4 @@ +import { RadarSeriesMarks } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarSeriesMarks = createTypes(import.meta.url, RadarSeriesMarks); diff --git a/docs/pages/x/api/charts/types.radar-series-plot.ts b/docs/pages/x/api/charts/types.radar-series-plot.ts new file mode 100644 index 0000000000000..b246b70fb9dce --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-series-plot.ts @@ -0,0 +1,4 @@ +import { RadarSeriesPlot } from '@mui/x-charts/RadarChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarSeriesPlot = createTypes(import.meta.url, RadarSeriesPlot); diff --git a/docs/pages/x/api/charts/types.radar-series.ts b/docs/pages/x/api/charts/types.radar-series.ts new file mode 100644 index 0000000000000..f6ce7da689e3a --- /dev/null +++ b/docs/pages/x/api/charts/types.radar-series.ts @@ -0,0 +1,4 @@ +import { RadarSeries } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRadarSeries = createTypes(import.meta.url, RadarSeries); diff --git a/docs/pages/x/api/charts/types.range-bar-plot.ts b/docs/pages/x/api/charts/types.range-bar-plot.ts new file mode 100644 index 0000000000000..fd5bfdfdc8901 --- /dev/null +++ b/docs/pages/x/api/charts/types.range-bar-plot.ts @@ -0,0 +1,4 @@ +import { RangeBarPlot } from '@mui/x-charts-premium/BarChartPremium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesRangeBarPlot = createTypes(import.meta.url, RangeBarPlot); diff --git a/docs/pages/x/api/charts/types.sankey-chart.md b/docs/pages/x/api/charts/types.sankey-chart.md new file mode 100644 index 0000000000000..be8a7308365ff --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-chart.md @@ -0,0 +1,2559 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.sankey-chart.md' + +## API Reference + +### FocusedSankeyLink + +### FocusedSankeyNode + +### SankeyChart + +Sankey Chart component + +Displays a Sankey diagram, visualizing flows between nodes where the width +of the links is proportional to the flow quantity. + +Demos: + +- [Sankey Chart](https://mui.com/x/react-charts/sankey/) + +API: + +- [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/) + +**SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyDataProvider + +Orchestrates the data providers for the sankey chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +**SankeyDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeriesType[]` | - | - | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyLinkLabelPlot + +**SankeyLinkLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyLinkPlot + +**SankeyLinkPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodeLabelPlot + +**SankeyNodeLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodePlot + +**SankeyNodePlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyPlot + +Renders a Sankey diagram plot. + +**SankeyPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| className | `string` | - | A CSS class name applied to the root element. | + +### SankeyTooltip + +**SankeyTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### SankeyTooltipContent + +**SankeyTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### Unstable_SankeyChart + +**Unstable_SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### useSankeyLayout + +Get access to the sankey layout. + +**useSankeyLayout Return Value:** + +the sankey layout + +```tsx +type ReturnValue = SankeyLayout | undefined; +``` + +### useSankeyLinkHighlightState + +**useSankeyLinkHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| linkIdentifier | `SankeyLinkIdentifier` | - | - | + +**useSankeyLinkHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeyNodeHighlightState + +**useSankeyNodeHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| nodeIdentifier | `SankeyNodeIdentifier` | - | - | + +**useSankeyNodeHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeySeries + +Get access to the internal state of sankey series. + +**useSankeySeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useSankeySeries Return Value:** + +the sankey series + +```tsx +type ReturnValue = DefaultizedSankeySeriesType | undefined; +``` + +### useSankeySeriesContext + +Get access to the internal state of sankey series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useSankeySeriesContext Return Value:** + +the sankey series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +## Additional Types + +### DefaultizedSankeySeriesType + +```typescript +type DefaultizedSankeySeriesType = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyChartProps + +```typescript +type SankeyChartProps = { + /** + * The series to display in the Sankey chart. + * A single object is expected. + */ + series: SankeySeries; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotExtension + +```typescript +type SankeyChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotProps + +```typescript +type SankeyChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### SankeyChartSlots + +```typescript +type SankeyChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### sankeyClasses + +```typescript +type sankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClasses + +```typescript +type SankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClassKey + +```typescript +type SankeyClassKey = + | 'link' + | 'nodes' + | 'links' + | 'node' + | 'root' + | 'nodeLabels' + | 'linkLabels' + | 'nodeLabel' + | 'linkLabel'; +``` + +### SankeyData + +```typescript +type SankeyData = { + /** + * An array of node configs for the Sankey diagram + * + * This is optional, but can be used to provide custom labels or styles for nodes. + */ + nodes?: SankeyNode[]; + /** + * Array of links between nodes. + * + * The node ids will be used as the labels. If you want to provide custom labels, use the `nodes` property. + * + * Each link should have a `source`, `target`, and `value` property. + */ + links: SankeyLink[]; +}; +``` + +### SankeyDataProviderProps + +```typescript +type SankeyDataProviderProps = { + children?: React.ReactNode; + series: SankeySeriesType[]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; +}; +``` + +### SankeyItemIdentifier + +```typescript +type SankeyItemIdentifier = SankeyNodeIdentifier | SankeyLinkIdentifier; +``` + +### SankeyItemIdentifierWithData + +```typescript +type SankeyItemIdentifierWithData = + | SankeyNodeIdentifierWithData + | SankeyLinkIdentifierWithData; +``` + +### SankeyLayout + +Calculated layout for the Sankey diagram + +```typescript +type SankeyLayout = { + nodes: SankeyLayoutNode[]; + links: SankeyLayoutLink[]; +}; +``` + +### SankeyLayoutLink + +Represents the calculated positions and paths for a link in the Sankey diagram + +```typescript +type SankeyLayoutLink = { + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithoutPosition + +```typescript +type SankeyLayoutLinkWithoutPosition = { + source: SankeyLayoutNodeWithoutPosition; + target: SankeyLayoutNodeWithoutPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithPosition + +```typescript +type SankeyLayoutLinkWithPosition = { + path?: string | null; + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; + /** Link's vertical starting position (at source node) calculated by Sankey layout generator. */ + y0?: number; + /** Link's vertical end position (at target node) calculated by Sankey layout generator. */ + y1?: number; + /** Link's width (proportional to its value) calculated by Sankey layout generator. */ + width?: number; +}; +``` + +### SankeyLayoutNode + +Represents the calculated positions and dimensions for a node in the Sankey diagram + +```typescript +type SankeyLayoutNode = { + targetLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithoutPosition + +```typescript +type SankeyLayoutNodeWithoutPosition = { + targetLinks: SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithPosition + +```typescript +type SankeyLayoutNodeWithPosition = { + targetLinks: SankeyLayoutLinkWithPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; + /** Node's minimum horizontal position (derived from the node.depth) calculated by Sankey layout generator. */ + x0?: number; + /** Node's maximum horizontal position (node.x0 + sankey.nodeWidth) calculated by Sankey layout generator. */ + x1?: number; + /** Node's minimum vertical position calculated by Sankey layout generator. */ + y0?: number; + /** Node's maximum vertical position (node.y1 - node.y0 is proportional to node.value) calculated by Sankey layout generator. */ + y1?: number; +}; +``` + +### SankeyLink + +```typescript +type SankeyLink = { + /** Source node ID */ + source: SankeyNodeId; + /** Target node ID */ + target: SankeyNodeId; + /** The value/weight of the link (affects width) */ + value: number; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; +}; +``` + +### SankeyLinkIdentifier + +```typescript +type SankeyLinkIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; +}; +``` + +### SankeyLinkIdentifierWithData + +```typescript +type SankeyLinkIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; + /** The link object with all the calculated properties */ + link: SankeyLayoutLink; +}; +``` + +### SankeyLinkLabelPlotProps + +```typescript +type SankeyLinkLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyLinkOptions + +```typescript +type SankeyLinkOptions = { + /** + * Default color for links without specified colors. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; + /** Opacity of the links (0-1) */ + opacity?: number; + /** Whether to show link values */ + showValues?: boolean; + /** + * Custom sort mode for links + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the links array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutLink, b: SankeyLayoutLink) => number); + /** + * Applies the given number to the X dimension of the control points of the link's curve function. + * This can create better looking links between nodes, but is dependent on the graph layout. + * It is specially impacted by the chart height. + * @default 10 + */ + curveCorrection?: number; + /** + * Highlight mode for links + * - 'links': Highlight hovered link + * - 'nodes': Highlight nodes connected to hovered link + * - 'source': Highlight source node of hovered link + * - 'target': Highlight target node of hovered link + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyLinkHighlight; + /** + * Fade mode for links + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyLinkFade; +}; +``` + +### SankeyLinkPlotProps + +```typescript +type SankeyLinkPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeyNode + +```typescript +type SankeyNode = { + /** Unique identifier for the node */ + id: SankeyNodeId; + /** The node label to display */ + label?: string; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color?: string; +}; +``` + +### SankeyNodeId + +```typescript +type SankeyNodeId = string | number; +``` + +### SankeyNodeIdentifier + +```typescript +type SankeyNodeIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; +}; +``` + +### SankeyNodeIdentifierWithData + +```typescript +type SankeyNodeIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; + /** The node object with all the calculated properties */ + node: SankeyLayoutNode; +}; +``` + +### SankeyNodeLabelPlotProps + +```typescript +type SankeyNodeLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyNodeOptions + +```typescript +type SankeyNodeOptions = { + /** Default color for nodes without specified colors */ + color?: string; + /** Width of the nodes in pixels */ + width?: number; + /** Padding between nodes in pixels */ + padding?: number; + /** + * Node alignment strategy + * - 'justify': Nodes are evenly distributed across the width. + * - 'left': Nodes are aligned to the left. + * - 'right': Nodes are aligned to the right. + * - 'center': Nodes are centered. + * @default 'justify' + */ + align?: 'justify' | 'left' | 'right' | 'center'; + /** Whether to show node labels */ + showLabels?: boolean; + /** + * Custom sort mode for nodes + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the nodes array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutNode, b: SankeyLayoutNode) => number); + /** + * Highlight mode for nodes + * - 'nodes': Highlight hovered node + * - 'links': Highlight links connected to hovered node + * - 'incoming': Highlight incoming links to hovered node + * - 'outgoing': Highlight outgoing links from hovered node + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyNodeHighlight; + /** + * Fade mode for nodes + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyNodeFade; +}; +``` + +### SankeyNodePlotProps + +```typescript +type SankeyNodePlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; +}; +``` + +### SankeyPlotProps + +```typescript +type SankeyPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeySeries + +```typescript +type SankeySeries = { + /** Unique identifier for the series */ + id?: string; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; + /** Type identifier for Sankey series */ + type?: 'sankey'; +}; +``` + +### SankeySeriesType + +```typescript +type SankeySeriesType = { + /** Unique identifier for the series */ + id?: string; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyTooltipClasses + +```typescript +type SankeyTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipContentClasses + +```typescript +type SankeyTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipProps + +```typescript +type SankeyTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; +}; +``` + +### SankeyTooltipSlotProps + +```typescript +type SankeyTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SankeyTooltipSlots + +```typescript +type SankeyTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### SankeyValueFormatterContext + +```typescript +type SankeyValueFormatterContext = + | { location: 'tooltip' | 'label'; type: 'node'; nodeId: SankeyNodeId } + | { location: 'tooltip' | 'label'; type: 'link'; sourceId: SankeyNodeId; targetId: SankeyNodeId }; +``` + +### UseSankeySeriesContextReturnValue + +```typescript +type UseSankeySeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseSankeySeriesLayoutReturnValue + +```typescript +type UseSankeySeriesLayoutReturnValue = { sankeyLayout: SankeyLayout }; +``` + +### UseSankeySeriesReturnValue + +```typescript +type UseSankeySeriesReturnValue = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +## External Types + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: unknown | null; +}) => { + identifier: unknown; + color: string; + label: string | undefined; + value: number; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { sankey?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: unknown | null; + seriesLayout: { sankey?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + id?: string | undefined; + type: 'sankey'; + data: { nodes?: unknown | undefined; links: unknown }; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + valueFormatter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; +}; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: unknown) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: unknown) => unknown; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = (state: unknown, point: { x: number; y: number }) => unknown | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + } + | null + | undefined, + highlightedItem: unknown | null, +) => unknown; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.sankey-chart.ts b/docs/pages/x/api/charts/types.sankey-chart.ts new file mode 100644 index 0000000000000..2803ae579766c --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-chart.ts @@ -0,0 +1,4 @@ +import { SankeyChart } from '@mui/x-charts-pro/SankeyChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesSankeyChart = createTypes(import.meta.url, SankeyChart); diff --git a/docs/pages/x/api/charts/types.sankey-data-provider.md b/docs/pages/x/api/charts/types.sankey-data-provider.md new file mode 100644 index 0000000000000..ab420b336c11f --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-data-provider.md @@ -0,0 +1,2559 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.sankey-data-provider.md' + +## API Reference + +### FocusedSankeyLink + +### FocusedSankeyNode + +### SankeyChart + +Sankey Chart component + +Displays a Sankey diagram, visualizing flows between nodes where the width +of the links is proportional to the flow quantity. + +Demos: + +- [Sankey Chart](https://mui.com/x/react-charts/sankey/) + +API: + +- [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/) + +**SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyDataProvider + +Orchestrates the data providers for the sankey chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +**SankeyDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeriesType[]` | - | - | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyLinkLabelPlot + +**SankeyLinkLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyLinkPlot + +**SankeyLinkPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodeLabelPlot + +**SankeyNodeLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodePlot + +**SankeyNodePlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyPlot + +Renders a Sankey diagram plot. + +**SankeyPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| className | `string` | - | A CSS class name applied to the root element. | + +### SankeyTooltip + +**SankeyTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### SankeyTooltipContent + +**SankeyTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### Unstable_SankeyChart + +**Unstable_SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### useSankeyLayout + +Get access to the sankey layout. + +**useSankeyLayout Return Value:** + +the sankey layout + +```tsx +type ReturnValue = SankeyLayout | undefined; +``` + +### useSankeyLinkHighlightState + +**useSankeyLinkHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| linkIdentifier | `SankeyLinkIdentifier` | - | - | + +**useSankeyLinkHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeyNodeHighlightState + +**useSankeyNodeHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| nodeIdentifier | `SankeyNodeIdentifier` | - | - | + +**useSankeyNodeHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeySeries + +Get access to the internal state of sankey series. + +**useSankeySeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useSankeySeries Return Value:** + +the sankey series + +```tsx +type ReturnValue = DefaultizedSankeySeriesType | undefined; +``` + +### useSankeySeriesContext + +Get access to the internal state of sankey series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useSankeySeriesContext Return Value:** + +the sankey series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +## Additional Types + +### DefaultizedSankeySeriesType + +```typescript +type DefaultizedSankeySeriesType = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyChartProps + +```typescript +type SankeyChartProps = { + /** + * The series to display in the Sankey chart. + * A single object is expected. + */ + series: SankeySeries; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotExtension + +```typescript +type SankeyChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotProps + +```typescript +type SankeyChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### SankeyChartSlots + +```typescript +type SankeyChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### sankeyClasses + +```typescript +type sankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClasses + +```typescript +type SankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClassKey + +```typescript +type SankeyClassKey = + | 'link' + | 'nodes' + | 'links' + | 'node' + | 'root' + | 'nodeLabels' + | 'linkLabels' + | 'nodeLabel' + | 'linkLabel'; +``` + +### SankeyData + +```typescript +type SankeyData = { + /** + * An array of node configs for the Sankey diagram + * + * This is optional, but can be used to provide custom labels or styles for nodes. + */ + nodes?: SankeyNode[]; + /** + * Array of links between nodes. + * + * The node ids will be used as the labels. If you want to provide custom labels, use the `nodes` property. + * + * Each link should have a `source`, `target`, and `value` property. + */ + links: SankeyLink[]; +}; +``` + +### SankeyDataProviderProps + +```typescript +type SankeyDataProviderProps = { + children?: React.ReactNode; + series: SankeySeriesType[]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; +}; +``` + +### SankeyItemIdentifier + +```typescript +type SankeyItemIdentifier = SankeyNodeIdentifier | SankeyLinkIdentifier; +``` + +### SankeyItemIdentifierWithData + +```typescript +type SankeyItemIdentifierWithData = + | SankeyNodeIdentifierWithData + | SankeyLinkIdentifierWithData; +``` + +### SankeyLayout + +Calculated layout for the Sankey diagram + +```typescript +type SankeyLayout = { + nodes: SankeyLayoutNode[]; + links: SankeyLayoutLink[]; +}; +``` + +### SankeyLayoutLink + +Represents the calculated positions and paths for a link in the Sankey diagram + +```typescript +type SankeyLayoutLink = { + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithoutPosition + +```typescript +type SankeyLayoutLinkWithoutPosition = { + source: SankeyLayoutNodeWithoutPosition; + target: SankeyLayoutNodeWithoutPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithPosition + +```typescript +type SankeyLayoutLinkWithPosition = { + path?: string | null; + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; + /** Link's vertical starting position (at source node) calculated by Sankey layout generator. */ + y0?: number; + /** Link's vertical end position (at target node) calculated by Sankey layout generator. */ + y1?: number; + /** Link's width (proportional to its value) calculated by Sankey layout generator. */ + width?: number; +}; +``` + +### SankeyLayoutNode + +Represents the calculated positions and dimensions for a node in the Sankey diagram + +```typescript +type SankeyLayoutNode = { + targetLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithoutPosition + +```typescript +type SankeyLayoutNodeWithoutPosition = { + targetLinks: SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithPosition + +```typescript +type SankeyLayoutNodeWithPosition = { + targetLinks: SankeyLayoutLinkWithPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; + /** Node's minimum horizontal position (derived from the node.depth) calculated by Sankey layout generator. */ + x0?: number; + /** Node's maximum horizontal position (node.x0 + sankey.nodeWidth) calculated by Sankey layout generator. */ + x1?: number; + /** Node's minimum vertical position calculated by Sankey layout generator. */ + y0?: number; + /** Node's maximum vertical position (node.y1 - node.y0 is proportional to node.value) calculated by Sankey layout generator. */ + y1?: number; +}; +``` + +### SankeyLink + +```typescript +type SankeyLink = { + /** Source node ID */ + source: SankeyNodeId; + /** Target node ID */ + target: SankeyNodeId; + /** The value/weight of the link (affects width) */ + value: number; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; +}; +``` + +### SankeyLinkIdentifier + +```typescript +type SankeyLinkIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; +}; +``` + +### SankeyLinkIdentifierWithData + +```typescript +type SankeyLinkIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; + /** The link object with all the calculated properties */ + link: SankeyLayoutLink; +}; +``` + +### SankeyLinkLabelPlotProps + +```typescript +type SankeyLinkLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyLinkOptions + +```typescript +type SankeyLinkOptions = { + /** + * Default color for links without specified colors. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; + /** Opacity of the links (0-1) */ + opacity?: number; + /** Whether to show link values */ + showValues?: boolean; + /** + * Custom sort mode for links + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the links array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutLink, b: SankeyLayoutLink) => number); + /** + * Applies the given number to the X dimension of the control points of the link's curve function. + * This can create better looking links between nodes, but is dependent on the graph layout. + * It is specially impacted by the chart height. + * @default 10 + */ + curveCorrection?: number; + /** + * Highlight mode for links + * - 'links': Highlight hovered link + * - 'nodes': Highlight nodes connected to hovered link + * - 'source': Highlight source node of hovered link + * - 'target': Highlight target node of hovered link + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyLinkHighlight; + /** + * Fade mode for links + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyLinkFade; +}; +``` + +### SankeyLinkPlotProps + +```typescript +type SankeyLinkPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeyNode + +```typescript +type SankeyNode = { + /** Unique identifier for the node */ + id: SankeyNodeId; + /** The node label to display */ + label?: string; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color?: string; +}; +``` + +### SankeyNodeId + +```typescript +type SankeyNodeId = string | number; +``` + +### SankeyNodeIdentifier + +```typescript +type SankeyNodeIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; +}; +``` + +### SankeyNodeIdentifierWithData + +```typescript +type SankeyNodeIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; + /** The node object with all the calculated properties */ + node: SankeyLayoutNode; +}; +``` + +### SankeyNodeLabelPlotProps + +```typescript +type SankeyNodeLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyNodeOptions + +```typescript +type SankeyNodeOptions = { + /** Default color for nodes without specified colors */ + color?: string; + /** Width of the nodes in pixels */ + width?: number; + /** Padding between nodes in pixels */ + padding?: number; + /** + * Node alignment strategy + * - 'justify': Nodes are evenly distributed across the width. + * - 'left': Nodes are aligned to the left. + * - 'right': Nodes are aligned to the right. + * - 'center': Nodes are centered. + * @default 'justify' + */ + align?: 'justify' | 'left' | 'right' | 'center'; + /** Whether to show node labels */ + showLabels?: boolean; + /** + * Custom sort mode for nodes + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the nodes array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutNode, b: SankeyLayoutNode) => number); + /** + * Highlight mode for nodes + * - 'nodes': Highlight hovered node + * - 'links': Highlight links connected to hovered node + * - 'incoming': Highlight incoming links to hovered node + * - 'outgoing': Highlight outgoing links from hovered node + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyNodeHighlight; + /** + * Fade mode for nodes + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyNodeFade; +}; +``` + +### SankeyNodePlotProps + +```typescript +type SankeyNodePlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; +}; +``` + +### SankeyPlotProps + +```typescript +type SankeyPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeySeries + +```typescript +type SankeySeries = { + /** Unique identifier for the series */ + id?: string; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; + /** Type identifier for Sankey series */ + type?: 'sankey'; +}; +``` + +### SankeySeriesType + +```typescript +type SankeySeriesType = { + /** Unique identifier for the series */ + id?: string; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyTooltipClasses + +```typescript +type SankeyTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipContentClasses + +```typescript +type SankeyTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipProps + +```typescript +type SankeyTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; +}; +``` + +### SankeyTooltipSlotProps + +```typescript +type SankeyTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SankeyTooltipSlots + +```typescript +type SankeyTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### SankeyValueFormatterContext + +```typescript +type SankeyValueFormatterContext = + | { location: 'tooltip' | 'label'; type: 'node'; nodeId: SankeyNodeId } + | { location: 'tooltip' | 'label'; type: 'link'; sourceId: SankeyNodeId; targetId: SankeyNodeId }; +``` + +### UseSankeySeriesContextReturnValue + +```typescript +type UseSankeySeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseSankeySeriesLayoutReturnValue + +```typescript +type UseSankeySeriesLayoutReturnValue = { sankeyLayout: SankeyLayout }; +``` + +### UseSankeySeriesReturnValue + +```typescript +type UseSankeySeriesReturnValue = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +## External Types + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: unknown | null; +}) => { + identifier: unknown; + color: string; + label: string | undefined; + value: number; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { sankey?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: unknown | null; + seriesLayout: { sankey?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + id?: string | undefined; + type: 'sankey'; + data: { nodes?: unknown | undefined; links: unknown }; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + valueFormatter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; +}; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: unknown) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: unknown) => unknown; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = (state: unknown, point: { x: number; y: number }) => unknown | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + } + | null + | undefined, + highlightedItem: unknown | null, +) => unknown; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.sankey-data-provider.ts b/docs/pages/x/api/charts/types.sankey-data-provider.ts new file mode 100644 index 0000000000000..0a65524ec401d --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-data-provider.ts @@ -0,0 +1,4 @@ +import { SankeyDataProvider } from '@mui/x-charts-pro/SankeyChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesSankeyDataProvider = createTypes(import.meta.url, SankeyDataProvider); diff --git a/docs/pages/x/api/charts/types.sankey-plot.md b/docs/pages/x/api/charts/types.sankey-plot.md new file mode 100644 index 0000000000000..4b58201fca537 --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-plot.md @@ -0,0 +1,2559 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.sankey-plot.md' + +## API Reference + +### FocusedSankeyLink + +### FocusedSankeyNode + +### SankeyChart + +Sankey Chart component + +Displays a Sankey diagram, visualizing flows between nodes where the width +of the links is proportional to the flow quantity. + +Demos: + +- [Sankey Chart](https://mui.com/x/react-charts/sankey/) + +API: + +- [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/) + +**SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyDataProvider + +Orchestrates the data providers for the sankey chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +**SankeyDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeriesType[]` | - | - | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyLinkLabelPlot + +**SankeyLinkLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyLinkPlot + +**SankeyLinkPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodeLabelPlot + +**SankeyNodeLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodePlot + +**SankeyNodePlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyPlot + +Renders a Sankey diagram plot. + +**SankeyPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| className | `string` | - | A CSS class name applied to the root element. | + +### SankeyTooltip + +**SankeyTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### SankeyTooltipContent + +**SankeyTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### Unstable_SankeyChart + +**Unstable_SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### useSankeyLayout + +Get access to the sankey layout. + +**useSankeyLayout Return Value:** + +the sankey layout + +```tsx +type ReturnValue = SankeyLayout | undefined; +``` + +### useSankeyLinkHighlightState + +**useSankeyLinkHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| linkIdentifier | `SankeyLinkIdentifier` | - | - | + +**useSankeyLinkHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeyNodeHighlightState + +**useSankeyNodeHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| nodeIdentifier | `SankeyNodeIdentifier` | - | - | + +**useSankeyNodeHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeySeries + +Get access to the internal state of sankey series. + +**useSankeySeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useSankeySeries Return Value:** + +the sankey series + +```tsx +type ReturnValue = DefaultizedSankeySeriesType | undefined; +``` + +### useSankeySeriesContext + +Get access to the internal state of sankey series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useSankeySeriesContext Return Value:** + +the sankey series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +## Additional Types + +### DefaultizedSankeySeriesType + +```typescript +type DefaultizedSankeySeriesType = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyChartProps + +```typescript +type SankeyChartProps = { + /** + * The series to display in the Sankey chart. + * A single object is expected. + */ + series: SankeySeries; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotExtension + +```typescript +type SankeyChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotProps + +```typescript +type SankeyChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### SankeyChartSlots + +```typescript +type SankeyChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### sankeyClasses + +```typescript +type sankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClasses + +```typescript +type SankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClassKey + +```typescript +type SankeyClassKey = + | 'link' + | 'nodes' + | 'links' + | 'node' + | 'root' + | 'nodeLabels' + | 'linkLabels' + | 'nodeLabel' + | 'linkLabel'; +``` + +### SankeyData + +```typescript +type SankeyData = { + /** + * An array of node configs for the Sankey diagram + * + * This is optional, but can be used to provide custom labels or styles for nodes. + */ + nodes?: SankeyNode[]; + /** + * Array of links between nodes. + * + * The node ids will be used as the labels. If you want to provide custom labels, use the `nodes` property. + * + * Each link should have a `source`, `target`, and `value` property. + */ + links: SankeyLink[]; +}; +``` + +### SankeyDataProviderProps + +```typescript +type SankeyDataProviderProps = { + children?: React.ReactNode; + series: SankeySeriesType[]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; +}; +``` + +### SankeyItemIdentifier + +```typescript +type SankeyItemIdentifier = SankeyNodeIdentifier | SankeyLinkIdentifier; +``` + +### SankeyItemIdentifierWithData + +```typescript +type SankeyItemIdentifierWithData = + | SankeyNodeIdentifierWithData + | SankeyLinkIdentifierWithData; +``` + +### SankeyLayout + +Calculated layout for the Sankey diagram + +```typescript +type SankeyLayout = { + nodes: SankeyLayoutNode[]; + links: SankeyLayoutLink[]; +}; +``` + +### SankeyLayoutLink + +Represents the calculated positions and paths for a link in the Sankey diagram + +```typescript +type SankeyLayoutLink = { + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithoutPosition + +```typescript +type SankeyLayoutLinkWithoutPosition = { + source: SankeyLayoutNodeWithoutPosition; + target: SankeyLayoutNodeWithoutPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithPosition + +```typescript +type SankeyLayoutLinkWithPosition = { + path?: string | null; + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; + /** Link's vertical starting position (at source node) calculated by Sankey layout generator. */ + y0?: number; + /** Link's vertical end position (at target node) calculated by Sankey layout generator. */ + y1?: number; + /** Link's width (proportional to its value) calculated by Sankey layout generator. */ + width?: number; +}; +``` + +### SankeyLayoutNode + +Represents the calculated positions and dimensions for a node in the Sankey diagram + +```typescript +type SankeyLayoutNode = { + targetLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithoutPosition + +```typescript +type SankeyLayoutNodeWithoutPosition = { + targetLinks: SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithPosition + +```typescript +type SankeyLayoutNodeWithPosition = { + targetLinks: SankeyLayoutLinkWithPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; + /** Node's minimum horizontal position (derived from the node.depth) calculated by Sankey layout generator. */ + x0?: number; + /** Node's maximum horizontal position (node.x0 + sankey.nodeWidth) calculated by Sankey layout generator. */ + x1?: number; + /** Node's minimum vertical position calculated by Sankey layout generator. */ + y0?: number; + /** Node's maximum vertical position (node.y1 - node.y0 is proportional to node.value) calculated by Sankey layout generator. */ + y1?: number; +}; +``` + +### SankeyLink + +```typescript +type SankeyLink = { + /** Source node ID */ + source: SankeyNodeId; + /** Target node ID */ + target: SankeyNodeId; + /** The value/weight of the link (affects width) */ + value: number; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; +}; +``` + +### SankeyLinkIdentifier + +```typescript +type SankeyLinkIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; +}; +``` + +### SankeyLinkIdentifierWithData + +```typescript +type SankeyLinkIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; + /** The link object with all the calculated properties */ + link: SankeyLayoutLink; +}; +``` + +### SankeyLinkLabelPlotProps + +```typescript +type SankeyLinkLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyLinkOptions + +```typescript +type SankeyLinkOptions = { + /** + * Default color for links without specified colors. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; + /** Opacity of the links (0-1) */ + opacity?: number; + /** Whether to show link values */ + showValues?: boolean; + /** + * Custom sort mode for links + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the links array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutLink, b: SankeyLayoutLink) => number); + /** + * Applies the given number to the X dimension of the control points of the link's curve function. + * This can create better looking links between nodes, but is dependent on the graph layout. + * It is specially impacted by the chart height. + * @default 10 + */ + curveCorrection?: number; + /** + * Highlight mode for links + * - 'links': Highlight hovered link + * - 'nodes': Highlight nodes connected to hovered link + * - 'source': Highlight source node of hovered link + * - 'target': Highlight target node of hovered link + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyLinkHighlight; + /** + * Fade mode for links + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyLinkFade; +}; +``` + +### SankeyLinkPlotProps + +```typescript +type SankeyLinkPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeyNode + +```typescript +type SankeyNode = { + /** Unique identifier for the node */ + id: SankeyNodeId; + /** The node label to display */ + label?: string; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color?: string; +}; +``` + +### SankeyNodeId + +```typescript +type SankeyNodeId = string | number; +``` + +### SankeyNodeIdentifier + +```typescript +type SankeyNodeIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; +}; +``` + +### SankeyNodeIdentifierWithData + +```typescript +type SankeyNodeIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; + /** The node object with all the calculated properties */ + node: SankeyLayoutNode; +}; +``` + +### SankeyNodeLabelPlotProps + +```typescript +type SankeyNodeLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyNodeOptions + +```typescript +type SankeyNodeOptions = { + /** Default color for nodes without specified colors */ + color?: string; + /** Width of the nodes in pixels */ + width?: number; + /** Padding between nodes in pixels */ + padding?: number; + /** + * Node alignment strategy + * - 'justify': Nodes are evenly distributed across the width. + * - 'left': Nodes are aligned to the left. + * - 'right': Nodes are aligned to the right. + * - 'center': Nodes are centered. + * @default 'justify' + */ + align?: 'justify' | 'left' | 'right' | 'center'; + /** Whether to show node labels */ + showLabels?: boolean; + /** + * Custom sort mode for nodes + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the nodes array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutNode, b: SankeyLayoutNode) => number); + /** + * Highlight mode for nodes + * - 'nodes': Highlight hovered node + * - 'links': Highlight links connected to hovered node + * - 'incoming': Highlight incoming links to hovered node + * - 'outgoing': Highlight outgoing links from hovered node + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyNodeHighlight; + /** + * Fade mode for nodes + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyNodeFade; +}; +``` + +### SankeyNodePlotProps + +```typescript +type SankeyNodePlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; +}; +``` + +### SankeyPlotProps + +```typescript +type SankeyPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeySeries + +```typescript +type SankeySeries = { + /** Unique identifier for the series */ + id?: string; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; + /** Type identifier for Sankey series */ + type?: 'sankey'; +}; +``` + +### SankeySeriesType + +```typescript +type SankeySeriesType = { + /** Unique identifier for the series */ + id?: string; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyTooltipClasses + +```typescript +type SankeyTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipContentClasses + +```typescript +type SankeyTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipProps + +```typescript +type SankeyTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; +}; +``` + +### SankeyTooltipSlotProps + +```typescript +type SankeyTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SankeyTooltipSlots + +```typescript +type SankeyTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### SankeyValueFormatterContext + +```typescript +type SankeyValueFormatterContext = + | { location: 'tooltip' | 'label'; type: 'node'; nodeId: SankeyNodeId } + | { location: 'tooltip' | 'label'; type: 'link'; sourceId: SankeyNodeId; targetId: SankeyNodeId }; +``` + +### UseSankeySeriesContextReturnValue + +```typescript +type UseSankeySeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseSankeySeriesLayoutReturnValue + +```typescript +type UseSankeySeriesLayoutReturnValue = { sankeyLayout: SankeyLayout }; +``` + +### UseSankeySeriesReturnValue + +```typescript +type UseSankeySeriesReturnValue = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +## External Types + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: unknown | null; +}) => { + identifier: unknown; + color: string; + label: string | undefined; + value: number; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { sankey?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: unknown | null; + seriesLayout: { sankey?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + id?: string | undefined; + type: 'sankey'; + data: { nodes?: unknown | undefined; links: unknown }; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + valueFormatter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; +}; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: unknown) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: unknown) => unknown; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = (state: unknown, point: { x: number; y: number }) => unknown | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + } + | null + | undefined, + highlightedItem: unknown | null, +) => unknown; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.sankey-plot.ts b/docs/pages/x/api/charts/types.sankey-plot.ts new file mode 100644 index 0000000000000..87cbcbf3809ab --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-plot.ts @@ -0,0 +1,4 @@ +import { SankeyPlot } from '@mui/x-charts-pro/SankeyChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesSankeyPlot = createTypes(import.meta.url, SankeyPlot); diff --git a/docs/pages/x/api/charts/types.sankey-tooltip-content.md b/docs/pages/x/api/charts/types.sankey-tooltip-content.md new file mode 100644 index 0000000000000..af531c6b6b9e3 --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-tooltip-content.md @@ -0,0 +1,2559 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.sankey-tooltip-content.md' + +## API Reference + +### FocusedSankeyLink + +### FocusedSankeyNode + +### SankeyChart + +Sankey Chart component + +Displays a Sankey diagram, visualizing flows between nodes where the width +of the links is proportional to the flow quantity. + +Demos: + +- [Sankey Chart](https://mui.com/x/react-charts/sankey/) + +API: + +- [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/) + +**SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyDataProvider + +Orchestrates the data providers for the sankey chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +**SankeyDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeriesType[]` | - | - | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyLinkLabelPlot + +**SankeyLinkLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyLinkPlot + +**SankeyLinkPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodeLabelPlot + +**SankeyNodeLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodePlot + +**SankeyNodePlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyPlot + +Renders a Sankey diagram plot. + +**SankeyPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| className | `string` | - | A CSS class name applied to the root element. | + +### SankeyTooltip + +**SankeyTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### SankeyTooltipContent + +**SankeyTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### Unstable_SankeyChart + +**Unstable_SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### useSankeyLayout + +Get access to the sankey layout. + +**useSankeyLayout Return Value:** + +the sankey layout + +```tsx +type ReturnValue = SankeyLayout | undefined; +``` + +### useSankeyLinkHighlightState + +**useSankeyLinkHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| linkIdentifier | `SankeyLinkIdentifier` | - | - | + +**useSankeyLinkHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeyNodeHighlightState + +**useSankeyNodeHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| nodeIdentifier | `SankeyNodeIdentifier` | - | - | + +**useSankeyNodeHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeySeries + +Get access to the internal state of sankey series. + +**useSankeySeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useSankeySeries Return Value:** + +the sankey series + +```tsx +type ReturnValue = DefaultizedSankeySeriesType | undefined; +``` + +### useSankeySeriesContext + +Get access to the internal state of sankey series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useSankeySeriesContext Return Value:** + +the sankey series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +## Additional Types + +### DefaultizedSankeySeriesType + +```typescript +type DefaultizedSankeySeriesType = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyChartProps + +```typescript +type SankeyChartProps = { + /** + * The series to display in the Sankey chart. + * A single object is expected. + */ + series: SankeySeries; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotExtension + +```typescript +type SankeyChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotProps + +```typescript +type SankeyChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### SankeyChartSlots + +```typescript +type SankeyChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### sankeyClasses + +```typescript +type sankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClasses + +```typescript +type SankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClassKey + +```typescript +type SankeyClassKey = + | 'link' + | 'nodes' + | 'links' + | 'node' + | 'root' + | 'nodeLabels' + | 'linkLabels' + | 'nodeLabel' + | 'linkLabel'; +``` + +### SankeyData + +```typescript +type SankeyData = { + /** + * An array of node configs for the Sankey diagram + * + * This is optional, but can be used to provide custom labels or styles for nodes. + */ + nodes?: SankeyNode[]; + /** + * Array of links between nodes. + * + * The node ids will be used as the labels. If you want to provide custom labels, use the `nodes` property. + * + * Each link should have a `source`, `target`, and `value` property. + */ + links: SankeyLink[]; +}; +``` + +### SankeyDataProviderProps + +```typescript +type SankeyDataProviderProps = { + children?: React.ReactNode; + series: SankeySeriesType[]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; +}; +``` + +### SankeyItemIdentifier + +```typescript +type SankeyItemIdentifier = SankeyNodeIdentifier | SankeyLinkIdentifier; +``` + +### SankeyItemIdentifierWithData + +```typescript +type SankeyItemIdentifierWithData = + | SankeyNodeIdentifierWithData + | SankeyLinkIdentifierWithData; +``` + +### SankeyLayout + +Calculated layout for the Sankey diagram + +```typescript +type SankeyLayout = { + nodes: SankeyLayoutNode[]; + links: SankeyLayoutLink[]; +}; +``` + +### SankeyLayoutLink + +Represents the calculated positions and paths for a link in the Sankey diagram + +```typescript +type SankeyLayoutLink = { + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithoutPosition + +```typescript +type SankeyLayoutLinkWithoutPosition = { + source: SankeyLayoutNodeWithoutPosition; + target: SankeyLayoutNodeWithoutPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithPosition + +```typescript +type SankeyLayoutLinkWithPosition = { + path?: string | null; + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; + /** Link's vertical starting position (at source node) calculated by Sankey layout generator. */ + y0?: number; + /** Link's vertical end position (at target node) calculated by Sankey layout generator. */ + y1?: number; + /** Link's width (proportional to its value) calculated by Sankey layout generator. */ + width?: number; +}; +``` + +### SankeyLayoutNode + +Represents the calculated positions and dimensions for a node in the Sankey diagram + +```typescript +type SankeyLayoutNode = { + targetLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithoutPosition + +```typescript +type SankeyLayoutNodeWithoutPosition = { + targetLinks: SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithPosition + +```typescript +type SankeyLayoutNodeWithPosition = { + targetLinks: SankeyLayoutLinkWithPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; + /** Node's minimum horizontal position (derived from the node.depth) calculated by Sankey layout generator. */ + x0?: number; + /** Node's maximum horizontal position (node.x0 + sankey.nodeWidth) calculated by Sankey layout generator. */ + x1?: number; + /** Node's minimum vertical position calculated by Sankey layout generator. */ + y0?: number; + /** Node's maximum vertical position (node.y1 - node.y0 is proportional to node.value) calculated by Sankey layout generator. */ + y1?: number; +}; +``` + +### SankeyLink + +```typescript +type SankeyLink = { + /** Source node ID */ + source: SankeyNodeId; + /** Target node ID */ + target: SankeyNodeId; + /** The value/weight of the link (affects width) */ + value: number; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; +}; +``` + +### SankeyLinkIdentifier + +```typescript +type SankeyLinkIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; +}; +``` + +### SankeyLinkIdentifierWithData + +```typescript +type SankeyLinkIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; + /** The link object with all the calculated properties */ + link: SankeyLayoutLink; +}; +``` + +### SankeyLinkLabelPlotProps + +```typescript +type SankeyLinkLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyLinkOptions + +```typescript +type SankeyLinkOptions = { + /** + * Default color for links without specified colors. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; + /** Opacity of the links (0-1) */ + opacity?: number; + /** Whether to show link values */ + showValues?: boolean; + /** + * Custom sort mode for links + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the links array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutLink, b: SankeyLayoutLink) => number); + /** + * Applies the given number to the X dimension of the control points of the link's curve function. + * This can create better looking links between nodes, but is dependent on the graph layout. + * It is specially impacted by the chart height. + * @default 10 + */ + curveCorrection?: number; + /** + * Highlight mode for links + * - 'links': Highlight hovered link + * - 'nodes': Highlight nodes connected to hovered link + * - 'source': Highlight source node of hovered link + * - 'target': Highlight target node of hovered link + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyLinkHighlight; + /** + * Fade mode for links + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyLinkFade; +}; +``` + +### SankeyLinkPlotProps + +```typescript +type SankeyLinkPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeyNode + +```typescript +type SankeyNode = { + /** Unique identifier for the node */ + id: SankeyNodeId; + /** The node label to display */ + label?: string; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color?: string; +}; +``` + +### SankeyNodeId + +```typescript +type SankeyNodeId = string | number; +``` + +### SankeyNodeIdentifier + +```typescript +type SankeyNodeIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; +}; +``` + +### SankeyNodeIdentifierWithData + +```typescript +type SankeyNodeIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; + /** The node object with all the calculated properties */ + node: SankeyLayoutNode; +}; +``` + +### SankeyNodeLabelPlotProps + +```typescript +type SankeyNodeLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyNodeOptions + +```typescript +type SankeyNodeOptions = { + /** Default color for nodes without specified colors */ + color?: string; + /** Width of the nodes in pixels */ + width?: number; + /** Padding between nodes in pixels */ + padding?: number; + /** + * Node alignment strategy + * - 'justify': Nodes are evenly distributed across the width. + * - 'left': Nodes are aligned to the left. + * - 'right': Nodes are aligned to the right. + * - 'center': Nodes are centered. + * @default 'justify' + */ + align?: 'justify' | 'left' | 'right' | 'center'; + /** Whether to show node labels */ + showLabels?: boolean; + /** + * Custom sort mode for nodes + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the nodes array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutNode, b: SankeyLayoutNode) => number); + /** + * Highlight mode for nodes + * - 'nodes': Highlight hovered node + * - 'links': Highlight links connected to hovered node + * - 'incoming': Highlight incoming links to hovered node + * - 'outgoing': Highlight outgoing links from hovered node + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyNodeHighlight; + /** + * Fade mode for nodes + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyNodeFade; +}; +``` + +### SankeyNodePlotProps + +```typescript +type SankeyNodePlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; +}; +``` + +### SankeyPlotProps + +```typescript +type SankeyPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeySeries + +```typescript +type SankeySeries = { + /** Unique identifier for the series */ + id?: string; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; + /** Type identifier for Sankey series */ + type?: 'sankey'; +}; +``` + +### SankeySeriesType + +```typescript +type SankeySeriesType = { + /** Unique identifier for the series */ + id?: string; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyTooltipClasses + +```typescript +type SankeyTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipContentClasses + +```typescript +type SankeyTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipProps + +```typescript +type SankeyTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; +}; +``` + +### SankeyTooltipSlotProps + +```typescript +type SankeyTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SankeyTooltipSlots + +```typescript +type SankeyTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### SankeyValueFormatterContext + +```typescript +type SankeyValueFormatterContext = + | { location: 'tooltip' | 'label'; type: 'node'; nodeId: SankeyNodeId } + | { location: 'tooltip' | 'label'; type: 'link'; sourceId: SankeyNodeId; targetId: SankeyNodeId }; +``` + +### UseSankeySeriesContextReturnValue + +```typescript +type UseSankeySeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseSankeySeriesLayoutReturnValue + +```typescript +type UseSankeySeriesLayoutReturnValue = { sankeyLayout: SankeyLayout }; +``` + +### UseSankeySeriesReturnValue + +```typescript +type UseSankeySeriesReturnValue = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +## External Types + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: unknown | null; +}) => { + identifier: unknown; + color: string; + label: string | undefined; + value: number; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { sankey?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: unknown | null; + seriesLayout: { sankey?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + id?: string | undefined; + type: 'sankey'; + data: { nodes?: unknown | undefined; links: unknown }; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + valueFormatter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; +}; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: unknown) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: unknown) => unknown; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = (state: unknown, point: { x: number; y: number }) => unknown | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + } + | null + | undefined, + highlightedItem: unknown | null, +) => unknown; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.sankey-tooltip-content.ts b/docs/pages/x/api/charts/types.sankey-tooltip-content.ts new file mode 100644 index 0000000000000..41d339b58a0be --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-tooltip-content.ts @@ -0,0 +1,4 @@ +import { SankeyTooltipContent } from '@mui/x-charts-pro/SankeyChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesSankeyTooltipContent = createTypes(import.meta.url, SankeyTooltipContent); diff --git a/docs/pages/x/api/charts/types.sankey-tooltip.md b/docs/pages/x/api/charts/types.sankey-tooltip.md new file mode 100644 index 0000000000000..223fa97b45354 --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-tooltip.md @@ -0,0 +1,2559 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.sankey-tooltip.md' + +## API Reference + +### FocusedSankeyLink + +### FocusedSankeyNode + +### SankeyChart + +Sankey Chart component + +Displays a Sankey diagram, visualizing flows between nodes where the width +of the links is proportional to the flow quantity. + +Demos: + +- [Sankey Chart](https://mui.com/x/react-charts/sankey/) + +API: + +- [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/) + +**SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyDataProvider + +Orchestrates the data providers for the sankey chart components and hooks. + +Use this component if you have custom HTML components that need to access the chart data. + +Demos: + +- [Composition](https://mui.com/x/api/charts/composition/) + +**SankeyDataProvider Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeriesType[]` | - | - | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### SankeyLinkLabelPlot + +**SankeyLinkLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyLinkPlot + +**SankeyLinkPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodeLabelPlot + +**SankeyNodeLabelPlot Props:** + +| Prop | Type | Default | Description | +| :------ | :----------------------- | :------ | :--------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyNodePlot + +**SankeyNodePlot Props:** + +| Prop | Type | Default | Description | +| :------ | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| onClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| classes | `Partial` | - | Classes applied to the various elements. | + +### SankeyPlot + +Renders a Sankey diagram plot. + +**SankeyPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------------------------------------------------ | :------ | :-------------------------------------------- | +| classes | `Partial` | - | Classes applied to the various elements. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| className | `string` | - | A CSS class name applied to the root element. | + +### SankeyTooltip + +**SankeyTooltip Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| position | `'top' \| 'bottom' \| 'left' \| 'right'` | - | Determines the tooltip position relatively to the anchor. | +| slotProps | `ChartsTooltipContainerSlotProps` | `{}` | The props used for each component slot. | +| slots | `ChartsTooltipContainerSlots` | `{}` | Overridable component slots. | +| trigger | `'item' \| 'none'` | `'item'` | Select the kind of tooltip to display 'item': Shows data about the item below the mouse.'none': Does not display tooltip | +| anchor | `'node' \| 'pointer' \| 'chart'` | `'pointer'` | Determine if the tooltip should be placed on the pointer location or on the node. | + +### SankeyTooltipContent + +**SankeyTooltipContent Props:** + +| Prop | Type | Default | Description | +| :------ | :--------------------------------------- | :------ | :------------------------------------------------------ | +| classes | `Partial` | - | Override or extend the styles applied to the component. | + +### Unstable_SankeyChart + +**Unstable_SankeyChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| apiRef | `React.RefObject \| undefined>` | - | - | +| classes | `Partial` | - | Classes applied to the various elements. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| highlightedItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The highlighted item. Used when the highlight is controlled. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onHighlightChange | `((highlightedItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onLinkClick | `((event: React.MouseEvent, link: SankeyLinkIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onNodeClick | `((event: React.MouseEvent, node: SankeyNodeIdentifierWithData) => void)` | - | Callback fired when a sankey item is clicked. | +| onTooltipItemChange | `((tooltipItem: SankeyItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| series\* | `SankeySeries` | - | The series to display in the Sankey chart. A single object is expected. | +| seriesConfig | `{ sankey: { seriesProcessor: SeriesProcessor<'sankey'>; seriesLayout?: SeriesLayoutGetter<'sankey'>; colorProcessor: ColorProcessor<'sankey'>; legendGetter: LegendGetter<'sankey'>; tooltipGetter: TooltipGetter<'sankey'>; ItemTooltipContent?: React.ComponentType>; tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; identifierSerializer: IdentifierSerializer<'sankey'>; identifierCleaner: IdentifierCleaner<'sankey'>; getItemAtPosition?: GetItemAtPosition<'sankey'>; descriptionGetter: DescriptionGetter<'sankey'>; isHighlightedCreator: HighlightCreator<'sankey'>; isFadedCreator: HighlightCreator<'sankey'> } }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| slotProps | `SankeyChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `SankeyChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipItem | `SankeyItemIdentifier \| Omit \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### useSankeyLayout + +Get access to the sankey layout. + +**useSankeyLayout Return Value:** + +the sankey layout + +```tsx +type ReturnValue = SankeyLayout | undefined; +``` + +### useSankeyLinkHighlightState + +**useSankeyLinkHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| linkIdentifier | `SankeyLinkIdentifier` | - | - | + +**useSankeyLinkHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeyNodeHighlightState + +**useSankeyNodeHighlightState Parameters:** + +| Parameter | Type | Default | Description | +| :------------- | :--------------------- | :------ | :---------- | +| nodeIdentifier | `SankeyNodeIdentifier` | - | - | + +**useSankeyNodeHighlightState Return Value:** + +```tsx +type ReturnValue = HighlightState; +``` + +### useSankeySeries + +Get access to the internal state of sankey series. + +**useSankeySeries Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :--------------------------- | +| seriesId | `string` | - | The id of the series to get. | + +**useSankeySeries Return Value:** + +the sankey series + +```tsx +type ReturnValue = DefaultizedSankeySeriesType | undefined; +``` + +### useSankeySeriesContext + +Get access to the internal state of sankey series. +The returned object contains: + +- series: a mapping from ids to series attributes. +- seriesOrder: the array of series ids. + +**useSankeySeriesContext Return Value:** + +the sankey series + +```tsx +type ReturnValue = + | { series: Record; seriesOrder: string[] } + | undefined; +``` + +## Additional Types + +### DefaultizedSankeySeriesType + +```typescript +type DefaultizedSankeySeriesType = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyChartProps + +```typescript +type SankeyChartProps = { + /** + * The series to display in the Sankey chart. + * A single object is expected. + */ + series: SankeySeries; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotExtension + +```typescript +type SankeyChartSlotExtension = { + /** + * Overridable component slots. + * @default {} + */ + slots?: SankeyChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: SankeyChartSlotProps; +}; +``` + +### SankeyChartSlotProps + +```typescript +type SankeyChartSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + } + >; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### SankeyChartSlots + +```typescript +type SankeyChartSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none' } + | { anchor?: 'node' | 'pointer'; trigger?: 'item' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + sort?: undefined; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### sankeyClasses + +```typescript +type sankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClasses + +```typescript +type SankeyClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the nodes container. */ + nodes: string; + /** Styles applied to the node label container. */ + nodeLabels: string; + /** Styles applied to the links container. */ + links: string; + /** Styles applied to the link label container. */ + linkLabels: string; + /** Styles applied to an individual node element. */ + node: string; + /** Styles applied to an individual link element. */ + link: string; + /** Styles applied to an individual node label element. */ + nodeLabel: string; + /** Styles applied to an individual link label element. */ + linkLabel: string; +}; +``` + +### SankeyClassKey + +```typescript +type SankeyClassKey = + | 'link' + | 'nodes' + | 'links' + | 'node' + | 'root' + | 'nodeLabels' + | 'linkLabels' + | 'nodeLabel' + | 'linkLabel'; +``` + +### SankeyData + +```typescript +type SankeyData = { + /** + * An array of node configs for the Sankey diagram + * + * This is optional, but can be used to provide custom labels or styles for nodes. + */ + nodes?: SankeyNode[]; + /** + * Array of links between nodes. + * + * The node ids will be used as the labels. If you want to provide custom labels, use the `nodes` property. + * + * Each link should have a `source`, `target`, and `value` property. + */ + links: SankeyLink[]; +}; +``` + +### SankeyDataProviderProps + +```typescript +type SankeyDataProviderProps = { + children?: React.ReactNode; + series: SankeySeriesType[]; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { + sankey: { + seriesProcessor: SeriesProcessor<'sankey'>; + seriesLayout?: SeriesLayoutGetter<'sankey'>; + colorProcessor: ColorProcessor<'sankey'>; + legendGetter: LegendGetter<'sankey'>; + tooltipGetter: TooltipGetter<'sankey'>; + ItemTooltipContent?: React.ComponentType>; + tooltipItemPositionGetter?: TooltipItemPositionGetter<'sankey'>; + getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'sankey'>; + keyboardFocusHandler?: KeyboardFocusHandler<'sankey'>; + identifierSerializer: IdentifierSerializer<'sankey'>; + identifierCleaner: IdentifierCleaner<'sankey'>; + getItemAtPosition?: GetItemAtPosition<'sankey'>; + descriptionGetter: DescriptionGetter<'sankey'>; + isHighlightedCreator: HighlightCreator<'sankey'>; + isFadedCreator: HighlightCreator<'sankey'>; + }; + }; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: SankeyItemIdentifier | null) => void; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | SankeyItemIdentifier + | Omit + | Omit + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: (highlightedItem: SankeyItemIdentifier | null) => void; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** Localized text for chart components. */ + localeText?: Partial; + sx?: SxProps; +}; +``` + +### SankeyItemIdentifier + +```typescript +type SankeyItemIdentifier = SankeyNodeIdentifier | SankeyLinkIdentifier; +``` + +### SankeyItemIdentifierWithData + +```typescript +type SankeyItemIdentifierWithData = + | SankeyNodeIdentifierWithData + | SankeyLinkIdentifierWithData; +``` + +### SankeyLayout + +Calculated layout for the Sankey diagram + +```typescript +type SankeyLayout = { + nodes: SankeyLayoutNode[]; + links: SankeyLayoutLink[]; +}; +``` + +### SankeyLayoutLink + +Represents the calculated positions and paths for a link in the Sankey diagram + +```typescript +type SankeyLayoutLink = { + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithoutPosition + +```typescript +type SankeyLayoutLinkWithoutPosition = { + source: SankeyLayoutNodeWithoutPosition; + target: SankeyLayoutNodeWithoutPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; +}; +``` + +### SankeyLayoutLinkWithPosition + +```typescript +type SankeyLayoutLinkWithPosition = { + path?: string | null; + source: SankeyLayoutNodeWithPosition; + target: SankeyLayoutNodeWithPosition; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color: string; + /** Optional custom data for the link */ + data?: any; + /** The value/weight of the link (affects width) */ + value: number; + /** Link's zero-based index within the array of links calculated by Sankey layout generator. */ + index?: number; + /** Link's vertical starting position (at source node) calculated by Sankey layout generator. */ + y0?: number; + /** Link's vertical end position (at target node) calculated by Sankey layout generator. */ + y1?: number; + /** Link's width (proportional to its value) calculated by Sankey layout generator. */ + width?: number; +}; +``` + +### SankeyLayoutNode + +Represents the calculated positions and dimensions for a node in the Sankey diagram + +```typescript +type SankeyLayoutNode = { + targetLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[] | SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithoutPosition + +```typescript +type SankeyLayoutNodeWithoutPosition = { + targetLinks: SankeyLayoutLinkWithoutPosition[]; + sourceLinks: SankeyLayoutLinkWithoutPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; +}; +``` + +### SankeyLayoutNodeWithPosition + +```typescript +type SankeyLayoutNodeWithPosition = { + targetLinks: SankeyLayoutLinkWithPosition[]; + sourceLinks: SankeyLayoutLinkWithPosition[]; + value: number; + /** Unique identifier for the node */ + id: SankeyNodeId; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color: string; + /** The node label to display */ + label: string; + /** Node's fixedValue (user-defined) */ + fixedValue?: number; + /** Node's zero-based index within the array of nodes calculated by Sankey layout generator. */ + index?: number; + /** Node's zero-based graph depth, derived from the graph topology calculated by Sankey layout generator. */ + depth?: number; + /** Node's zero-based graph height, derived from the graph topology calculated by Sankey layout generator. */ + height?: number; + /** Link's layer in case of layered layout, calculated by Sankey layout generator. */ + layer?: number; + /** Node's minimum horizontal position (derived from the node.depth) calculated by Sankey layout generator. */ + x0?: number; + /** Node's maximum horizontal position (node.x0 + sankey.nodeWidth) calculated by Sankey layout generator. */ + x1?: number; + /** Node's minimum vertical position calculated by Sankey layout generator. */ + y0?: number; + /** Node's maximum vertical position (node.y1 - node.y0 is proportional to node.value) calculated by Sankey layout generator. */ + y1?: number; +}; +``` + +### SankeyLink + +```typescript +type SankeyLink = { + /** Source node ID */ + source: SankeyNodeId; + /** Target node ID */ + target: SankeyNodeId; + /** The value/weight of the link (affects width) */ + value: number; + /** Optional custom data for the link */ + data?: any; + /** + * Optional color override for the link. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; +}; +``` + +### SankeyLinkIdentifier + +```typescript +type SankeyLinkIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; +}; +``` + +### SankeyLinkIdentifierWithData + +```typescript +type SankeyLinkIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'link'; + /** The id of the source node */ + sourceId: SankeyNodeId; + /** The id of the target node */ + targetId: SankeyNodeId; + /** The link object with all the calculated properties */ + link: SankeyLayoutLink; +}; +``` + +### SankeyLinkLabelPlotProps + +```typescript +type SankeyLinkLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyLinkOptions + +```typescript +type SankeyLinkOptions = { + /** + * Default color for links without specified colors. + * Can be a color string, or a keyword: + * - 'source': Use the color of the source node + * - 'target': Use the color of the target node + * @default 'source' + */ + color?: string; + /** Opacity of the links (0-1) */ + opacity?: number; + /** Whether to show link values */ + showValues?: boolean; + /** + * Custom sort mode for links + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the links array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutLink, b: SankeyLayoutLink) => number); + /** + * Applies the given number to the X dimension of the control points of the link's curve function. + * This can create better looking links between nodes, but is dependent on the graph layout. + * It is specially impacted by the chart height. + * @default 10 + */ + curveCorrection?: number; + /** + * Highlight mode for links + * - 'links': Highlight hovered link + * - 'nodes': Highlight nodes connected to hovered link + * - 'source': Highlight source node of hovered link + * - 'target': Highlight target node of hovered link + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyLinkHighlight; + /** + * Fade mode for links + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyLinkFade; +}; +``` + +### SankeyLinkPlotProps + +```typescript +type SankeyLinkPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeyNode + +```typescript +type SankeyNode = { + /** Unique identifier for the node */ + id: SankeyNodeId; + /** The node label to display */ + label?: string; + /** Optional custom data for the node */ + data?: any; + /** Optional color override for the node */ + color?: string; +}; +``` + +### SankeyNodeId + +```typescript +type SankeyNodeId = string | number; +``` + +### SankeyNodeIdentifier + +```typescript +type SankeyNodeIdentifier = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; +}; +``` + +### SankeyNodeIdentifierWithData + +```typescript +type SankeyNodeIdentifierWithData = { + type: 'sankey'; + /** Unique identifier for the series */ + seriesId: string; + /** Subtype to differentiate between node and link */ + subType: 'node'; + /** The id of the node */ + nodeId: SankeyNodeId; + /** The node object with all the calculated properties */ + node: SankeyLayoutNode; +}; +``` + +### SankeyNodeLabelPlotProps + +```typescript +type SankeyNodeLabelPlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; +}; +``` + +### SankeyNodeOptions + +```typescript +type SankeyNodeOptions = { + /** Default color for nodes without specified colors */ + color?: string; + /** Width of the nodes in pixels */ + width?: number; + /** Padding between nodes in pixels */ + padding?: number; + /** + * Node alignment strategy + * - 'justify': Nodes are evenly distributed across the width. + * - 'left': Nodes are aligned to the left. + * - 'right': Nodes are aligned to the right. + * - 'center': Nodes are centered. + * @default 'justify' + */ + align?: 'justify' | 'left' | 'right' | 'center'; + /** Whether to show node labels */ + showLabels?: boolean; + /** + * Custom sort mode for nodes + * + * - 'auto': Automatic sorting behavior (default) + * - 'fixed': Preserve the order from the nodes array (disables automatic sorting) + * - or a custom function + * @default 'auto' + * @returns Comparison result + */ + sort?: 'auto' | 'fixed' | ((a: SankeyLayoutNode, b: SankeyLayoutNode) => number); + /** + * Highlight mode for nodes + * - 'nodes': Highlight hovered node + * - 'links': Highlight links connected to hovered node + * - 'incoming': Highlight incoming links to hovered node + * - 'outgoing': Highlight outgoing links from hovered node + * - 'none': No highlighting + * @default 'links' + */ + highlight?: SankeyNodeHighlight; + /** + * Fade mode for nodes + * - 'global': Fade all non-highlighted items + * - 'none': No fading + * @default 'none' + */ + fade?: SankeyNodeFade; +}; +``` + +### SankeyNodePlotProps + +```typescript +type SankeyNodePlotProps = { + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; +}; +``` + +### SankeyPlotProps + +```typescript +type SankeyPlotProps = { + /** A CSS class name applied to the root element. */ + className?: string; + /** Classes applied to the various elements. */ + classes?: Partial; + /** Callback fired when a sankey item is clicked. */ + onNodeClick?: ( + event: React.MouseEvent, + node: SankeyNodeIdentifierWithData, + ) => void; + /** Callback fired when a sankey item is clicked. */ + onLinkClick?: ( + event: React.MouseEvent, + link: SankeyLinkIdentifierWithData, + ) => void; +}; +``` + +### SankeySeries + +```typescript +type SankeySeries = { + /** Unique identifier for the series */ + id?: string; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; + /** Type identifier for Sankey series */ + type?: 'sankey'; +}; +``` + +### SankeySeriesType + +```typescript +type SankeySeriesType = { + /** Unique identifier for the series */ + id?: string; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** The data for the Sankey diagram */ + data: SankeyData; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter?: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +### SankeyTooltipClasses + +```typescript +type SankeyTooltipClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipContentClasses + +```typescript +type SankeyTooltipContentClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the paper element. */ + paper: string; + /** Styles applied to the table element. */ + table: string; + /** Styles applied to the row element. */ + row: string; + /** Styles applied to the cell element. */ + cell: string; + /** Styles applied to the mark element. */ + mark: string; + /** Styles applied to the markContainer element. */ + markContainer: string; + /** Styles applied to the labelCell element. */ + labelCell: string; + /** Styles applied to the valueCell element. */ + valueCell: string; + /** Styles applied to the axisValueCell element. Only available for axis tooltip. */ + axisValueCell: string; +}; +``` + +### SankeyTooltipProps + +```typescript +type SankeyTooltipProps = { + /** + * Select the kind of tooltip to display + * - 'item': Shows data about the item below the mouse. + * - 'none': Does not display tooltip + * @default 'item' + */ + trigger?: 'item' | 'none'; + /** + * Determine if the tooltip should be placed on the pointer location or on the node. + * @default 'pointer' + */ + anchor?: 'node' | 'pointer' | 'chart'; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ChartsTooltipContainerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ChartsTooltipContainerSlots; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** Determines the tooltip position relatively to the anchor. */ + position?: 'top' | 'bottom' | 'left' | 'right'; +}; +``` + +### SankeyTooltipSlotProps + +```typescript +type SankeyTooltipSlotProps = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: Partial< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + } + >; +}; +``` + +### SankeyTooltipSlots + +```typescript +type SankeyTooltipSlots = { + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + | { anchor?: 'node' | 'pointer'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'desc' | 'none' | 'asc' } + ) & { + slotProps?: ChartsTooltipContainerSlotProps; + slots?: ChartsTooltipContainerSlots; + classes?: Partial; + position?: 'top' | 'bottom' | 'left' | 'right'; + }, + | 'symbol' + | 'object' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'line' + | 'slot' + | 'style' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'title' + | 'desc' + | 'div' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'data' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'label' + | 'legend' + | 'li' + | 'main' + | 'map' + | 'mark' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'p' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'circle' + | 'defs' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'g' + | 'image' + | 'linearGradient' + | 'marker' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'text' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; +}; +``` + +### SankeyValueFormatterContext + +```typescript +type SankeyValueFormatterContext = + | { location: 'tooltip' | 'label'; type: 'node'; nodeId: SankeyNodeId } + | { location: 'tooltip' | 'label'; type: 'link'; sourceId: SankeyNodeId; targetId: SankeyNodeId }; +``` + +### UseSankeySeriesContextReturnValue + +```typescript +type UseSankeySeriesContextReturnValue = { + series: Record; + seriesOrder: string[]; +}; +``` + +### UseSankeySeriesLayoutReturnValue + +```typescript +type UseSankeySeriesLayoutReturnValue = { sankeyLayout: SankeyLayout }; +``` + +### UseSankeySeriesReturnValue + +```typescript +type UseSankeySeriesReturnValue = { + data: SankeyLayout; + /** Highlight scope for the series derived from nodeOptions and linksOptions */ + highlightScope: SankeyHighlightScope; + /** Type identifier for Sankey series */ + type: 'sankey'; + /** Optional configuration for the nodes style, layout, and behavior */ + nodeOptions?: SankeyNodeOptions; + /** Optional configuration for the links style, layout, and behavior */ + linkOptions?: SankeyLinkOptions; + /** + * Number of iterations for the layout algorithm + * @default 6 + */ + iterations?: number; + /** Unique identifier for the series */ + id: string; + /** + * Formatter used to render values in tooltip or other data display. + * @returns The formatted value to display. + */ + valueFormatter: (value: number, context: SankeyValueFormatterContext) => string | null; +}; +``` + +## External Types + +### SeriesProcessor + +```typescript +type SeriesProcessor = ( + params: { series: Record; seriesOrder: unknown }, + dataset?: unknown | undefined, + isItemVisible?: unknown | undefined, +) => { series: Record; seriesOrder: unknown }; +``` + +### SeriesLayoutGetter + +```typescript +type SeriesLayoutGetter = ( + params: { series: Record; seriesOrder: unknown }, + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }, +) => {}; +``` + +### ColorProcessor + +```typescript +type ColorProcessor = ( + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }, + xAxis?: unknown | undefined, + yAxis?: unknown | undefined, + zAxis?: + | { + colorScale?: ScaleOrdinal | ScaleSequential | ScaleThreshold | undefined; + id: string; + data?: unknown | undefined; + dataKey?: string | undefined; + valueGetter?: unknown | undefined; + min?: number | undefined; + max?: number | undefined; + colorMap?: + | { + type: 'ordinal'; + values?: unknown | undefined; + colors: unknown; + unknownColor?: string | undefined; + } + | { + type: 'continuous'; + min?: number | Date | undefined; + max?: number | Date | undefined; + color: unknown; + } + | { type: 'piecewise'; thresholds: unknown; colors: unknown } + | undefined; + } + | undefined, +) => unknown; +``` + +### LegendGetter + +```typescript +type LegendGetter = (series: { series: Record; seriesOrder: unknown }) => unknown; +``` + +### TooltipGetter + +```typescript +type TooltipGetter = (params: { + series: { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; + }; + axesConfig: { x?: unknown | undefined; y?: unknown | undefined; rotation?: any; radius?: any }; + getColor: unknown; + identifier: unknown | null; +}) => { + identifier: unknown; + color: string; + label: string | undefined; + value: number; + formattedValue: string | null; + markType: 'square' | 'circle' | 'line' | 'line+mark' | ComponentType | undefined; + markShape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | undefined; +} | null; +``` + +### TooltipItemPositionGetter + +```typescript +type TooltipItemPositionGetter = (params: { + series: { sankey?: { series: Record; seriesOrder: unknown } | undefined }; + axesConfig: { + x?: unknown | undefined; + y?: unknown | undefined; + rotationAxes?: { axis: {}; axisIds: unknown } | undefined; + radiusAxes?: { axis: {}; axisIds: unknown } | undefined; + }; + drawingArea: { + left: number; + top: number; + bottom: number; + right: number; + width: number; + height: number; + }; + identifier: unknown | null; + seriesLayout: { sankey?: {} | undefined }; + placement: 'top' | 'bottom' | 'left' | 'right'; +}) => { x: number; y: number } | null; +``` + +### GetSeriesWithDefaultValues + +```typescript +type GetSeriesWithDefaultValues = ( + series: { + id?: string | undefined; + type: 'sankey'; + data: { nodes?: unknown | undefined; links: unknown }; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + valueFormatter?: unknown | undefined; + }, + seriesIndex: number, + colors: unknown, + theme: 'light' | 'dark', +) => { + data: { nodes: unknown; links: unknown }; + highlightScope: { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + }; + type: 'sankey'; + nodeOptions?: unknown | undefined; + linkOptions?: unknown | undefined; + iterations?: number | undefined; + id: string; + valueFormatter: unknown; +}; +``` + +### KeyboardFocusHandler + +```typescript +type KeyboardFocusHandler = (event: KeyboardEvent) => unknown | null; +``` + +### IdentifierSerializer + +```typescript +type IdentifierSerializer = (identifier: unknown) => string; +``` + +### IdentifierCleaner + +```typescript +type IdentifierCleaner = (identifier: unknown) => unknown; +``` + +### GetItemAtPosition + +```typescript +type GetItemAtPosition = (state: unknown, point: { x: number; y: number }) => unknown | undefined; +``` + +### DescriptionGetter + +```typescript +type DescriptionGetter = (params: unknown) => string; +``` + +### HighlightCreator + +```typescript +type HighlightCreator = ( + highlightScope: + | { + nodes: { + highlight?: 'nodes' | 'links' | 'incoming' | 'outgoing' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + links: { + highlight?: 'links' | 'nodes' | 'source' | 'target' | 'none' | undefined; + fade?: 'global' | 'none' | undefined; + }; + } + | null + | undefined, + highlightedItem: unknown | null, +) => unknown; +``` + +### HighlightState + +```typescript +type HighlightState = 'highlighted' | 'faded' | 'none'; +``` diff --git a/docs/pages/x/api/charts/types.sankey-tooltip.ts b/docs/pages/x/api/charts/types.sankey-tooltip.ts new file mode 100644 index 0000000000000..d7e02cd0ea179 --- /dev/null +++ b/docs/pages/x/api/charts/types.sankey-tooltip.ts @@ -0,0 +1,4 @@ +import { SankeyTooltip } from '@mui/x-charts-pro/SankeyChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesSankeyTooltip = createTypes(import.meta.url, SankeyTooltip); diff --git a/docs/pages/x/api/charts/types.scatter-chart-pro.ts b/docs/pages/x/api/charts/types.scatter-chart-pro.ts new file mode 100644 index 0000000000000..f299ff2447b12 --- /dev/null +++ b/docs/pages/x/api/charts/types.scatter-chart-pro.ts @@ -0,0 +1,4 @@ +import { ScatterChartPro } from '@mui/x-charts-pro/ScatterChartPro'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesScatterChartPro = createTypes(import.meta.url, ScatterChartPro); diff --git a/docs/pages/x/api/charts/types.scatter-chart.ts b/docs/pages/x/api/charts/types.scatter-chart.ts new file mode 100644 index 0000000000000..5d9c0c1d2aafa --- /dev/null +++ b/docs/pages/x/api/charts/types.scatter-chart.ts @@ -0,0 +1,4 @@ +import { ScatterChart } from '@mui/x-charts/ScatterChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesScatterChart = createTypes(import.meta.url, ScatterChart); diff --git a/docs/pages/x/api/charts/types.scatter-plot.ts b/docs/pages/x/api/charts/types.scatter-plot.ts new file mode 100644 index 0000000000000..b7296d8e58bfe --- /dev/null +++ b/docs/pages/x/api/charts/types.scatter-plot.ts @@ -0,0 +1,4 @@ +import { ScatterPlot } from '@mui/x-charts/ScatterChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesScatterPlot = createTypes(import.meta.url, ScatterPlot); diff --git a/docs/pages/x/api/charts/types.scatter-series.ts b/docs/pages/x/api/charts/types.scatter-series.ts new file mode 100644 index 0000000000000..b8d75de8b2f46 --- /dev/null +++ b/docs/pages/x/api/charts/types.scatter-series.ts @@ -0,0 +1,4 @@ +import { ScatterSeries } from '@mui/x-charts-premium'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesScatterSeries = createTypes(import.meta.url, ScatterSeries); diff --git a/docs/pages/x/api/charts/types.scatter.md b/docs/pages/x/api/charts/types.scatter.md new file mode 100644 index 0000000000000..d176e02473899 --- /dev/null +++ b/docs/pages/x/api/charts/types.scatter.md @@ -0,0 +1,1594 @@ +# Charts + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/charts/types.scatter.md' + +## API Reference + +### FocusedScatterMark + +### Scatter + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [Scatter API](https://mui.com/x/api/charts/scatter/) + +**Scatter Props:** + +| Prop | Type | Default | Description | +| :------------ | :---------------------------------------------------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| color\* | `string` | - | - | +| colorGetter\* | `((dataIndex?: number) => string)` | - | Function to get the color of a scatter item given its data index. The data index argument is optional. If not provided, the color for the entire series is returned. If provided, the color for the specific scatter item is returned. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| series\* | `DefaultizedScatterSeriesType` | - | - | +| slotProps | `ScatterSlotProps` | - | - | +| slots | `ScatterSlots` | - | - | +| xScale\* | `D3Scale` | - | - | +| yScale\* | `D3Scale` | - | - | + +### ScatterChart + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/) + +**ScatterChart Props:** + +| Prop | Type | Default | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| apiRef | `React.RefObject \| undefined>` | - | - | +| axesGap | `number` | `0` | A gap added between axes when multiple axes are rendered on the same side of the chart. | +| axisHighlight | `ChartsAxisHighlightProps` | `{ x: 'none', y: 'none' }` | The configuration of axes highlight. | +| brushConfig | `BrushConfig` | - | Configuration for the brush interaction. | +| colors | `ChartsColorPalette` | `rainbowSurgePalette` | Color palette used to colorize multiple series. | +| dataset | `DatasetElementType[]` | - | An array of objects that can be used to populate series and axes data using their `dataKey` property. | +| desc | `string` | - | The description of the chart. Used to provide an accessible description for the chart. | +| disableAxisListener | `boolean` | `false` | If `true`, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance. | +| disableClosestPoint | `boolean` | `false` | If true, the closest point interaction is disabled and falls back to hover events. | +| disableHitArea | `boolean` | `false` | If true, the hit area interaction is disabled and falls back to hover events. | +| disableKeyboardNavigation | `boolean` | - | If `true`, disables keyboard navigation for the chart. | +| disableVoronoi | `boolean` | `false` | If true, the interaction will not use the Voronoi cell and fall back to hover events. | +| experimentalFeatures | `ChartExperimentalFeatures` | - | Options to enable features planned for the next major. | +| grid | `Pick` | - | Option to display a cartesian grid in the background. | +| height | `number` | - | The height of the chart in px. If not defined, it takes the height of the parent element. | +| hiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of hidden series and/or items. Different chart types use different keys. | +| hideLegend | `boolean` | - | If `true`, the legend is not rendered. | +| highlightedItem | `{ type: 'scatter'; seriesId: string; dataIndex?: number } \| Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> \| null` | - | The highlighted item. Used when the highlight is controlled. | +| hitAreaRadius | `'item' \| number` | - | Defines the maximum distance between a scatter point and the pointer that triggers the interaction. If set to `'item'`, the radius is the `markerSize`. If `undefined`, the radius is assumed to be infinite. | +| initialHiddenItems | `({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } \| VisibilityIdentifier<'scatter'>)[]` | - | List of initially hidden series and/or items. Used for uncontrolled state. Different chart types use different keys. | +| loading | `boolean` | `false` | If `true`, a loading overlay is displayed. | +| localeText | `Partial` | - | Localized text for chart components. | +| margin | `Partial \| number` | - | The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. | +| onAxisClick | `((event: MouseEvent, data: ChartsAxisData \| null) => void)` | - | The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position. | +| onHiddenItemsChange | `((hiddenItems: ({ type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' })[]) => void)` | - | Callback fired when any hidden identifiers change. | +| onHighlightChange | `((highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } \| null) => void)` | - | The callback fired when the highlighted item changes. | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void) \| ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| onTooltipAxisChange | `((axisItems: AxisItemIdentifier[]) => void)` | - | The function called when the pointer position corresponds to a new axis data item. This update can either be caused by a pointer movement, or an axis update. In case of multiple axes, the function is called if at least one axis is updated. The argument contains the identifier for all axes with a `data` property. | +| onTooltipItemChange | `((tooltipItem: ScatterItemIdentifier \| null) => void)` | - | The callback fired when the tooltip item changes. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| series\* | `ScatterSeries[]` | - | The series to display in the scatter chart. An array of \[\[ScatterSeries]] objects. | +| seriesConfig | `{ scatter: ChartSeriesTypeConfig<'scatter'> }` | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. | +| showToolbar | `boolean` | `false` | If true, shows the default chart toolbar. | +| skipAnimation | `boolean` | - | If `true`, animations are skipped. If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. | +| slotProps | `ScatterChartSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterChartSlots` | `{}` | Overridable component slots. | +| sx | `SxProps` | - | - | +| theme | `'light' \| 'dark'` | - | - | +| title | `string` | - | The title of the chart. Used to provide an accessible label for the chart. | +| tooltipAxis | `AxisItemIdentifier[]` | - | The controlled axis tooltip. Identified by the axis id, and data index. | +| tooltipItem | `ScatterItemIdentifier \| Omit \| null` | - | The tooltip item. Used when the tooltip is controlled. | +| width | `number` | - | The width of the chart in px. If not defined, it takes the width of the parent element. | +| xAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the x-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| yAxis | `(MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'> \| MakeOptional, 'id'>)[]` | - | The configuration of the y-axes. If not provided, a default axis config is used. An array of \[\[AxisConfig]] objects. | +| zAxis | `(MakeOptional)[]` | - | The configuration of the z-axes. | +| id | `string` | - | This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +**`hiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +**`initialHiddenItems` Prop Example:** + +```ts +[ + { + type: 'pie', + seriesId: 'series-1', + dataIndex: 3, + }, + { + type: 'line', + seriesId: 'series-2', + }, +]; +``` + +### ScatterMarker + +**ScatterMarker Props:** + +| Prop | Type | Default | Description | +| :-------------- | :------------------------------------------------------------ | :------ | :---------------------------------------------- | +| onClick | `((event: React.MouseEvent) => void)` | - | Callback fired when clicking on a scatter item. | +| color\* | `string` | - | The fill color of the marker. | +| dataIndex\* | `number` | - | The index of the data point. | +| isFaded\* | `boolean` | - | If `true`, the marker is faded. | +| isHighlighted\* | `boolean` | - | If `true`, the marker is highlighted. | +| seriesId\* | `string` | - | The series ID. | +| size\* | `number` | - | The size of the marker. | +| x\* | `number` | - | The x coordinate of the data point. | +| y\* | `number` | - | The y coordinate of the data point. | + +### ScatterPlot + +Demos: + +- [Scatter](https://mui.com/x/react-charts/scatter/) +- [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/) + +API: + +- [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/) + +**ScatterPlot Props:** + +| Prop | Type | Default | Description | +| :---------- | :---------------------------------------------------------------------------------------------------------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| classes | `Partial` | - | - | +| onItemClick | `((event: React.MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void)` | - | Callback fired when clicking on a scatter item. | +| renderer | `RendererType` | `'svg-single'` | The type of renderer to use for the scatter plot. `svg-single`: Renders every scatter item in a `` element.`svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. Read more: https\://mui.com/x/react-charts/scatter/#performance | +| slotProps | `ScatterPlotSlotProps` | `{}` | The props used for each component slot. | +| slots | `ScatterPlotSlots` | `{}` | Overridable component slots. | +| className | `string` | - | - | + +## Additional Types + +### RendererType + +```typescript +type RendererType = 'svg-single' | 'svg-batch'; +``` + +### SCATTER_CHART_PLUGINS + +```typescript +type SCATTER_CHART_PLUGINS = [ + ChartPlugin, + ChartPlugin, + ChartPlugin>, + ChartPlugin, + ChartPlugin>, + ChartPlugin>, + ChartPlugin>, + ChartPlugin, + ChartPlugin, +]; +``` + +### ScatterChartPluginSignatures + +```typescript +type ScatterChartPluginSignatures = ScatterChartPluginSignatures; +``` + +### ScatterChartProps + +````typescript +type ScatterChartProps = { + /** + * The series to display in the scatter chart. + * An array of [[ScatterSeries]] objects. + */ + series: ScatterSeries[]; + /** + * The configuration of axes highlight. + * @default { x: 'none', y: 'none' } + * @see + */ + axisHighlight?: ChartsAxisHighlightProps; + /** Option to display a cartesian grid in the background. */ + grid?: Pick; + /** + * If true, the hit area interaction is disabled and falls back to hover events. + * @default false + */ + disableHitArea?: boolean; + /** + * If true, the closest point interaction is disabled and falls back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableClosestPoint?: boolean; + /** + * If true, the interaction will not use the Voronoi cell and fall back to hover events. + * @default false + * @deprecated Use `disableHitArea` instead. + */ + disableVoronoi?: boolean; + /** If `true`, the legend is not rendered. */ + hideLegend?: boolean; + /** + * If true, shows the default chart toolbar. + * @default false + */ + showToolbar?: boolean; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterChartSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterChartSlotProps; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: + | (( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void) + | ((event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void); + /** The width of the chart in px. If not defined, it takes the width of the parent element. */ + width?: number; + className?: string; + /** The height of the chart in px. If not defined, it takes the height of the parent element. */ + height?: number; + /** + * This prop is used to help implement the accessibility logic. + * If you don't provide this prop. It falls back to a randomly generated id. + */ + id?: string; + children?: React.ReactNode; + /** + * The margin between the SVG and the drawing area. + * It's used for leaving some space for extra information such as the x- and y-axis or legend. + * + * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`. + */ + margin?: Partial | number; + sx?: SxProps; + /** + * The configuration of the x-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + xAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The configuration of the y-axes. + * If not provided, a default axis config is used. + * An array of [[AxisConfig]] objects. + */ + yAxis?: ( + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + | MakeOptional, 'id'> + )[]; + /** + * The title of the chart. + * Used to provide an accessible label for the chart. + */ + title?: string; + /** + * The description of the chart. + * Used to provide an accessible description for the chart. + */ + desc?: string; + apiRef?: React.RefObject | undefined>; + /** + * The configuration for the series types. + * This is used to define how each series type should be processed, colored, and displayed. + */ + seriesConfig?: { scatter: ChartSeriesTypeConfig<'scatter'> }; + /** Localized text for chart components. */ + localeText?: Partial; + /** + * A gap added between axes when multiple axes are rendered on the same side of the chart. + * @default 0 + */ + axesGap?: number; + /** + * Defines the maximum distance between a scatter point and the pointer that triggers the interaction. + * If set to `'item'`, the radius is the `markerSize`. + * If `undefined`, the radius is assumed to be infinite. + */ + hitAreaRadius?: 'item' | number; + /** Options to enable features planned for the next major. */ + experimentalFeatures?: ChartExperimentalFeatures; + /** An array of objects that can be used to populate series and axes data using their `dataKey` property. */ + dataset?: DatasetElementType[]; + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + */ + colors?: ChartsColorPalette; + theme?: 'light' | 'dark'; + /** + * If `true`, animations are skipped. + * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting. + */ + skipAnimation?: boolean; + /** The configuration of the z-axes. */ + zAxis?: MakeOptional[]; + /** Configuration for the brush interaction. */ + brushConfig?: BrushConfig; + /** + * The tooltip item. + * Used when the tooltip is controlled. + */ + tooltipItem?: ScatterItemIdentifier | Omit | null; + /** The callback fired when the tooltip item changes. */ + onTooltipItemChange?: (tooltipItem: ScatterItemIdentifier | null) => void; + /** + * The function called for onClick events. + * The second argument contains information about all line/bar elements at the current mouse position. + */ + onAxisClick?: (event: MouseEvent, data: ChartsAxisData | null) => void; + /** + * The function called when the pointer position corresponds to a new axis data item. + * This update can either be caused by a pointer movement, or an axis update. + * In case of multiple axes, the function is called if at least one axis is updated. + * The argument contains the identifier for all axes with a `data` property. + */ + onTooltipAxisChange?: (axisItems: AxisItemIdentifier[]) => void; + /** + * The controlled axis tooltip. + * Identified by the axis id, and data index. + */ + tooltipAxis?: AxisItemIdentifier[]; + /** + * If `true`, the charts will not listen to the mouse move event. + * It might break interactive features, but will improve performance. + * @default false + */ + disableAxisListener?: boolean; + /** + * The highlighted item. + * Used when the highlight is controlled. + */ + highlightedItem?: + | { type: 'scatter'; seriesId: string; dataIndex?: number } + | Omit<{ type: 'scatter'; seriesId: string; dataIndex?: number }, 'type'> + | null; + /** The callback fired when the highlighted item changes. */ + onHighlightChange?: ( + highlightedItem: { type: 'scatter'; seriesId: string; dataIndex?: number } | null, + ) => void; + /** Callback fired when any hidden identifiers change. */ + onHiddenItemsChange?: ( + hiddenItems: { + type?: 'scatter'; + seriesId?: string; + dataIndex?: number; + seriesId: string; + type: 'scatter'; + }[], + ) => void; + /** + * List of hidden series and/or items. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + hiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** + * List of initially hidden series and/or items. + * Used for uncontrolled state. + * + * Different chart types use different keys. + * @example + * ```ts + * [ + * { + * type: 'pie', + * seriesId: 'series-1', + * dataIndex: 3, + * }, + * { + * type: 'line', + * seriesId: 'series-2', + * } + * ] + * ``` + */ + initialHiddenItems?: ( + | { type?: 'scatter'; seriesId?: string; dataIndex?: number; seriesId: string; type: 'scatter' } + | VisibilityIdentifier<'scatter'> + )[]; + /** If `true`, disables keyboard navigation for the chart. */ + disableKeyboardNavigation?: boolean; + /** + * If `true`, a loading overlay is displayed. + * @default false + */ + loading?: boolean; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; +}; +```` + +### ScatterChartSlotProps + +```typescript +type ScatterChartSlotProps = { + /** + * Slot props for the tooltip component. + * @default {} + */ + tooltip?: Partial>; + axisLine?: Partial>; + axisTick?: Partial>; + axisTickLabel?: Partial; + axisLabel?: Partial; + xAxis?: Partial; + yAxis?: Partial; + scatter?: Partial; + marker?: ScatterMarkerProps; + legend?: ( + | { + onItemClick?: ( + event: React.MouseEvent, + legendItem: SeriesLegendItemContext, + index: number, + ) => void; + classes?: Partial; + toggleVisibilityOnClick?: boolean; + } + | { + minLabel?: string | LabelFormatter; + maxLabel?: string | LabelFormatter; + gradientId?: string; + labelPosition?: 'start' | 'end' | 'extremes'; + reverse?: boolean; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + rotateGradient?: boolean; + thickness?: number; + } + | { + labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; + labelPosition?: 'start' | 'end' | 'extremes' | 'inline-start' | 'inline-end'; + onItemClick?: ( + event: React.MouseEvent, + legendItem: PiecewiseColorLegendItemContext, + index: number, + ) => void; + classes?: Partial; + axisDirection?: 'x' | 'y' | 'z'; + axisId?: AxisId; + markType?: ChartsLabelMarkType; + } + ) & { + /** + * The direction of the legend layout. + * The default depends on the chart. + */ + direction?: Direction; + className?: string; + sx?: SxProps; + tabIndex?: number; + /** + * The position of the legend in relation to the chart. + * This property is only passed to the Chart components, e.g. `ScatterChart`, and not the slots themselves. + * If customization is needed, simply use the composition pattern. + */ + position?: Position; + }; + loadingOverlay?: SlotComponentPropsFromProps; + noDataOverlay?: SlotComponentPropsFromProps; + /** Props for the toolbar component. */ + toolbar?: Partial; + baseButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { ref?: React.Ref; id?: string; disabled?: boolean; tabIndex?: number }; + baseIconButton?: React.DOMAttributes & { + className?: string; + style?: React.CSSProperties; + } & { + ref?: React.Ref; + id?: string; + disabled?: boolean; + tabIndex?: number; + size?: 'small' | 'medium' | 'large'; + }; +}; +``` + +### ScatterChartSlots + +```typescript +type ScatterChartSlots = { + /** + * Custom component for the axis main line. + * @default 'line' + */ + axisLine?: React.JSXElementConstructor>; + /** + * Custom component for the axis tick. + * @default 'line' + */ + axisTick?: React.JSXElementConstructor>; + /** + * Custom component for tick label. + * @default ChartsText + */ + axisTickLabel?: React.JSXElementConstructor; + /** + * Custom component for axis label. + * @default ChartsText + */ + axisLabel?: React.JSXElementConstructor; + /** + * Custom component for the x-axis. + * @default ChartsXAxis + */ + xAxis?: React.JSXElementConstructor; + /** + * Custom component for the y-axis. + * @default ChartsYAxis + */ + yAxis?: React.JSXElementConstructor; + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; + /** + * Custom rendering of the legend. + * @default ChartsLegend + */ + legend?: + | React.JSXElementConstructor + | React.JSXElementConstructor + | React.JSXElementConstructor; + /** + * Overlay component rendered when the chart is in a loading state. + * @default ChartsLoadingOverlay + */ + loadingOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'marker' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'line' + | 'label' + | 'text' + | 'p' + | 'data' + | 'legend' + | 'circle' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Overlay component rendered when the chart has no data to display. + * @default ChartsNoDataOverlay + */ + noDataOverlay?: React.ElementType< + CommonOverlayProps, + | 'symbol' + | 'object' + | 'marker' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'line' + | 'label' + | 'text' + | 'p' + | 'data' + | 'legend' + | 'circle' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the tooltip popper. + * @default ChartsTooltipRoot + */ + tooltip?: React.ElementType< + ( + | { anchor?: 'pointer' | 'node'; trigger?: 'item'; sort?: undefined } + | { anchor?: 'pointer' | 'chart'; trigger?: 'axis'; sort?: 'none' | 'desc' | 'asc' } + | { anchor?: 'pointer'; trigger?: 'none'; sort?: undefined } + ) & { + position?: 'top' | 'bottom' | 'left' | 'right'; + classes?: Partial; + slots?: ChartsTooltipContainerSlots; + slotProps?: ChartsTooltipContainerSlotProps; + }, + | 'symbol' + | 'object' + | 'marker' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'line' + | 'label' + | 'text' + | 'p' + | 'data' + | 'legend' + | 'circle' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + /** + * Custom component for the toolbar. + * @default ChartsToolbar + */ + toolbar?: React.ElementType< + ChartsToolbarProps, + | 'symbol' + | 'object' + | 'marker' + | 'style' + | 'slot' + | 'clipPath' + | 'filter' + | 'mask' + | 'path' + | 'line' + | 'label' + | 'text' + | 'p' + | 'data' + | 'legend' + | 'circle' + | 'mark' + | 'g' + | 'search' + | 'big' + | 'link' + | 'small' + | 'sub' + | 'sup' + | 'a' + | 'abbr' + | 'address' + | 'area' + | 'article' + | 'aside' + | 'audio' + | 'b' + | 'base' + | 'bdi' + | 'bdo' + | 'blockquote' + | 'body' + | 'br' + | 'button' + | 'canvas' + | 'caption' + | 'center' + | 'cite' + | 'code' + | 'col' + | 'colgroup' + | 'datalist' + | 'dd' + | 'del' + | 'details' + | 'dfn' + | 'dialog' + | 'div' + | 'dl' + | 'dt' + | 'em' + | 'embed' + | 'fieldset' + | 'figcaption' + | 'figure' + | 'footer' + | 'form' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'head' + | 'header' + | 'hgroup' + | 'hr' + | 'html' + | 'i' + | 'iframe' + | 'img' + | 'input' + | 'ins' + | 'kbd' + | 'keygen' + | 'li' + | 'main' + | 'map' + | 'menu' + | 'menuitem' + | 'meta' + | 'meter' + | 'nav' + | 'noindex' + | 'noscript' + | 'ol' + | 'optgroup' + | 'option' + | 'output' + | 'param' + | 'picture' + | 'pre' + | 'progress' + | 'q' + | 'rp' + | 'rt' + | 'ruby' + | 's' + | 'samp' + | 'script' + | 'section' + | 'select' + | 'source' + | 'span' + | 'strong' + | 'summary' + | 'table' + | 'template' + | 'tbody' + | 'td' + | 'textarea' + | 'tfoot' + | 'th' + | 'thead' + | 'time' + | 'title' + | 'tr' + | 'track' + | 'u' + | 'ul' + | 'var' + | 'video' + | 'wbr' + | 'webview' + | 'svg' + | 'animate' + | 'animateMotion' + | 'animateTransform' + | 'defs' + | 'desc' + | 'ellipse' + | 'feBlend' + | 'feColorMatrix' + | 'feComponentTransfer' + | 'feComposite' + | 'feConvolveMatrix' + | 'feDiffuseLighting' + | 'feDisplacementMap' + | 'feDistantLight' + | 'feDropShadow' + | 'feFlood' + | 'feFuncA' + | 'feFuncB' + | 'feFuncG' + | 'feFuncR' + | 'feGaussianBlur' + | 'feImage' + | 'feMerge' + | 'feMergeNode' + | 'feMorphology' + | 'feOffset' + | 'fePointLight' + | 'feSpecularLighting' + | 'feSpotLight' + | 'feTile' + | 'feTurbulence' + | 'foreignObject' + | 'image' + | 'linearGradient' + | 'metadata' + | 'mpath' + | 'pattern' + | 'polygon' + | 'polyline' + | 'radialGradient' + | 'rect' + | 'set' + | 'stop' + | 'switch' + | 'textPath' + | 'tspan' + | 'use' + | 'view' + >; + baseButton?: React.ComponentType; + baseIconButton?: React.ComponentType; +}; +``` + +### scatterClasses + +```typescript +type scatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClasses + +```typescript +type ScatterClasses = { + /** Styles applied to the scatter plot element. */ + root: string; + /** Styles applied to the group surrounding a series' scatter elements. */ + series: string; + /** + * Styles applied to an individual scatter marker element. + * Not applied when using the `svg-batch` renderer. + */ + marker: string; + /** Styles applied to the focused scatter mark element. */ + focusedMark: string; +}; +``` + +### ScatterClassKey + +```typescript +type ScatterClassKey = 'root' | 'series' | 'marker' | 'focusedMark'; +``` + +### ScatterMarkerProps + +```typescript +type ScatterMarkerProps = { + /** The series ID. */ + seriesId: string; + /** The index of the data point. */ + dataIndex: number; + /** The x coordinate of the data point. */ + x: number; + /** The y coordinate of the data point. */ + y: number; + /** The fill color of the marker. */ + color: string; + /** The size of the marker. */ + size: number; + /** If `true`, the marker is highlighted. */ + isHighlighted: boolean; + /** If `true`, the marker is faded. */ + isFaded: boolean; + /** Callback fired when clicking on a scatter item. */ + onClick?: (event: React.MouseEvent) => void; +}; +``` + +### ScatterMarkerSlotExtension + +```typescript +type ScatterMarkerSlotExtension = { + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterMarkerSlotProps; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterMarkerSlots; +}; +``` + +### ScatterMarkerSlotProps + +```typescript +type ScatterMarkerSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterMarkerSlots + +```typescript +type ScatterMarkerSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterPlotProps + +```typescript +type ScatterPlotProps = { + className?: string; + /** + * Overridable component slots. + * @default {} + */ + slots?: ScatterPlotSlots; + /** + * The props used for each component slot. + * @default {} + */ + slotProps?: ScatterPlotSlotProps; + /** + * The type of renderer to use for the scatter plot. + * - `svg-single`: Renders every scatter item in a `` element. + * - `svg-batch`: Batch renders scatter items in `` elements for better performance with large datasets, at the cost of some limitations. + * Read more: https://mui.com/x/react-charts/scatter/#performance + * @default 'svg-single' + */ + renderer?: RendererType; + classes?: Partial; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; +}; +``` + +### ScatterPlotSlotProps + +```typescript +type ScatterPlotSlotProps = { scatter?: Partial; marker?: ScatterMarkerProps }; +``` + +### ScatterPlotSlots + +```typescript +type ScatterPlotSlots = { + scatter?: React.JSXElementConstructor; + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +### ScatterProps + +```typescript +type ScatterProps = { + series: DefaultizedScatterSeriesType; + xScale: D3Scale; + yScale: D3Scale; + color: string; + /** + * Function to get the color of a scatter item given its data index. + * The data index argument is optional. If not provided, the color for the entire series is returned. + * If provided, the color for the specific scatter item is returned. + */ + colorGetter: (dataIndex?: number) => string; + /** Callback fired when clicking on a scatter item. */ + onItemClick?: ( + event: React.MouseEvent, + scatterItemIdentifier: ScatterItemIdentifier, + ) => void; + classes?: Partial; + slots?: ScatterSlots; + slotProps?: ScatterSlotProps; +}; +``` + +### ScatterSeries + +```typescript +type ScatterSeries = MakeOptional; +``` + +### ScatterSlotProps + +```typescript +type ScatterSlotProps = { marker?: ScatterMarkerProps }; +``` + +### ScatterSlots + +```typescript +type ScatterSlots = { + /** + * The component that renders the marker for a scatter point. + * @default ScatterMarker + */ + marker?: React.JSXElementConstructor; +}; +``` + +## External Types + +### Direction + +```typescript +type Direction = 'vertical' | 'horizontal'; +``` + +### LabelFormatter + +```typescript +type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string; +``` + +### AxisId + +```typescript +type AxisId = string | number; +``` + +### ChartPlugin + +```typescript +type ChartPlugin = (options: { + instance: unknown; + params: unknown; + store: { state: unknown; subscribe: unknown; getSnapshot: unknown; use: unknown }; + plugins: unknown; +}) => unknown; +``` diff --git a/docs/pages/x/api/charts/types.scatter.ts b/docs/pages/x/api/charts/types.scatter.ts new file mode 100644 index 0000000000000..3d81855d75317 --- /dev/null +++ b/docs/pages/x/api/charts/types.scatter.ts @@ -0,0 +1,4 @@ +import { Scatter } from '@mui/x-charts/ScatterChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesScatter = createTypes(import.meta.url, Scatter); diff --git a/docs/pages/x/api/charts/types.spark-line-chart.ts b/docs/pages/x/api/charts/types.spark-line-chart.ts new file mode 100644 index 0000000000000..a3bd7888d4312 --- /dev/null +++ b/docs/pages/x/api/charts/types.spark-line-chart.ts @@ -0,0 +1,4 @@ +import { SparkLineChart } from '@mui/x-charts/SparkLineChart'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesSparkLineChart = createTypes(import.meta.url, SparkLineChart); diff --git a/docs/pages/x/api/charts/types.toolbar-button.ts b/docs/pages/x/api/charts/types.toolbar-button.ts new file mode 100644 index 0000000000000..e1978e7323077 --- /dev/null +++ b/docs/pages/x/api/charts/types.toolbar-button.ts @@ -0,0 +1,4 @@ +import { ToolbarButton } from '@mui/x-charts/Toolbar'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesToolbarButton = createTypes(import.meta.url, ToolbarButton); diff --git a/docs/pages/x/api/charts/types.toolbar.ts b/docs/pages/x/api/charts/types.toolbar.ts new file mode 100644 index 0000000000000..656047c013a8b --- /dev/null +++ b/docs/pages/x/api/charts/types.toolbar.ts @@ -0,0 +1,4 @@ +import { Toolbar } from '@mui/x-charts/Toolbar'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesToolbar = createTypes(import.meta.url, Toolbar); diff --git a/docs/pages/x/api/chat/chat-box.js b/docs/pages/x/api/chat/chat-box.js index 3d46dac5f4f00..f52f97768b557 100644 --- a/docs/pages/x/api/chat/chat-box.js +++ b/docs/pages/x/api/chat/chat-box.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-box.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatBox } from './types.chat-box'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['classes', 'currentUser', 'density', 'features', 'initialActiveConversationId', 'initialComposerValue', 'initialConversations', 'initialMessages', 'members', 'slotProps', 'slots', 'storeClass', 'streamFlushInterval', 'suggestions', 'suggestionsAutoSubmit', 'variant']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-box', - false, - /\.\/chat-box.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-code-block.js b/docs/pages/x/api/chat/chat-code-block.js index 0644805bcded5..a0b4db17e82da 100644 --- a/docs/pages/x/api/chat/chat-code-block.js +++ b/docs/pages/x/api/chat/chat-code-block.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-code-block.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatCodeBlock } from './types.chat-code-block'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['children', 'highlighter', 'language']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-code-block', - false, - /\.\/chat-code-block.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-composer-attach-button.js b/docs/pages/x/api/chat/chat-composer-attach-button.js index d33e020358f39..0ec557da0d1f8 100644 --- a/docs/pages/x/api/chat/chat-composer-attach-button.js +++ b/docs/pages/x/api/chat/chat-composer-attach-button.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-composer-attach-button.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatComposerAttachButton } from './types.chat-composer-attach-button'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-composer-attach-button', - false, - /\.\/chat-composer-attach-button.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-composer-attachment-list.js b/docs/pages/x/api/chat/chat-composer-attachment-list.js index abf08de5fda07..19f83010ede1d 100644 --- a/docs/pages/x/api/chat/chat-composer-attachment-list.js +++ b/docs/pages/x/api/chat/chat-composer-attachment-list.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-composer-attachment-list.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatComposerAttachmentList } from './types.chat-composer-attachment-list'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-composer-attachment-list', - false, - /\.\/chat-composer-attachment-list.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-composer-helper-text.js b/docs/pages/x/api/chat/chat-composer-helper-text.js index 49ed57b7c13d6..8076216b408c0 100644 --- a/docs/pages/x/api/chat/chat-composer-helper-text.js +++ b/docs/pages/x/api/chat/chat-composer-helper-text.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-composer-helper-text.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatComposerHelperText } from './types.chat-composer-helper-text'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-composer-helper-text', - false, - /\.\/chat-composer-helper-text.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-composer-label.js b/docs/pages/x/api/chat/chat-composer-label.js index 84acfd9d2d9ab..bdf8927155ce7 100644 --- a/docs/pages/x/api/chat/chat-composer-label.js +++ b/docs/pages/x/api/chat/chat-composer-label.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-composer-label.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatComposerLabel } from './types.chat-composer-label'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['children', 'htmlFor']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-composer-label', - false, - /\.\/chat-composer-label.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-composer-send-button.js b/docs/pages/x/api/chat/chat-composer-send-button.js index 987fd52638d4a..0cd884d3ab750 100644 --- a/docs/pages/x/api/chat/chat-composer-send-button.js +++ b/docs/pages/x/api/chat/chat-composer-send-button.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-composer-send-button.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatComposerSendButton } from './types.chat-composer-send-button'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-composer-send-button', - false, - /\.\/chat-composer-send-button.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-composer-text-area.js b/docs/pages/x/api/chat/chat-composer-text-area.js index 7c55a681d4bae..025adc5f8cf34 100644 --- a/docs/pages/x/api/chat/chat-composer-text-area.js +++ b/docs/pages/x/api/chat/chat-composer-text-area.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-composer-text-area.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatComposerTextArea } from './types.chat-composer-text-area'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['maxRows']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-composer-text-area', - false, - /\.\/chat-composer-text-area.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-composer-toolbar.js b/docs/pages/x/api/chat/chat-composer-toolbar.js index 963453c41dc3b..d0dc6edb0dba8 100644 --- a/docs/pages/x/api/chat/chat-composer-toolbar.js +++ b/docs/pages/x/api/chat/chat-composer-toolbar.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-composer-toolbar.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatComposerToolbar } from './types.chat-composer-toolbar'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-composer-toolbar', - false, - /\.\/chat-composer-toolbar.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-confirmation.js b/docs/pages/x/api/chat/chat-confirmation.js index e52295ce9aa24..14cce507c3a8f 100644 --- a/docs/pages/x/api/chat/chat-confirmation.js +++ b/docs/pages/x/api/chat/chat-confirmation.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-confirmation.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConfirmation } from './types.chat-confirmation'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['cancelLabel', 'confirmLabel', 'message', 'onCancel', 'onConfirm']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-confirmation', - false, - /\.\/chat-confirmation.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-conversation-header-actions.js b/docs/pages/x/api/chat/chat-conversation-header-actions.js index 3b1e740de4cbd..e28e9ffbcf06f 100644 --- a/docs/pages/x/api/chat/chat-conversation-header-actions.js +++ b/docs/pages/x/api/chat/chat-conversation-header-actions.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-conversation-header-actions.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConversationHeaderActions } from './types.chat-conversation-header-actions'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-conversation-header-actions', - false, - /\.\/chat-conversation-header-actions.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-conversation-header-info.js b/docs/pages/x/api/chat/chat-conversation-header-info.js index 83d9151d5ddda..47ca734864c66 100644 --- a/docs/pages/x/api/chat/chat-conversation-header-info.js +++ b/docs/pages/x/api/chat/chat-conversation-header-info.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-conversation-header-info.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConversationHeaderInfo } from './types.chat-conversation-header-info'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-conversation-header-info', - false, - /\.\/chat-conversation-header-info.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-conversation-header.js b/docs/pages/x/api/chat/chat-conversation-header.js index a8cfa1a507899..16f5ec68abcc7 100644 --- a/docs/pages/x/api/chat/chat-conversation-header.js +++ b/docs/pages/x/api/chat/chat-conversation-header.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-conversation-header.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConversationHeader } from './types.chat-conversation-header'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-conversation-header', - false, - /\.\/chat-conversation-header.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-conversation-list.js b/docs/pages/x/api/chat/chat-conversation-list.js index cfaedfb0c3980..ab5c57000c133 100644 --- a/docs/pages/x/api/chat/chat-conversation-list.js +++ b/docs/pages/x/api/chat/chat-conversation-list.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-conversation-list.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConversationList } from './types.chat-conversation-list'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['variant']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-conversation-list', - false, - /\.\/chat-conversation-list.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-conversation-subtitle.js b/docs/pages/x/api/chat/chat-conversation-subtitle.js index 403a1905786f2..734bdfb573eac 100644 --- a/docs/pages/x/api/chat/chat-conversation-subtitle.js +++ b/docs/pages/x/api/chat/chat-conversation-subtitle.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-conversation-subtitle.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConversationSubtitle } from './types.chat-conversation-subtitle'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-conversation-subtitle', - false, - /\.\/chat-conversation-subtitle.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-conversation-title.js b/docs/pages/x/api/chat/chat-conversation-title.js index cf094cf43571c..0fe11d9e20e06 100644 --- a/docs/pages/x/api/chat/chat-conversation-title.js +++ b/docs/pages/x/api/chat/chat-conversation-title.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-conversation-title.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConversationTitle } from './types.chat-conversation-title'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-conversation-title', - false, - /\.\/chat-conversation-title.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-conversation.js b/docs/pages/x/api/chat/chat-conversation.js index d48a6a3c2d8c5..25eb37e1a1634 100644 --- a/docs/pages/x/api/chat/chat-conversation.js +++ b/docs/pages/x/api/chat/chat-conversation.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-conversation.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatConversation } from './types.chat-conversation'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-conversation', - false, - /\.\/chat-conversation.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-date-divider.js b/docs/pages/x/api/chat/chat-date-divider.js index 697e3570e4dc3..28b0665174ef3 100644 --- a/docs/pages/x/api/chat/chat-date-divider.js +++ b/docs/pages/x/api/chat/chat-date-divider.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-date-divider.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatDateDivider } from './types.chat-date-divider'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-date-divider', - false, - /\.\/chat-date-divider.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-layout.js b/docs/pages/x/api/chat/chat-layout.js index 0ad07378240d7..eaa6e4ecb31e0 100644 --- a/docs/pages/x/api/chat/chat-layout.js +++ b/docs/pages/x/api/chat/chat-layout.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-layout.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatLayout } from './types.chat-layout'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-layout', - false, - /\.\/chat-layout.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-actions.js b/docs/pages/x/api/chat/chat-message-actions.js index 8d2c4655a64fd..1b2b690123cbb 100644 --- a/docs/pages/x/api/chat/chat-message-actions.js +++ b/docs/pages/x/api/chat/chat-message-actions.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-actions.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageActions } from './types.chat-message-actions'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-actions', - false, - /\.\/chat-message-actions.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-author-label.js b/docs/pages/x/api/chat/chat-message-author-label.js index e5eea69525aa8..8d02d75c79b0f 100644 --- a/docs/pages/x/api/chat/chat-message-author-label.js +++ b/docs/pages/x/api/chat/chat-message-author-label.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-author-label.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageAuthorLabel } from './types.chat-message-author-label'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-author-label', - false, - /\.\/chat-message-author-label.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-avatar.js b/docs/pages/x/api/chat/chat-message-avatar.js index 3b3c4434c9118..532f149ec18b7 100644 --- a/docs/pages/x/api/chat/chat-message-avatar.js +++ b/docs/pages/x/api/chat/chat-message-avatar.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-avatar.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageAvatar } from './types.chat-message-avatar'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-avatar', - false, - /\.\/chat-message-avatar.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-content.js b/docs/pages/x/api/chat/chat-message-content.js index 8a67fd98fe649..05c2f178050ba 100644 --- a/docs/pages/x/api/chat/chat-message-content.js +++ b/docs/pages/x/api/chat/chat-message-content.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-content.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageContent } from './types.chat-message-content'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['afterContent', 'partProps']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-content', - false, - /\.\/chat-message-content.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-group.js b/docs/pages/x/api/chat/chat-message-group.js index cf27d66635f64..28881f17d429a 100644 --- a/docs/pages/x/api/chat/chat-message-group.js +++ b/docs/pages/x/api/chat/chat-message-group.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-group.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageGroup } from './types.chat-message-group'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['groupKey']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-group', - false, - /\.\/chat-message-group.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-inline-meta.js b/docs/pages/x/api/chat/chat-message-inline-meta.js index d03f38357e033..b6a8eb583fba6 100644 --- a/docs/pages/x/api/chat/chat-message-inline-meta.js +++ b/docs/pages/x/api/chat/chat-message-inline-meta.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-inline-meta.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageInlineMeta } from './types.chat-message-inline-meta'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-inline-meta', - false, - /\.\/chat-message-inline-meta.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-list.js b/docs/pages/x/api/chat/chat-message-list.js index eb1b9979fcdae..d0c01ed580d13 100644 --- a/docs/pages/x/api/chat/chat-message-list.js +++ b/docs/pages/x/api/chat/chat-message-list.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-list.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageList } from './types.chat-message-list'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['autoScroll']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-list', - false, - /\.\/chat-message-list.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-meta.js b/docs/pages/x/api/chat/chat-message-meta.js index 43e4ca739f5e4..b36e87f530130 100644 --- a/docs/pages/x/api/chat/chat-message-meta.js +++ b/docs/pages/x/api/chat/chat-message-meta.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-meta.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageMeta } from './types.chat-message-meta'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-meta', - false, - /\.\/chat-message-meta.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-skeleton.js b/docs/pages/x/api/chat/chat-message-skeleton.js index 731f480d2a5ba..51da667048ceb 100644 --- a/docs/pages/x/api/chat/chat-message-skeleton.js +++ b/docs/pages/x/api/chat/chat-message-skeleton.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-skeleton.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageSkeleton } from './types.chat-message-skeleton'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['lines']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-skeleton', - false, - /\.\/chat-message-skeleton.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-source.js b/docs/pages/x/api/chat/chat-message-source.js index 9984e5a7022ec..ead46f224053a 100644 --- a/docs/pages/x/api/chat/chat-message-source.js +++ b/docs/pages/x/api/chat/chat-message-source.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-source.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageSource } from './types.chat-message-source'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['href', 'index', 'title']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-source', - false, - /\.\/chat-message-source.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-message-sources.js b/docs/pages/x/api/chat/chat-message-sources.js index b1031d8390279..f4e028445d58e 100644 --- a/docs/pages/x/api/chat/chat-message-sources.js +++ b/docs/pages/x/api/chat/chat-message-sources.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-message-sources.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatMessageSources } from './types.chat-message-sources'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['label']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-message-sources', - false, - /\.\/chat-message-sources.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-provider.js b/docs/pages/x/api/chat/chat-provider.js index efc59933f95f5..9495d6e39c27f 100644 --- a/docs/pages/x/api/chat/chat-provider.js +++ b/docs/pages/x/api/chat/chat-provider.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-provider.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatProvider } from './types.chat-provider'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-provider', - false, - /\.\/chat-provider.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-root.js b/docs/pages/x/api/chat/chat-root.js index 3b5befcf21eb9..5a560a40c2f95 100644 --- a/docs/pages/x/api/chat/chat-root.js +++ b/docs/pages/x/api/chat/chat-root.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-root.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatRoot } from './types.chat-root'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-root', - false, - /\.\/chat-root.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-scroll-to-bottom-affordance.js b/docs/pages/x/api/chat/chat-scroll-to-bottom-affordance.js index 488edbd1d5407..76236efb21f0d 100644 --- a/docs/pages/x/api/chat/chat-scroll-to-bottom-affordance.js +++ b/docs/pages/x/api/chat/chat-scroll-to-bottom-affordance.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-scroll-to-bottom-affordance.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatScrollToBottomAffordance } from './types.chat-scroll-to-bottom-affordance'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-scroll-to-bottom-affordance', - false, - /\.\/chat-scroll-to-bottom-affordance.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-suggestions.js b/docs/pages/x/api/chat/chat-suggestions.js index 1cd9dce8fc31c..fc37b03da6398 100644 --- a/docs/pages/x/api/chat/chat-suggestions.js +++ b/docs/pages/x/api/chat/chat-suggestions.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-suggestions.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatSuggestions } from './types.chat-suggestions'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = ['autoSubmit', 'suggestions']; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-suggestions', - false, - /\.\/chat-suggestions.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-typing-indicator.js b/docs/pages/x/api/chat/chat-typing-indicator.js index b8d50e1e0f480..3ab327a1b18cb 100644 --- a/docs/pages/x/api/chat/chat-typing-indicator.js +++ b/docs/pages/x/api/chat/chat-typing-indicator.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-typing-indicator.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatTypingIndicator } from './types.chat-typing-indicator'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-typing-indicator', - false, - /\.\/chat-typing-indicator.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/chat-unread-marker.js b/docs/pages/x/api/chat/chat-unread-marker.js index e174ad8fdf59e..7176d2482d431 100644 --- a/docs/pages/x/api/chat/chat-unread-marker.js +++ b/docs/pages/x/api/chat/chat-unread-marker.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './chat-unread-marker.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesChatUnreadMarker } from './types.chat-unread-marker'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/chat-unread-marker', - false, - /\.\/chat-unread-marker.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-attach-button.js b/docs/pages/x/api/chat/composer-attach-button.js index fcde0244365d0..de9f25463d2a6 100644 --- a/docs/pages/x/api/chat/composer-attach-button.js +++ b/docs/pages/x/api/chat/composer-attach-button.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-attach-button.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerAttachButton } from './types.composer-attach-button'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-attach-button', - false, - /\.\/composer-attach-button.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-attachment-list.js b/docs/pages/x/api/chat/composer-attachment-list.js index 08a3bd60b0d90..b8396605cf8d1 100644 --- a/docs/pages/x/api/chat/composer-attachment-list.js +++ b/docs/pages/x/api/chat/composer-attachment-list.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-attachment-list.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerAttachmentList } from './types.composer-attachment-list'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-attachment-list', - false, - /\.\/composer-attachment-list.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-helper-text.js b/docs/pages/x/api/chat/composer-helper-text.js index 16b9ca1bf2a0b..572fcf9cb0e82 100644 --- a/docs/pages/x/api/chat/composer-helper-text.js +++ b/docs/pages/x/api/chat/composer-helper-text.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-helper-text.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerHelperText } from './types.composer-helper-text'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-helper-text', - false, - /\.\/composer-helper-text.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-label.js b/docs/pages/x/api/chat/composer-label.js index 02e063a29d6cb..08a083617bc82 100644 --- a/docs/pages/x/api/chat/composer-label.js +++ b/docs/pages/x/api/chat/composer-label.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-label.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerLabel } from './types.composer-label'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-label', - false, - /\.\/composer-label.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-root.js b/docs/pages/x/api/chat/composer-root.js index d8039897404a9..aab89b65bff90 100644 --- a/docs/pages/x/api/chat/composer-root.js +++ b/docs/pages/x/api/chat/composer-root.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-root.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerRoot } from './types.composer-root'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-root', - false, - /\.\/composer-root.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-send-button.js b/docs/pages/x/api/chat/composer-send-button.js index dfbb37d3a2886..5b8a993ffebee 100644 --- a/docs/pages/x/api/chat/composer-send-button.js +++ b/docs/pages/x/api/chat/composer-send-button.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-send-button.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerSendButton } from './types.composer-send-button'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-send-button', - false, - /\.\/composer-send-button.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-text-area.js b/docs/pages/x/api/chat/composer-text-area.js index b95a222b3a914..6287b8edf0187 100644 --- a/docs/pages/x/api/chat/composer-text-area.js +++ b/docs/pages/x/api/chat/composer-text-area.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-text-area.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerTextArea } from './types.composer-text-area'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-text-area', - false, - /\.\/composer-text-area.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/composer-toolbar.js b/docs/pages/x/api/chat/composer-toolbar.js index 8a93114c44a5a..ff5ea45bbbeb6 100644 --- a/docs/pages/x/api/chat/composer-toolbar.js +++ b/docs/pages/x/api/chat/composer-toolbar.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './composer-toolbar.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesComposerToolbar } from './types.composer-toolbar'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/composer-toolbar', - false, - /\.\/composer-toolbar.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-header-actions.js b/docs/pages/x/api/chat/conversation-header-actions.js index 0ea9cbd3b34b3..b7ca1019c978a 100644 --- a/docs/pages/x/api/chat/conversation-header-actions.js +++ b/docs/pages/x/api/chat/conversation-header-actions.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-header-actions.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationHeaderActions } from './types.conversation-header-actions'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-header-actions', - false, - /\.\/conversation-header-actions.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-header.js b/docs/pages/x/api/chat/conversation-header.js index c78edd4ce79e6..022cf3fda448f 100644 --- a/docs/pages/x/api/chat/conversation-header.js +++ b/docs/pages/x/api/chat/conversation-header.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-header.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationHeader } from './types.conversation-header'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-header', - false, - /\.\/conversation-header.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-list-item-avatar.js b/docs/pages/x/api/chat/conversation-list-item-avatar.js index f25835287bdfa..fdd409c0e2b2a 100644 --- a/docs/pages/x/api/chat/conversation-list-item-avatar.js +++ b/docs/pages/x/api/chat/conversation-list-item-avatar.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-list-item-avatar.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationListItemAvatar } from './types.conversation-list-item-avatar'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-list-item-avatar', - false, - /\.\/conversation-list-item-avatar.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-list-item.js b/docs/pages/x/api/chat/conversation-list-item.js index eaa07a9622c12..7f32444168148 100644 --- a/docs/pages/x/api/chat/conversation-list-item.js +++ b/docs/pages/x/api/chat/conversation-list-item.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-list-item.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationListItem } from './types.conversation-list-item'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-list-item', - false, - /\.\/conversation-list-item.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-list-preview.js b/docs/pages/x/api/chat/conversation-list-preview.js index 729f3a7f2569b..8ee8c7a56d742 100644 --- a/docs/pages/x/api/chat/conversation-list-preview.js +++ b/docs/pages/x/api/chat/conversation-list-preview.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-list-preview.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationListPreview } from './types.conversation-list-preview'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-list-preview', - false, - /\.\/conversation-list-preview.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-list-root.js b/docs/pages/x/api/chat/conversation-list-root.js index 93eacfa35bebd..44acc5f024dce 100644 --- a/docs/pages/x/api/chat/conversation-list-root.js +++ b/docs/pages/x/api/chat/conversation-list-root.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-list-root.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationListRoot } from './types.conversation-list-root'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-list-root', - false, - /\.\/conversation-list-root.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-list-timestamp.js b/docs/pages/x/api/chat/conversation-list-timestamp.js index aa2fbf389959c..70bcf1a00fa4f 100644 --- a/docs/pages/x/api/chat/conversation-list-timestamp.js +++ b/docs/pages/x/api/chat/conversation-list-timestamp.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-list-timestamp.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationListTimestamp } from './types.conversation-list-timestamp'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-list-timestamp', - false, - /\.\/conversation-list-timestamp.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-list-title.js b/docs/pages/x/api/chat/conversation-list-title.js index 3d45ade591d52..4a9808f57876d 100644 --- a/docs/pages/x/api/chat/conversation-list-title.js +++ b/docs/pages/x/api/chat/conversation-list-title.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-list-title.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationListTitle } from './types.conversation-list-title'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-list-title', - false, - /\.\/conversation-list-title.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-list-unread-badge.js b/docs/pages/x/api/chat/conversation-list-unread-badge.js index 3379146bcb27e..9caf43a647bd3 100644 --- a/docs/pages/x/api/chat/conversation-list-unread-badge.js +++ b/docs/pages/x/api/chat/conversation-list-unread-badge.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-list-unread-badge.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationListUnreadBadge } from './types.conversation-list-unread-badge'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-list-unread-badge', - false, - /\.\/conversation-list-unread-badge.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-root.js b/docs/pages/x/api/chat/conversation-root.js index 212b83c61f04b..4f402bf2c2f73 100644 --- a/docs/pages/x/api/chat/conversation-root.js +++ b/docs/pages/x/api/chat/conversation-root.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-root.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationRoot } from './types.conversation-root'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-root', - false, - /\.\/conversation-root.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-subtitle.js b/docs/pages/x/api/chat/conversation-subtitle.js index 1ea67243de90d..a17661f0a5d25 100644 --- a/docs/pages/x/api/chat/conversation-subtitle.js +++ b/docs/pages/x/api/chat/conversation-subtitle.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-subtitle.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationSubtitle } from './types.conversation-subtitle'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-subtitle', - false, - /\.\/conversation-subtitle.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/conversation-title.js b/docs/pages/x/api/chat/conversation-title.js index 8c837711e78d0..f6d1266a54960 100644 --- a/docs/pages/x/api/chat/conversation-title.js +++ b/docs/pages/x/api/chat/conversation-title.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './conversation-title.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesConversationTitle } from './types.conversation-title'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/conversation-title', - false, - /\.\/conversation-title.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-actions.js b/docs/pages/x/api/chat/message-actions.js index 38b7e1b5cbb94..5c7e94b60a69d 100644 --- a/docs/pages/x/api/chat/message-actions.js +++ b/docs/pages/x/api/chat/message-actions.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-actions.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageActions } from './types.message-actions'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-actions', - false, - /\.\/message-actions.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-author-label.js b/docs/pages/x/api/chat/message-author-label.js index 6a5f5479a864d..6c0a7099195f8 100644 --- a/docs/pages/x/api/chat/message-author-label.js +++ b/docs/pages/x/api/chat/message-author-label.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-author-label.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageAuthorLabel } from './types.message-author-label'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-author-label', - false, - /\.\/message-author-label.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-avatar.js b/docs/pages/x/api/chat/message-avatar.js index ad381e32fd5b7..a840791520b35 100644 --- a/docs/pages/x/api/chat/message-avatar.js +++ b/docs/pages/x/api/chat/message-avatar.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-avatar.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageAvatar } from './types.message-avatar'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-avatar', - false, - /\.\/message-avatar.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-content.js b/docs/pages/x/api/chat/message-content.js index 7f7333d9aefd0..97a41768c30f8 100644 --- a/docs/pages/x/api/chat/message-content.js +++ b/docs/pages/x/api/chat/message-content.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-content.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageContent } from './types.message-content'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-content', - false, - /\.\/message-content.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-group.js b/docs/pages/x/api/chat/message-group.js index 7e11893ecfc7e..abf8a026b0149 100644 --- a/docs/pages/x/api/chat/message-group.js +++ b/docs/pages/x/api/chat/message-group.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-group.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageGroup } from './types.message-group'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-group', - false, - /\.\/message-group.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-list-date-divider.js b/docs/pages/x/api/chat/message-list-date-divider.js index 76c1756eb150c..d4c3d468f259a 100644 --- a/docs/pages/x/api/chat/message-list-date-divider.js +++ b/docs/pages/x/api/chat/message-list-date-divider.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-list-date-divider.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageListDateDivider } from './types.message-list-date-divider'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-list-date-divider', - false, - /\.\/message-list-date-divider.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-list-root.js b/docs/pages/x/api/chat/message-list-root.js index 5624495c9113d..8d403f3806491 100644 --- a/docs/pages/x/api/chat/message-list-root.js +++ b/docs/pages/x/api/chat/message-list-root.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-list-root.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageListRoot } from './types.message-list-root'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-list-root', - false, - /\.\/message-list-root.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-meta.js b/docs/pages/x/api/chat/message-meta.js index 3dc19cab22751..6241295ad6448 100644 --- a/docs/pages/x/api/chat/message-meta.js +++ b/docs/pages/x/api/chat/message-meta.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-meta.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageMeta } from './types.message-meta'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-meta', - false, - /\.\/message-meta.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/message-root.js b/docs/pages/x/api/chat/message-root.js index f197dec72a116..3fe7a46a2a086 100644 --- a/docs/pages/x/api/chat/message-root.js +++ b/docs/pages/x/api/chat/message-root.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './message-root.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesMessageRoot } from './types.message-root'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/message-root', - false, - /\.\/message-root.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/scroll-to-bottom-affordance.js b/docs/pages/x/api/chat/scroll-to-bottom-affordance.js index 99e390db34870..986d53d311937 100644 --- a/docs/pages/x/api/chat/scroll-to-bottom-affordance.js +++ b/docs/pages/x/api/chat/scroll-to-bottom-affordance.js @@ -1,20 +1,12 @@ -import * as React from 'react'; -import ApiPage from 'docs/src/modules/components/ApiPage'; -import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; -import jsonPageContent from './scroll-to-bottom-affordance.json'; +import { TypesPageShell } from 'docsx/src/modules/api-docs/TypesPageShell'; +import { TypesScrollToBottomAffordance } from './types.scroll-to-bottom-affordance'; -export default function Page(props) { - const { descriptions } = props; - return ; -} +const allowedProps = []; -export async function getStaticProps() { - const req = require.context( - 'docsx/translations/api-docs/chat/scroll-to-bottom-affordance', - false, - /\.\/scroll-to-bottom-affordance.*\.json$/, +export default function Page() { + return ( + + + ); - const descriptions = mapApiPageTranslations(req); - - return { props: { descriptions } }; } diff --git a/docs/pages/x/api/chat/types.chat-box.md b/docs/pages/x/api/chat/types.chat-box.md new file mode 100644 index 0000000000000..f2980aab20fba --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-box.md @@ -0,0 +1,395 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-box.md' + +## API Reference + +### ChatBox + +**ChatBox Props:** + +| Prop | Type | Default | Description | +| :-------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| activeConversationId | `string` | - | - | +| adapter\* | `ChatAdapter` | - | - | +| classes | `Partial` | - | Override or extend the styles applied to the component. | +| composerValue | `string` | - | - | +| conversations | `ChatConversation[]` | - | - | +| currentUser | `ChatUser` | - | The local user sending messages. If omitted, derived from `members` by finding the entry with `role === 'user'`. | +| density | `ChatDensity` | `'standard'` | The vertical spacing density of chat messages. `'compact'` – Reduced vertical spacing between messages.`'standard'` – Default spacing.`'comfortable'` – Increased vertical spacing between messages. | +| features | `ChatBoxFeatures` | - | Feature flags to enable or disable built-in ChatBox behaviours. | +| initialActiveConversationId | `string` | - | The initial active conversation ID when uncontrolled. Ignored after initialization and when `activeConversationId` is provided. | +| initialComposerValue | `string` | - | The initial composer value when uncontrolled. Ignored after initialization and when `composerValue` is provided. | +| initialConversations | `ChatConversation[]` | - | The initial conversations when uncontrolled. Ignored after initialization and when `conversations` is provided. | +| initialMessages | `ChatMessage[]` | - | The initial messages when uncontrolled. Ignored after initialization and when `messages` is provided. | +| localeText | `Partial` | - | - | +| members | `ChatUser[]` | - | All participants in the chat. The current (local) user is derived as the first member with `role === 'user'`, unless `currentUser` is provided explicitly. | +| messages | `ChatMessage[]` | - | - | +| onActiveConversationChange | `((conversationId?: string) => void)` | - | - | +| onComposerValueChange | `((value: string) => void)` | - | - | +| onConversationsChange | `((conversations: ChatConversation[]) => void)` | - | - | +| onData | `ChatOnData` | - | - | +| onError | `((error: ChatError) => void)` | - | - | +| onFinish | `ChatOnFinish` | - | - | +| onMessagesChange | `((messages: ChatMessage[]) => void)` | - | - | +| onToolCall | `ChatOnToolCall` | - | - | +| partRenderers | `Partial<{ text: ChatPartRenderer; reasoning: ChatPartRenderer; file: ChatPartRenderer; 'source-url': ChatPartRenderer; 'source-document': ChatPartRenderer; 'step-start': ChatPartRenderer; tool: ChatPartRenderer; 'dynamic-tool': ChatPartRenderer }>` | - | - | +| slotProps | `ChatBoxSlotProps` | - | The extra props for the slot components. | +| slots | `Partial` | - | The components used for each slot inside the ChatBox. | +| storeClass | `ChatStoreConstructor` | `ChatStore` | The store class to use for this provider. | +| streamFlushInterval | `number` | `16` | Flush interval in milliseconds for batching rapid streaming deltas before applying them to the store. | +| suggestions | `(string \| ChatSuggestion)[]` | - | Prompt suggestions displayed in the empty state. Clicking a suggestion pre-fills the composer. | +| suggestionsAutoSubmit | `boolean` | `false` | Whether clicking a suggestion automatically submits the message. | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the chat. `'default'` – Standard layout with avatars, individual timestamps, and full spacing.`'compact'` – Messenger-style layout: no avatars, author + timestamp in group header, tighter spacing. | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### getChatBoxUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatBoxUtilityClasses + +**useChatBoxUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatBoxUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatBoxClasses; +``` + +## Additional Types + +### chatBoxClasses + +```typescript +type chatBoxClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the layout element. */ + layout: string; + /** Styles applied to the conversations pane element. */ + conversationsPane: string; + /** Styles applied to the thread pane element. */ + threadPane: string; +}; +``` + +### ChatBoxClasses + +```typescript +type ChatBoxClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the layout element. */ + layout: string; + /** Styles applied to the conversations pane element. */ + conversationsPane: string; + /** Styles applied to the thread pane element. */ + threadPane: string; +}; +``` + +### ChatBoxClassKey + +```typescript +type ChatBoxClassKey = 'root' | 'layout' | 'conversationsPane' | 'threadPane'; +``` + +### ChatBoxProps + +```typescript +type ChatBoxProps = { + className?: string; + sx?: SxProps; + /** Override or extend the styles applied to the component. */ + classes?: Partial; + /** + * The visual layout variant of the chat. + * - `'default'` – Standard layout with avatars, individual timestamps, and full spacing. + * - `'compact'` – Messenger-style layout: no avatars, author + timestamp in group header, tighter spacing. + * @default 'default' + */ + variant?: ChatVariant; + /** + * The vertical spacing density of chat messages. + * - `'compact'` – Reduced vertical spacing between messages. + * - `'standard'` – Default spacing. + * - `'comfortable'` – Increased vertical spacing between messages. + * @default 'standard' + */ + density?: ChatDensity; + /** The components used for each slot inside the ChatBox. */ + slots?: Partial; + /** The extra props for the slot components. */ + slotProps?: ChatBoxSlotProps; + /** Feature flags to enable or disable built-in ChatBox behaviours. */ + features?: ChatBoxFeatures; + /** + * Prompt suggestions displayed in the empty state. + * Clicking a suggestion pre-fills the composer. + */ + suggestions?: (string | ChatSuggestion)[]; + /** + * Whether clicking a suggestion automatically submits the message. + * @default false + */ + suggestionsAutoSubmit?: boolean; + children?: React.ReactNode; + onError?: (error: ChatError) => void; + localeText?: Partial; + adapter: ChatAdapter; + onToolCall?: ChatOnToolCall; + onFinish?: ChatOnFinish; + onData?: ChatOnData; + /** + * Flush interval in milliseconds for batching rapid streaming deltas before applying them to the store. + * @default 16 + */ + streamFlushInterval?: number; + partRenderers?: Partial<{ + text: ChatPartRenderer; + reasoning: ChatPartRenderer; + file: ChatPartRenderer; + 'source-url': ChatPartRenderer; + 'source-document': ChatPartRenderer; + 'step-start': ChatPartRenderer; + tool: ChatPartRenderer; + 'dynamic-tool': ChatPartRenderer; + }>; + /** + * The store class to use for this provider. + * @default ChatStore + */ + storeClass?: ChatStoreConstructor; + /** All participants in the chat. The current (local) user is derived as the first member with `role === 'user'`, unless `currentUser` is provided explicitly. */ + members?: ChatUser[]; + /** The local user sending messages. If omitted, derived from `members` by finding the entry with `role === 'user'`. */ + currentUser?: ChatUser; + messages?: ChatMessage[]; + /** The initial messages when uncontrolled. Ignored after initialization and when `messages` is provided. */ + initialMessages?: ChatMessage[]; + onMessagesChange?: (messages: ChatMessage[]) => void; + conversations?: ChatConversation[]; + /** The initial conversations when uncontrolled. Ignored after initialization and when `conversations` is provided. */ + initialConversations?: ChatConversation[]; + onConversationsChange?: (conversations: ChatConversation[]) => void; + activeConversationId?: string; + /** The initial active conversation ID when uncontrolled. Ignored after initialization and when `activeConversationId` is provided. */ + initialActiveConversationId?: string; + onActiveConversationChange?: (conversationId?: string) => void; + composerValue?: string; + /** The initial composer value when uncontrolled. Ignored after initialization and when `composerValue` is provided. */ + initialComposerValue?: string; + onComposerValueChange?: (value: string) => void; +}; +``` + +### ChatBoxSlotProps + +```typescript +type ChatBoxSlotProps = { + root?: SlotComponentProps<'div', { sx?: SxProps }, {}>; + layout?: SlotComponentProps<'div', { sx?: SxProps }, {}>; + conversationsPane?: SlotComponentProps<'div', { sx?: SxProps }, {}>; + threadPane?: SlotComponentProps<'div', { sx?: SxProps }, {}>; + conversationList?: Partial; + conversationHeader?: Partial; + conversationTitle?: Partial; + conversationSubtitle?: Partial; + conversationHeaderInfo?: Partial; + conversationHeaderActions?: Partial; + messageList?: Partial; + messageRoot?: Partial; + messageAvatar?: Partial; + messageContent?: Partial; + messageMeta?: Partial; + messageActions?: Partial; + messageGroup?: Partial; + dateDivider?: Partial; + composerRoot?: Partial; + composerInput?: Partial; + composerSendButton?: Partial; + composerAttachButton?: Partial; + composerAttachmentList?: Partial; + composerToolbar?: Partial; + composerHelperText?: Partial; + typingIndicator?: Partial; + unreadMarker?: Partial; + scrollToBottom?: Partial; + suggestions?: Partial; +}; +``` + +### ChatBoxSlots + +```typescript +type ChatBoxSlots = { + /** The outermost container element. Defaults to `div`. */ + root: React.ElementType; + /** The layout element that arranges conversations + thread panes. Defaults to `div`. */ + layout: React.ElementType; + /** The conversations pane container. Defaults to `div`. */ + conversationsPane: React.ElementType; + /** The thread pane container. Defaults to `div`. */ + threadPane: React.ElementType; + /** Override the conversation list component. */ + conversationList: React.ElementType; + /** Override the conversation header component. */ + conversationHeader: React.ElementType; + /** Override the conversation title component. */ + conversationTitle: React.ElementType; + /** Override the conversation subtitle component. */ + conversationSubtitle: React.ElementType; + /** Override the conversation header info wrapper (title + subtitle column). */ + conversationHeaderInfo: React.ElementType; + /** Override the conversation header actions component. */ + conversationHeaderActions: React.ElementType; + /** Override the message list component. */ + messageList: React.ElementType; + /** Override the message root component for each message. */ + messageRoot: React.ElementType; + /** Override the message avatar component. */ + messageAvatar: React.ElementType; + /** Override the message content (bubble) component. */ + messageContent: React.ElementType; + /** Override the message meta component. */ + messageMeta: React.ElementType; + /** Override the message actions component. */ + messageActions: React.ElementType; + /** Override the message group component. */ + messageGroup: React.ElementType; + /** Override the date divider component. */ + dateDivider: React.ElementType; + /** Override the composer (input) root component. */ + composerRoot: React.ElementType; + /** Override the composer textarea component. */ + composerInput: React.ElementType; + /** Override the composer send button. */ + composerSendButton: React.ElementType; + /** Override the composer attach button. */ + composerAttachButton: React.ElementType; + /** Override the composer attachment list. */ + composerAttachmentList: React.ElementType; + /** Override the composer toolbar. */ + composerToolbar: React.ElementType; + /** Override the composer helper text component. */ + composerHelperText: React.ElementType; + /** Override the typing indicator component. */ + typingIndicator: React.ElementType; + /** Override the unread marker component. */ + unreadMarker: React.ElementType; + /** Override the scroll-to-bottom affordance component. */ + scrollToBottom: React.ElementType; + /** Override the prompt suggestions container component. */ + suggestions: React.ElementType; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` + +### ChatDensity + +```typescript +type ChatDensity = 'compact' | 'standard' | 'comfortable'; +``` + +### ChatOnToolCall + +```typescript +type ChatOnToolCall = (payload: { + toolCall: { + toolCallId: string; + toolName: string; + state: + | 'input-streaming' + | 'input-available' + | 'approval-requested' + | 'approval-responded' + | 'output-available' + | 'output-error' + | 'output-denied'; + input?: unknown; + output?: unknown; + errorText?: string | undefined; + approval?: { approved: boolean; reason?: string | undefined } | undefined; + providerExecuted?: boolean | undefined; + title?: string | undefined; + callProviderMetadata?: Record | undefined; + preliminary?: boolean | undefined; + }; +}) => void | Promise; +``` + +### ChatOnFinish + +```typescript +type ChatOnFinish = (payload: { + message: { + id: string; + conversationId?: string | undefined; + role: 'system' | 'user' | 'assistant'; + parts: unknown; + metadata?: {} | undefined; + createdAt?: string | undefined; + updatedAt?: string | undefined; + status?: + | 'pending' + | 'sending' + | 'streaming' + | 'sent' + | 'read' + | 'error' + | 'cancelled' + | undefined; + author?: + | { + id: string; + displayName?: string | undefined; + avatarUrl?: string | undefined; + isOnline?: boolean | undefined; + role?: 'system' | 'user' | 'assistant' | undefined; + metadata?: {} | undefined; + } + | undefined; + editedAt?: string | undefined; + }; + messages: unknown; + isAbort: boolean; + isDisconnect: boolean; + isError: boolean; + finishReason?: string | undefined; +}) => void | Promise; +``` + +### ChatOnData + +```typescript +type ChatOnData = (part: { + type: any; + id?: string | undefined; + data: unknown; + transient?: boolean | undefined; +}) => void | Promise; +``` diff --git a/docs/pages/x/api/chat/types.chat-box.ts b/docs/pages/x/api/chat/types.chat-box.ts new file mode 100644 index 0000000000000..9849e75e94c17 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-box.ts @@ -0,0 +1,4 @@ +import { ChatBox } from '@mui/x-chat/ChatBox'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatBox = createTypes(import.meta.url, ChatBox); diff --git a/docs/pages/x/api/chat/types.chat-code-block.md b/docs/pages/x/api/chat/types.chat-code-block.md new file mode 100644 index 0000000000000..1a3e67f5e3c1a --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-code-block.md @@ -0,0 +1,96 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-code-block.md' + +## API Reference + +### ChatCodeBlock + +**ChatCodeBlock Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------------------------ | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| highlighter | `((code: string, language: string) => React.ReactNode)` | - | Optional syntax highlighter. Receives the code string and a language identifier, and should return highlighted React nodes. When omitted, raw code is displayed. | +| language | `string` | - | Language identifier shown in the header (e.g. "typescript", "python"). | +| children\* | `string` | - | The code string to display. | +| className | `string` | - | - | + +### getChatCodeBlockUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +## Additional Types + +### chatCodeBlockClasses + +```typescript +type chatCodeBlockClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the header element. */ + header: string; + /** Styles applied to the language label element. */ + languageLabel: string; + /** Styles applied to the copy button element. */ + copyButton: string; + /** Styles applied to the pre element. */ + pre: string; + /** Styles applied to the code element. */ + code: string; +}; +``` + +### ChatCodeBlockClasses + +```typescript +type ChatCodeBlockClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the header element. */ + header: string; + /** Styles applied to the language label element. */ + languageLabel: string; + /** Styles applied to the copy button element. */ + copyButton: string; + /** Styles applied to the pre element. */ + pre: string; + /** Styles applied to the code element. */ + code: string; +}; +``` + +### ChatCodeBlockClassKey + +```typescript +type ChatCodeBlockClassKey = 'root' | 'header' | 'languageLabel' | 'copyButton' | 'pre' | 'code'; +``` + +### ChatCodeBlockProps + +```typescript +type ChatCodeBlockProps = { + /** The code string to display. */ + children: string; + /** Language identifier shown in the header (e.g. "typescript", "python"). */ + language?: string; + /** + * Optional syntax highlighter. Receives the code string and a language identifier, + * and should return highlighted React nodes. When omitted, raw code is displayed. + * @returns The highlighted React nodes. + */ + highlighter?: (code: string, language: string) => React.ReactNode; + className?: string; + classes?: Partial; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-code-block.ts b/docs/pages/x/api/chat/types.chat-code-block.ts new file mode 100644 index 0000000000000..abb70f77ed5de --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-code-block.ts @@ -0,0 +1,4 @@ +import { ChatCodeBlock } from '@mui/x-chat/ChatCodeBlock'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatCodeBlock = createTypes(import.meta.url, ChatCodeBlock); diff --git a/docs/pages/x/api/chat/types.chat-composer-attach-button.md b/docs/pages/x/api/chat/types.chat-composer-attach-button.md new file mode 100644 index 0000000000000..4d6dbf81edcfe --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-attach-button.md @@ -0,0 +1,326 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-composer-attach-button.md' + +## API Reference + +### ChatComposer + +**ChatComposer Props:** + +| Prop | Type | Default | Description | +| :--------------- | :----------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| attachmentConfig | `ChatAttachmentsConfig` | - | Configuration for attachment validation constraints. When provided, file attachments are validated against these rules. | +| classes | `Partial` | - | - | +| features | `ChatComposerFeatures` | - | Feature flags to control composer capabilities. | +| slotProps | `ComposerRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the composer. `'default'` – Stacked layout: attachment list, textarea, then toolbar below.`'compact'` – Inline layout: start actions, textarea, end actions in a single row. When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). | +| disabled | `boolean` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachButton + +**ChatComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachmentList + +**ChatComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerHelperText + +**ChatComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerSendButton + +**ChatComposerSendButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerSendButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerTextArea + +**ChatComposerTextArea Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| maxRows | `number` | - | Maximum number of rows the textarea can expand to before it starts scrolling. When set, the textarea starts at 1 row and auto-grows up to `maxRows`. | +| slotProps | `ComposerTextAreaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerToolbar + +**ChatComposerToolbar Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerToolbarSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatComposerUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatComposerUtilityClasses + +**useChatComposerUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatComposerUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatComposerClasses; +``` + +## Additional Types + +### ChatComposerAttachButtonProps + +```typescript +type ChatComposerAttachButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachButtonSlotProps; +}; +``` + +### ChatComposerAttachmentListProps + +```typescript +type ChatComposerAttachmentListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachmentListSlotProps; +}; +``` + +### chatComposerClasses + +```typescript +type chatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClasses + +```typescript +type ChatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClassKey + +```typescript +type ChatComposerClassKey = + | 'disabled' + | 'root' + | 'label' + | 'textArea' + | 'sendButton' + | 'attachButton' + | 'toolbar' + | 'attachmentList' + | 'helperText' + | 'variantCompact'; +``` + +### ChatComposerFeatures + +```typescript +type ChatComposerFeatures = { + /** + * Whether to enable attachment functionality (attach button and attachment preview list), + * and optionally configure attachment validation constraints. + * + * - `true` – enable with no restrictions (default). + * - `false` – disable attachment functionality entirely. + * - `{ acceptedMimeTypes, maxFileCount, maxFileSize, onAttachmentReject }` – enable + * with the specified validation rules. + * @default true + */ + attachments?: boolean | ChatAttachmentsConfig; +}; +``` + +### ChatComposerHelperTextProps + +```typescript +type ChatComposerHelperTextProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerHelperTextSlotProps; +}; +``` + +### ChatComposerProps + +```typescript +type ChatComposerProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** Feature flags to control composer capabilities. */ + features?: ChatComposerFeatures; + /** + * The visual layout variant of the composer. + * - `'default'` – Stacked layout: attachment list, textarea, then toolbar below. + * - `'compact'` – Inline layout: start actions, textarea, end actions in a single row. + * + * When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). + * @default 'default' + */ + variant?: ChatVariant; + disabled?: boolean; + /** + * Configuration for attachment validation constraints. + * When provided, file attachments are validated against these rules. + */ + attachmentConfig?: ChatAttachmentsConfig; + slots?: Partial; + slotProps?: ComposerRootSlotProps; +}; +``` + +### ChatComposerSendButtonProps + +```typescript +type ChatComposerSendButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerSendButtonSlotProps; +}; +``` + +### ChatComposerTextAreaProps + +```typescript +type ChatComposerTextAreaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * Maximum number of rows the textarea can expand to before it starts scrolling. + * When set, the textarea starts at 1 row and auto-grows up to `maxRows`. + */ + maxRows?: number; + slots?: Partial; + slotProps?: ComposerTextAreaSlotProps; +}; +``` + +### ChatComposerToolbarProps + +```typescript +type ChatComposerToolbarProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerToolbarSlotProps; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-composer-attach-button.ts b/docs/pages/x/api/chat/types.chat-composer-attach-button.ts new file mode 100644 index 0000000000000..89af902a4d1ff --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-attach-button.ts @@ -0,0 +1,4 @@ +import { ChatComposerAttachButton } from '@mui/x-chat/ChatComposer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatComposerAttachButton = createTypes(import.meta.url, ChatComposerAttachButton); diff --git a/docs/pages/x/api/chat/types.chat-composer-attachment-list.md b/docs/pages/x/api/chat/types.chat-composer-attachment-list.md new file mode 100644 index 0000000000000..018202998c4ee --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-attachment-list.md @@ -0,0 +1,326 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-composer-attachment-list.md' + +## API Reference + +### ChatComposer + +**ChatComposer Props:** + +| Prop | Type | Default | Description | +| :--------------- | :----------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| attachmentConfig | `ChatAttachmentsConfig` | - | Configuration for attachment validation constraints. When provided, file attachments are validated against these rules. | +| classes | `Partial` | - | - | +| features | `ChatComposerFeatures` | - | Feature flags to control composer capabilities. | +| slotProps | `ComposerRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the composer. `'default'` – Stacked layout: attachment list, textarea, then toolbar below.`'compact'` – Inline layout: start actions, textarea, end actions in a single row. When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). | +| disabled | `boolean` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachButton + +**ChatComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachmentList + +**ChatComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerHelperText + +**ChatComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerSendButton + +**ChatComposerSendButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerSendButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerTextArea + +**ChatComposerTextArea Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| maxRows | `number` | - | Maximum number of rows the textarea can expand to before it starts scrolling. When set, the textarea starts at 1 row and auto-grows up to `maxRows`. | +| slotProps | `ComposerTextAreaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerToolbar + +**ChatComposerToolbar Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerToolbarSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatComposerUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatComposerUtilityClasses + +**useChatComposerUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatComposerUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatComposerClasses; +``` + +## Additional Types + +### ChatComposerAttachButtonProps + +```typescript +type ChatComposerAttachButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachButtonSlotProps; +}; +``` + +### ChatComposerAttachmentListProps + +```typescript +type ChatComposerAttachmentListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachmentListSlotProps; +}; +``` + +### chatComposerClasses + +```typescript +type chatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClasses + +```typescript +type ChatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClassKey + +```typescript +type ChatComposerClassKey = + | 'disabled' + | 'root' + | 'label' + | 'textArea' + | 'sendButton' + | 'attachButton' + | 'toolbar' + | 'attachmentList' + | 'helperText' + | 'variantCompact'; +``` + +### ChatComposerFeatures + +```typescript +type ChatComposerFeatures = { + /** + * Whether to enable attachment functionality (attach button and attachment preview list), + * and optionally configure attachment validation constraints. + * + * - `true` – enable with no restrictions (default). + * - `false` – disable attachment functionality entirely. + * - `{ acceptedMimeTypes, maxFileCount, maxFileSize, onAttachmentReject }` – enable + * with the specified validation rules. + * @default true + */ + attachments?: boolean | ChatAttachmentsConfig; +}; +``` + +### ChatComposerHelperTextProps + +```typescript +type ChatComposerHelperTextProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerHelperTextSlotProps; +}; +``` + +### ChatComposerProps + +```typescript +type ChatComposerProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** Feature flags to control composer capabilities. */ + features?: ChatComposerFeatures; + /** + * The visual layout variant of the composer. + * - `'default'` – Stacked layout: attachment list, textarea, then toolbar below. + * - `'compact'` – Inline layout: start actions, textarea, end actions in a single row. + * + * When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). + * @default 'default' + */ + variant?: ChatVariant; + disabled?: boolean; + /** + * Configuration for attachment validation constraints. + * When provided, file attachments are validated against these rules. + */ + attachmentConfig?: ChatAttachmentsConfig; + slots?: Partial; + slotProps?: ComposerRootSlotProps; +}; +``` + +### ChatComposerSendButtonProps + +```typescript +type ChatComposerSendButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerSendButtonSlotProps; +}; +``` + +### ChatComposerTextAreaProps + +```typescript +type ChatComposerTextAreaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * Maximum number of rows the textarea can expand to before it starts scrolling. + * When set, the textarea starts at 1 row and auto-grows up to `maxRows`. + */ + maxRows?: number; + slots?: Partial; + slotProps?: ComposerTextAreaSlotProps; +}; +``` + +### ChatComposerToolbarProps + +```typescript +type ChatComposerToolbarProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerToolbarSlotProps; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-composer-attachment-list.ts b/docs/pages/x/api/chat/types.chat-composer-attachment-list.ts new file mode 100644 index 0000000000000..579c5aa134ca0 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-attachment-list.ts @@ -0,0 +1,4 @@ +import { ChatComposerAttachmentList } from '@mui/x-chat/ChatComposer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatComposerAttachmentList = createTypes(import.meta.url, ChatComposerAttachmentList); diff --git a/docs/pages/x/api/chat/types.chat-composer-helper-text.md b/docs/pages/x/api/chat/types.chat-composer-helper-text.md new file mode 100644 index 0000000000000..512e617a33559 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-helper-text.md @@ -0,0 +1,326 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-composer-helper-text.md' + +## API Reference + +### ChatComposer + +**ChatComposer Props:** + +| Prop | Type | Default | Description | +| :--------------- | :----------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| attachmentConfig | `ChatAttachmentsConfig` | - | Configuration for attachment validation constraints. When provided, file attachments are validated against these rules. | +| classes | `Partial` | - | - | +| features | `ChatComposerFeatures` | - | Feature flags to control composer capabilities. | +| slotProps | `ComposerRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the composer. `'default'` – Stacked layout: attachment list, textarea, then toolbar below.`'compact'` – Inline layout: start actions, textarea, end actions in a single row. When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). | +| disabled | `boolean` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachButton + +**ChatComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachmentList + +**ChatComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerHelperText + +**ChatComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerSendButton + +**ChatComposerSendButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerSendButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerTextArea + +**ChatComposerTextArea Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| maxRows | `number` | - | Maximum number of rows the textarea can expand to before it starts scrolling. When set, the textarea starts at 1 row and auto-grows up to `maxRows`. | +| slotProps | `ComposerTextAreaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerToolbar + +**ChatComposerToolbar Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerToolbarSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatComposerUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatComposerUtilityClasses + +**useChatComposerUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatComposerUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatComposerClasses; +``` + +## Additional Types + +### ChatComposerAttachButtonProps + +```typescript +type ChatComposerAttachButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachButtonSlotProps; +}; +``` + +### ChatComposerAttachmentListProps + +```typescript +type ChatComposerAttachmentListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachmentListSlotProps; +}; +``` + +### chatComposerClasses + +```typescript +type chatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClasses + +```typescript +type ChatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClassKey + +```typescript +type ChatComposerClassKey = + | 'disabled' + | 'root' + | 'label' + | 'textArea' + | 'sendButton' + | 'attachButton' + | 'toolbar' + | 'attachmentList' + | 'helperText' + | 'variantCompact'; +``` + +### ChatComposerFeatures + +```typescript +type ChatComposerFeatures = { + /** + * Whether to enable attachment functionality (attach button and attachment preview list), + * and optionally configure attachment validation constraints. + * + * - `true` – enable with no restrictions (default). + * - `false` – disable attachment functionality entirely. + * - `{ acceptedMimeTypes, maxFileCount, maxFileSize, onAttachmentReject }` – enable + * with the specified validation rules. + * @default true + */ + attachments?: boolean | ChatAttachmentsConfig; +}; +``` + +### ChatComposerHelperTextProps + +```typescript +type ChatComposerHelperTextProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerHelperTextSlotProps; +}; +``` + +### ChatComposerProps + +```typescript +type ChatComposerProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** Feature flags to control composer capabilities. */ + features?: ChatComposerFeatures; + /** + * The visual layout variant of the composer. + * - `'default'` – Stacked layout: attachment list, textarea, then toolbar below. + * - `'compact'` – Inline layout: start actions, textarea, end actions in a single row. + * + * When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). + * @default 'default' + */ + variant?: ChatVariant; + disabled?: boolean; + /** + * Configuration for attachment validation constraints. + * When provided, file attachments are validated against these rules. + */ + attachmentConfig?: ChatAttachmentsConfig; + slots?: Partial; + slotProps?: ComposerRootSlotProps; +}; +``` + +### ChatComposerSendButtonProps + +```typescript +type ChatComposerSendButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerSendButtonSlotProps; +}; +``` + +### ChatComposerTextAreaProps + +```typescript +type ChatComposerTextAreaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * Maximum number of rows the textarea can expand to before it starts scrolling. + * When set, the textarea starts at 1 row and auto-grows up to `maxRows`. + */ + maxRows?: number; + slots?: Partial; + slotProps?: ComposerTextAreaSlotProps; +}; +``` + +### ChatComposerToolbarProps + +```typescript +type ChatComposerToolbarProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerToolbarSlotProps; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-composer-helper-text.ts b/docs/pages/x/api/chat/types.chat-composer-helper-text.ts new file mode 100644 index 0000000000000..7460c1620cd80 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-helper-text.ts @@ -0,0 +1,4 @@ +import { ChatComposerHelperText } from '@mui/x-chat/ChatComposer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatComposerHelperText = createTypes(import.meta.url, ChatComposerHelperText); diff --git a/docs/pages/x/api/chat/types.chat-composer-label.md b/docs/pages/x/api/chat/types.chat-composer-label.md new file mode 100644 index 0000000000000..1f4df204d4186 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-label.md @@ -0,0 +1,326 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-composer-label.md' + +## API Reference + +### ChatComposer + +**ChatComposer Props:** + +| Prop | Type | Default | Description | +| :--------------- | :----------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| attachmentConfig | `ChatAttachmentsConfig` | - | Configuration for attachment validation constraints. When provided, file attachments are validated against these rules. | +| classes | `Partial` | - | - | +| features | `ChatComposerFeatures` | - | Feature flags to control composer capabilities. | +| slotProps | `ComposerRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the composer. `'default'` – Stacked layout: attachment list, textarea, then toolbar below.`'compact'` – Inline layout: start actions, textarea, end actions in a single row. When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). | +| disabled | `boolean` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachButton + +**ChatComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachmentList + +**ChatComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerHelperText + +**ChatComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerSendButton + +**ChatComposerSendButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerSendButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerTextArea + +**ChatComposerTextArea Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| maxRows | `number` | - | Maximum number of rows the textarea can expand to before it starts scrolling. When set, the textarea starts at 1 row and auto-grows up to `maxRows`. | +| slotProps | `ComposerTextAreaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerToolbar + +**ChatComposerToolbar Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerToolbarSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatComposerUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatComposerUtilityClasses + +**useChatComposerUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatComposerUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatComposerClasses; +``` + +## Additional Types + +### ChatComposerAttachButtonProps + +```typescript +type ChatComposerAttachButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachButtonSlotProps; +}; +``` + +### ChatComposerAttachmentListProps + +```typescript +type ChatComposerAttachmentListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachmentListSlotProps; +}; +``` + +### chatComposerClasses + +```typescript +type chatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClasses + +```typescript +type ChatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClassKey + +```typescript +type ChatComposerClassKey = + | 'disabled' + | 'root' + | 'label' + | 'textArea' + | 'sendButton' + | 'attachButton' + | 'toolbar' + | 'attachmentList' + | 'helperText' + | 'variantCompact'; +``` + +### ChatComposerFeatures + +```typescript +type ChatComposerFeatures = { + /** + * Whether to enable attachment functionality (attach button and attachment preview list), + * and optionally configure attachment validation constraints. + * + * - `true` – enable with no restrictions (default). + * - `false` – disable attachment functionality entirely. + * - `{ acceptedMimeTypes, maxFileCount, maxFileSize, onAttachmentReject }` – enable + * with the specified validation rules. + * @default true + */ + attachments?: boolean | ChatAttachmentsConfig; +}; +``` + +### ChatComposerHelperTextProps + +```typescript +type ChatComposerHelperTextProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerHelperTextSlotProps; +}; +``` + +### ChatComposerProps + +```typescript +type ChatComposerProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** Feature flags to control composer capabilities. */ + features?: ChatComposerFeatures; + /** + * The visual layout variant of the composer. + * - `'default'` – Stacked layout: attachment list, textarea, then toolbar below. + * - `'compact'` – Inline layout: start actions, textarea, end actions in a single row. + * + * When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). + * @default 'default' + */ + variant?: ChatVariant; + disabled?: boolean; + /** + * Configuration for attachment validation constraints. + * When provided, file attachments are validated against these rules. + */ + attachmentConfig?: ChatAttachmentsConfig; + slots?: Partial; + slotProps?: ComposerRootSlotProps; +}; +``` + +### ChatComposerSendButtonProps + +```typescript +type ChatComposerSendButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerSendButtonSlotProps; +}; +``` + +### ChatComposerTextAreaProps + +```typescript +type ChatComposerTextAreaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * Maximum number of rows the textarea can expand to before it starts scrolling. + * When set, the textarea starts at 1 row and auto-grows up to `maxRows`. + */ + maxRows?: number; + slots?: Partial; + slotProps?: ComposerTextAreaSlotProps; +}; +``` + +### ChatComposerToolbarProps + +```typescript +type ChatComposerToolbarProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerToolbarSlotProps; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-composer-label.ts b/docs/pages/x/api/chat/types.chat-composer-label.ts new file mode 100644 index 0000000000000..4389ec87b9ba7 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-label.ts @@ -0,0 +1,4 @@ +import { ChatComposerLabel } from '@mui/x-chat/ChatComposer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatComposerLabel = createTypes(import.meta.url, ChatComposerLabel); diff --git a/docs/pages/x/api/chat/types.chat-composer-send-button.md b/docs/pages/x/api/chat/types.chat-composer-send-button.md new file mode 100644 index 0000000000000..202f8564a2df0 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-send-button.md @@ -0,0 +1,326 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-composer-send-button.md' + +## API Reference + +### ChatComposer + +**ChatComposer Props:** + +| Prop | Type | Default | Description | +| :--------------- | :----------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| attachmentConfig | `ChatAttachmentsConfig` | - | Configuration for attachment validation constraints. When provided, file attachments are validated against these rules. | +| classes | `Partial` | - | - | +| features | `ChatComposerFeatures` | - | Feature flags to control composer capabilities. | +| slotProps | `ComposerRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the composer. `'default'` – Stacked layout: attachment list, textarea, then toolbar below.`'compact'` – Inline layout: start actions, textarea, end actions in a single row. When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). | +| disabled | `boolean` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachButton + +**ChatComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachmentList + +**ChatComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerHelperText + +**ChatComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerSendButton + +**ChatComposerSendButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerSendButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerTextArea + +**ChatComposerTextArea Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| maxRows | `number` | - | Maximum number of rows the textarea can expand to before it starts scrolling. When set, the textarea starts at 1 row and auto-grows up to `maxRows`. | +| slotProps | `ComposerTextAreaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerToolbar + +**ChatComposerToolbar Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerToolbarSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatComposerUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatComposerUtilityClasses + +**useChatComposerUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatComposerUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatComposerClasses; +``` + +## Additional Types + +### ChatComposerAttachButtonProps + +```typescript +type ChatComposerAttachButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachButtonSlotProps; +}; +``` + +### ChatComposerAttachmentListProps + +```typescript +type ChatComposerAttachmentListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachmentListSlotProps; +}; +``` + +### chatComposerClasses + +```typescript +type chatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClasses + +```typescript +type ChatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClassKey + +```typescript +type ChatComposerClassKey = + | 'disabled' + | 'root' + | 'label' + | 'textArea' + | 'sendButton' + | 'attachButton' + | 'toolbar' + | 'attachmentList' + | 'helperText' + | 'variantCompact'; +``` + +### ChatComposerFeatures + +```typescript +type ChatComposerFeatures = { + /** + * Whether to enable attachment functionality (attach button and attachment preview list), + * and optionally configure attachment validation constraints. + * + * - `true` – enable with no restrictions (default). + * - `false` – disable attachment functionality entirely. + * - `{ acceptedMimeTypes, maxFileCount, maxFileSize, onAttachmentReject }` – enable + * with the specified validation rules. + * @default true + */ + attachments?: boolean | ChatAttachmentsConfig; +}; +``` + +### ChatComposerHelperTextProps + +```typescript +type ChatComposerHelperTextProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerHelperTextSlotProps; +}; +``` + +### ChatComposerProps + +```typescript +type ChatComposerProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** Feature flags to control composer capabilities. */ + features?: ChatComposerFeatures; + /** + * The visual layout variant of the composer. + * - `'default'` – Stacked layout: attachment list, textarea, then toolbar below. + * - `'compact'` – Inline layout: start actions, textarea, end actions in a single row. + * + * When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). + * @default 'default' + */ + variant?: ChatVariant; + disabled?: boolean; + /** + * Configuration for attachment validation constraints. + * When provided, file attachments are validated against these rules. + */ + attachmentConfig?: ChatAttachmentsConfig; + slots?: Partial; + slotProps?: ComposerRootSlotProps; +}; +``` + +### ChatComposerSendButtonProps + +```typescript +type ChatComposerSendButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerSendButtonSlotProps; +}; +``` + +### ChatComposerTextAreaProps + +```typescript +type ChatComposerTextAreaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * Maximum number of rows the textarea can expand to before it starts scrolling. + * When set, the textarea starts at 1 row and auto-grows up to `maxRows`. + */ + maxRows?: number; + slots?: Partial; + slotProps?: ComposerTextAreaSlotProps; +}; +``` + +### ChatComposerToolbarProps + +```typescript +type ChatComposerToolbarProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerToolbarSlotProps; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-composer-send-button.ts b/docs/pages/x/api/chat/types.chat-composer-send-button.ts new file mode 100644 index 0000000000000..6c474c9c8c0ee --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-send-button.ts @@ -0,0 +1,4 @@ +import { ChatComposerSendButton } from '@mui/x-chat/ChatComposer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatComposerSendButton = createTypes(import.meta.url, ChatComposerSendButton); diff --git a/docs/pages/x/api/chat/types.chat-composer-text-area.md b/docs/pages/x/api/chat/types.chat-composer-text-area.md new file mode 100644 index 0000000000000..736f3926a329b --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-text-area.md @@ -0,0 +1,326 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-composer-text-area.md' + +## API Reference + +### ChatComposer + +**ChatComposer Props:** + +| Prop | Type | Default | Description | +| :--------------- | :----------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| attachmentConfig | `ChatAttachmentsConfig` | - | Configuration for attachment validation constraints. When provided, file attachments are validated against these rules. | +| classes | `Partial` | - | - | +| features | `ChatComposerFeatures` | - | Feature flags to control composer capabilities. | +| slotProps | `ComposerRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the composer. `'default'` – Stacked layout: attachment list, textarea, then toolbar below.`'compact'` – Inline layout: start actions, textarea, end actions in a single row. When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). | +| disabled | `boolean` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachButton + +**ChatComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachmentList + +**ChatComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerHelperText + +**ChatComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerSendButton + +**ChatComposerSendButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerSendButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerTextArea + +**ChatComposerTextArea Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| maxRows | `number` | - | Maximum number of rows the textarea can expand to before it starts scrolling. When set, the textarea starts at 1 row and auto-grows up to `maxRows`. | +| slotProps | `ComposerTextAreaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerToolbar + +**ChatComposerToolbar Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerToolbarSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatComposerUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatComposerUtilityClasses + +**useChatComposerUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatComposerUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatComposerClasses; +``` + +## Additional Types + +### ChatComposerAttachButtonProps + +```typescript +type ChatComposerAttachButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachButtonSlotProps; +}; +``` + +### ChatComposerAttachmentListProps + +```typescript +type ChatComposerAttachmentListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachmentListSlotProps; +}; +``` + +### chatComposerClasses + +```typescript +type chatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClasses + +```typescript +type ChatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClassKey + +```typescript +type ChatComposerClassKey = + | 'disabled' + | 'root' + | 'label' + | 'textArea' + | 'sendButton' + | 'attachButton' + | 'toolbar' + | 'attachmentList' + | 'helperText' + | 'variantCompact'; +``` + +### ChatComposerFeatures + +```typescript +type ChatComposerFeatures = { + /** + * Whether to enable attachment functionality (attach button and attachment preview list), + * and optionally configure attachment validation constraints. + * + * - `true` – enable with no restrictions (default). + * - `false` – disable attachment functionality entirely. + * - `{ acceptedMimeTypes, maxFileCount, maxFileSize, onAttachmentReject }` – enable + * with the specified validation rules. + * @default true + */ + attachments?: boolean | ChatAttachmentsConfig; +}; +``` + +### ChatComposerHelperTextProps + +```typescript +type ChatComposerHelperTextProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerHelperTextSlotProps; +}; +``` + +### ChatComposerProps + +```typescript +type ChatComposerProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** Feature flags to control composer capabilities. */ + features?: ChatComposerFeatures; + /** + * The visual layout variant of the composer. + * - `'default'` – Stacked layout: attachment list, textarea, then toolbar below. + * - `'compact'` – Inline layout: start actions, textarea, end actions in a single row. + * + * When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). + * @default 'default' + */ + variant?: ChatVariant; + disabled?: boolean; + /** + * Configuration for attachment validation constraints. + * When provided, file attachments are validated against these rules. + */ + attachmentConfig?: ChatAttachmentsConfig; + slots?: Partial; + slotProps?: ComposerRootSlotProps; +}; +``` + +### ChatComposerSendButtonProps + +```typescript +type ChatComposerSendButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerSendButtonSlotProps; +}; +``` + +### ChatComposerTextAreaProps + +```typescript +type ChatComposerTextAreaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * Maximum number of rows the textarea can expand to before it starts scrolling. + * When set, the textarea starts at 1 row and auto-grows up to `maxRows`. + */ + maxRows?: number; + slots?: Partial; + slotProps?: ComposerTextAreaSlotProps; +}; +``` + +### ChatComposerToolbarProps + +```typescript +type ChatComposerToolbarProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerToolbarSlotProps; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-composer-text-area.ts b/docs/pages/x/api/chat/types.chat-composer-text-area.ts new file mode 100644 index 0000000000000..74be49e5716fe --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-text-area.ts @@ -0,0 +1,4 @@ +import { ChatComposerTextArea } from '@mui/x-chat/ChatComposer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatComposerTextArea = createTypes(import.meta.url, ChatComposerTextArea); diff --git a/docs/pages/x/api/chat/types.chat-composer-toolbar.md b/docs/pages/x/api/chat/types.chat-composer-toolbar.md new file mode 100644 index 0000000000000..583ab77ae4395 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-toolbar.md @@ -0,0 +1,326 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-composer-toolbar.md' + +## API Reference + +### ChatComposer + +**ChatComposer Props:** + +| Prop | Type | Default | Description | +| :--------------- | :----------------------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| attachmentConfig | `ChatAttachmentsConfig` | - | Configuration for attachment validation constraints. When provided, file attachments are validated against these rules. | +| classes | `Partial` | - | - | +| features | `ChatComposerFeatures` | - | Feature flags to control composer capabilities. | +| slotProps | `ComposerRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ChatVariant` | `'default'` | The visual layout variant of the composer. `'default'` – Stacked layout: attachment list, textarea, then toolbar below.`'compact'` – Inline layout: start actions, textarea, end actions in a single row. When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). | +| disabled | `boolean` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachButton + +**ChatComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerAttachmentList + +**ChatComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerHelperText + +**ChatComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerSendButton + +**ChatComposerSendButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerSendButtonSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerTextArea + +**ChatComposerTextArea Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| maxRows | `number` | - | Maximum number of rows the textarea can expand to before it starts scrolling. When set, the textarea starts at 1 row and auto-grows up to `maxRows`. | +| slotProps | `ComposerTextAreaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatComposerToolbar + +**ChatComposerToolbar Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------ | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ComposerToolbarSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatComposerUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatComposerUtilityClasses + +**useChatComposerUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatComposerUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatComposerClasses; +``` + +## Additional Types + +### ChatComposerAttachButtonProps + +```typescript +type ChatComposerAttachButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachButtonSlotProps; +}; +``` + +### ChatComposerAttachmentListProps + +```typescript +type ChatComposerAttachmentListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerAttachmentListSlotProps; +}; +``` + +### chatComposerClasses + +```typescript +type chatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClasses + +```typescript +type ChatComposerClasses = { + /** Styles applied to the input root element. */ + root: string; + /** Styles applied to the root element when disabled. */ + disabled: string; + /** Styles applied to the input label element. */ + label: string; + /** Styles applied to the textarea element. */ + textArea: string; + /** Styles applied to the send button element. */ + sendButton: string; + /** Styles applied to the attach button element. */ + attachButton: string; + /** Styles applied to the toolbar element. */ + toolbar: string; + /** Styles applied to the attachment list element. */ + attachmentList: string; + /** Styles applied to the helper text element. */ + helperText: string; + /** Styles applied to the root element when variant="compact". */ + variantCompact: string; +}; +``` + +### ChatComposerClassKey + +```typescript +type ChatComposerClassKey = + | 'disabled' + | 'root' + | 'label' + | 'textArea' + | 'sendButton' + | 'attachButton' + | 'toolbar' + | 'attachmentList' + | 'helperText' + | 'variantCompact'; +``` + +### ChatComposerFeatures + +```typescript +type ChatComposerFeatures = { + /** + * Whether to enable attachment functionality (attach button and attachment preview list), + * and optionally configure attachment validation constraints. + * + * - `true` – enable with no restrictions (default). + * - `false` – disable attachment functionality entirely. + * - `{ acceptedMimeTypes, maxFileCount, maxFileSize, onAttachmentReject }` – enable + * with the specified validation rules. + * @default true + */ + attachments?: boolean | ChatAttachmentsConfig; +}; +``` + +### ChatComposerHelperTextProps + +```typescript +type ChatComposerHelperTextProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerHelperTextSlotProps; +}; +``` + +### ChatComposerProps + +```typescript +type ChatComposerProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** Feature flags to control composer capabilities. */ + features?: ChatComposerFeatures; + /** + * The visual layout variant of the composer. + * - `'default'` – Stacked layout: attachment list, textarea, then toolbar below. + * - `'compact'` – Inline layout: start actions, textarea, end actions in a single row. + * + * When omitted, inherits from the nearest `ChatVariantProvider` (e.g. set by `ChatBox`). + * @default 'default' + */ + variant?: ChatVariant; + disabled?: boolean; + /** + * Configuration for attachment validation constraints. + * When provided, file attachments are validated against these rules. + */ + attachmentConfig?: ChatAttachmentsConfig; + slots?: Partial; + slotProps?: ComposerRootSlotProps; +}; +``` + +### ChatComposerSendButtonProps + +```typescript +type ChatComposerSendButtonProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerSendButtonSlotProps; +}; +``` + +### ChatComposerTextAreaProps + +```typescript +type ChatComposerTextAreaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * Maximum number of rows the textarea can expand to before it starts scrolling. + * When set, the textarea starts at 1 row and auto-grows up to `maxRows`. + */ + maxRows?: number; + slots?: Partial; + slotProps?: ComposerTextAreaSlotProps; +}; +``` + +### ChatComposerToolbarProps + +```typescript +type ChatComposerToolbarProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ComposerToolbarSlotProps; +}; +``` + +## External Types + +### ChatVariant + +```typescript +type ChatVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-composer-toolbar.ts b/docs/pages/x/api/chat/types.chat-composer-toolbar.ts new file mode 100644 index 0000000000000..a162d1aea3ae4 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-composer-toolbar.ts @@ -0,0 +1,4 @@ +import { ChatComposerToolbar } from '@mui/x-chat/ChatComposer'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatComposerToolbar = createTypes(import.meta.url, ChatComposerToolbar); diff --git a/docs/pages/x/api/chat/types.chat-confirmation.md b/docs/pages/x/api/chat/types.chat-confirmation.md new file mode 100644 index 0000000000000..d0b85be5efca4 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-confirmation.md @@ -0,0 +1,110 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-confirmation.md' + +## API Reference + +### ChatConfirmation + +**ChatConfirmation Props:** + +| Prop | Type | Default | Description | +| :----------- | :------------------------------------------- | :---------- | :---------------------------------------------------- | +| cancelLabel | `string` | `'Cancel'` | Label for the cancel button. | +| classes | `Partial` | - | - | +| confirmLabel | `string` | `'Confirm'` | Label for the confirm button. | +| message\* | `string` | - | The question or warning message to display. Required. | +| onCancel | `React.MouseEventHandler` | - | Called when the user clicks the cancel button. | +| onConfirm | `React.MouseEventHandler` | - | Called when the user clicks the confirm button. | +| className | `string` | - | - | + +### getChatConfirmationUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +## Additional Types + +### chatConfirmationClasses + +```typescript +type chatConfirmationClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the icon element. */ + icon: string; + /** Styles applied to the message element. */ + message: string; + /** Styles applied to the actions container element. */ + actions: string; + /** Styles applied to the confirm button element. */ + confirmButton: string; + /** Styles applied to the cancel button element. */ + cancelButton: string; +}; +``` + +### ChatConfirmationClasses + +```typescript +type ChatConfirmationClasses = { + /** Styles applied to the root element. */ + root: string; + /** Styles applied to the icon element. */ + icon: string; + /** Styles applied to the message element. */ + message: string; + /** Styles applied to the actions container element. */ + actions: string; + /** Styles applied to the confirm button element. */ + confirmButton: string; + /** Styles applied to the cancel button element. */ + cancelButton: string; +}; +``` + +### ChatConfirmationClassKey + +```typescript +type ChatConfirmationClassKey = + | 'message' + | 'root' + | 'icon' + | 'actions' + | 'confirmButton' + | 'cancelButton'; +``` + +### ChatConfirmationProps + +```typescript +type ChatConfirmationProps = { + /** The question or warning message to display. Required. */ + message: string; + /** + * Label for the confirm button. + * @default 'Confirm' + */ + confirmLabel?: string; + /** + * Label for the cancel button. + * @default 'Cancel' + */ + cancelLabel?: string; + /** Called when the user clicks the confirm button. */ + onConfirm?: React.MouseEventHandler; + /** Called when the user clicks the cancel button. */ + onCancel?: React.MouseEventHandler; + className?: string; + classes?: Partial; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-confirmation.ts b/docs/pages/x/api/chat/types.chat-confirmation.ts new file mode 100644 index 0000000000000..4ece5df255737 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-confirmation.ts @@ -0,0 +1,4 @@ +import { ChatConfirmation } from '@mui/x-chat/ChatConfirmation'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConfirmation = createTypes(import.meta.url, ChatConfirmation); diff --git a/docs/pages/x/api/chat/types.chat-conversation-header-actions.md b/docs/pages/x/api/chat/types.chat-conversation-header-actions.md new file mode 100644 index 0000000000000..8945f99a912c2 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-header-actions.md @@ -0,0 +1,235 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-conversation-header-actions.md' + +## API Reference + +### ChatConversation + +**ChatConversation Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeader + +**ChatConversationHeader Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderSlotProps` | - | - | +| slots | `Partial` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderActions + +**ChatConversationHeaderActions Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderActionsSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderInfo + +**ChatConversationHeaderInfo Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderInfoSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationSubtitle + +**ChatConversationSubtitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationSubtitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatConversationTitle + +**ChatConversationTitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationTitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatConversationUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatConversationUtilityClasses + +**useChatConversationUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatConversationUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatConversationClasses; +``` + +## Additional Types + +### chatConversationClasses + +```typescript +type chatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClasses + +```typescript +type ChatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClassKey + +```typescript +type ChatConversationClassKey = + | 'title' + | 'root' + | 'header' + | 'headerInfo' + | 'subtitle' + | 'headerActions'; +``` + +### ChatConversationHeaderActionsProps + +```typescript +type ChatConversationHeaderActionsProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderActionsSlotProps; +}; +``` + +### ChatConversationHeaderInfoProps + +```typescript +type ChatConversationHeaderInfoProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderInfoSlotProps; +}; +``` + +### ChatConversationHeaderProps + +```typescript +type ChatConversationHeaderProps = { + className?: string; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderSlotProps; +}; +``` + +### ChatConversationProps + +```typescript +type ChatConversationProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationRootSlotProps; +}; +``` + +### ChatConversationSubtitleProps + +```typescript +type ChatConversationSubtitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationSubtitleSlotProps; +}; +``` + +### ChatConversationTitleProps + +```typescript +type ChatConversationTitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationTitleSlotProps; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-conversation-header-actions.ts b/docs/pages/x/api/chat/types.chat-conversation-header-actions.ts new file mode 100644 index 0000000000000..d28ba6d161854 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-header-actions.ts @@ -0,0 +1,4 @@ +import { ChatConversationHeaderActions } from '@mui/x-chat/ChatConversation'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConversationHeaderActions = createTypes(import.meta.url, ChatConversationHeaderActions); diff --git a/docs/pages/x/api/chat/types.chat-conversation-header-info.md b/docs/pages/x/api/chat/types.chat-conversation-header-info.md new file mode 100644 index 0000000000000..2ec3cd5e8b68f --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-header-info.md @@ -0,0 +1,235 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-conversation-header-info.md' + +## API Reference + +### ChatConversation + +**ChatConversation Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeader + +**ChatConversationHeader Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderSlotProps` | - | - | +| slots | `Partial` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderActions + +**ChatConversationHeaderActions Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderActionsSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderInfo + +**ChatConversationHeaderInfo Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderInfoSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationSubtitle + +**ChatConversationSubtitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationSubtitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatConversationTitle + +**ChatConversationTitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationTitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatConversationUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatConversationUtilityClasses + +**useChatConversationUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatConversationUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatConversationClasses; +``` + +## Additional Types + +### chatConversationClasses + +```typescript +type chatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClasses + +```typescript +type ChatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClassKey + +```typescript +type ChatConversationClassKey = + | 'title' + | 'root' + | 'header' + | 'headerInfo' + | 'subtitle' + | 'headerActions'; +``` + +### ChatConversationHeaderActionsProps + +```typescript +type ChatConversationHeaderActionsProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderActionsSlotProps; +}; +``` + +### ChatConversationHeaderInfoProps + +```typescript +type ChatConversationHeaderInfoProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderInfoSlotProps; +}; +``` + +### ChatConversationHeaderProps + +```typescript +type ChatConversationHeaderProps = { + className?: string; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderSlotProps; +}; +``` + +### ChatConversationProps + +```typescript +type ChatConversationProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationRootSlotProps; +}; +``` + +### ChatConversationSubtitleProps + +```typescript +type ChatConversationSubtitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationSubtitleSlotProps; +}; +``` + +### ChatConversationTitleProps + +```typescript +type ChatConversationTitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationTitleSlotProps; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-conversation-header-info.ts b/docs/pages/x/api/chat/types.chat-conversation-header-info.ts new file mode 100644 index 0000000000000..ac12bcb041848 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-header-info.ts @@ -0,0 +1,4 @@ +import { ChatConversationHeaderInfo } from '@mui/x-chat/ChatConversation'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConversationHeaderInfo = createTypes(import.meta.url, ChatConversationHeaderInfo); diff --git a/docs/pages/x/api/chat/types.chat-conversation-header.md b/docs/pages/x/api/chat/types.chat-conversation-header.md new file mode 100644 index 0000000000000..d84e214fd66ab --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-header.md @@ -0,0 +1,235 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-conversation-header.md' + +## API Reference + +### ChatConversation + +**ChatConversation Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeader + +**ChatConversationHeader Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderSlotProps` | - | - | +| slots | `Partial` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderActions + +**ChatConversationHeaderActions Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderActionsSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderInfo + +**ChatConversationHeaderInfo Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderInfoSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationSubtitle + +**ChatConversationSubtitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationSubtitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatConversationTitle + +**ChatConversationTitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationTitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatConversationUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatConversationUtilityClasses + +**useChatConversationUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatConversationUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatConversationClasses; +``` + +## Additional Types + +### chatConversationClasses + +```typescript +type chatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClasses + +```typescript +type ChatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClassKey + +```typescript +type ChatConversationClassKey = + | 'title' + | 'root' + | 'header' + | 'headerInfo' + | 'subtitle' + | 'headerActions'; +``` + +### ChatConversationHeaderActionsProps + +```typescript +type ChatConversationHeaderActionsProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderActionsSlotProps; +}; +``` + +### ChatConversationHeaderInfoProps + +```typescript +type ChatConversationHeaderInfoProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderInfoSlotProps; +}; +``` + +### ChatConversationHeaderProps + +```typescript +type ChatConversationHeaderProps = { + className?: string; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderSlotProps; +}; +``` + +### ChatConversationProps + +```typescript +type ChatConversationProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationRootSlotProps; +}; +``` + +### ChatConversationSubtitleProps + +```typescript +type ChatConversationSubtitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationSubtitleSlotProps; +}; +``` + +### ChatConversationTitleProps + +```typescript +type ChatConversationTitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationTitleSlotProps; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-conversation-header.ts b/docs/pages/x/api/chat/types.chat-conversation-header.ts new file mode 100644 index 0000000000000..f3e53528162d3 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-header.ts @@ -0,0 +1,4 @@ +import { ChatConversationHeader } from '@mui/x-chat/ChatConversation'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConversationHeader = createTypes(import.meta.url, ChatConversationHeader); diff --git a/docs/pages/x/api/chat/types.chat-conversation-list.md b/docs/pages/x/api/chat/types.chat-conversation-list.md new file mode 100644 index 0000000000000..b5c6a474e0448 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-list.md @@ -0,0 +1,165 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-conversation-list.md' + +## API Reference + +### ChatConversationList + +**ChatConversationList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationListRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| variant | `ConversationListVariant` | `'default'` | The visual variant of the conversation list. `'default'` – shows avatar, title, preview, timestamp, and unread badge.`'compact'` – shows only a small unread indicator, the title, and an actions button. | +| className | `string` | - | - | + +### getChatConversationListUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatConversationListUtilityClasses + +**useChatConversationListUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatConversationListUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatConversationListClasses; +``` + +## Additional Types + +### chatConversationListClasses + +```typescript +type chatConversationListClasses = { + /** Styles applied to the conversation list root element. */ + root: string; + /** Styles applied to the scroller element. */ + scroller: string; + /** Styles applied to the list item element. */ + item: string; + /** Styles applied to the item avatar element. */ + itemAvatar: string; + /** Styles applied to the item content element. */ + itemContent: string; + /** Styles applied to the item title element. */ + itemTitle: string; + /** Styles applied to the item preview element. */ + itemPreview: string; + /** Styles applied to the item timestamp element. */ + itemTimestamp: string; + /** Styles applied to the item unread badge element. */ + itemUnreadBadge: string; + /** Styles applied to the item actions element. */ + itemActions: string; + /** Applied to a selected conversation item */ + itemSelected: string; + /** Applied to an unread conversation item */ + itemUnread: string; + /** Applied to a focused conversation item */ + itemFocused: string; + /** Applied when variant="compact" */ + compact: string; +}; +``` + +### ChatConversationListClasses + +```typescript +type ChatConversationListClasses = { + /** Styles applied to the conversation list root element. */ + root: string; + /** Styles applied to the scroller element. */ + scroller: string; + /** Styles applied to the list item element. */ + item: string; + /** Styles applied to the item avatar element. */ + itemAvatar: string; + /** Styles applied to the item content element. */ + itemContent: string; + /** Styles applied to the item title element. */ + itemTitle: string; + /** Styles applied to the item preview element. */ + itemPreview: string; + /** Styles applied to the item timestamp element. */ + itemTimestamp: string; + /** Styles applied to the item unread badge element. */ + itemUnreadBadge: string; + /** Styles applied to the item actions element. */ + itemActions: string; + /** Applied to a selected conversation item */ + itemSelected: string; + /** Applied to an unread conversation item */ + itemUnread: string; + /** Applied to a focused conversation item */ + itemFocused: string; + /** Applied when variant="compact" */ + compact: string; +}; +``` + +### ChatConversationListClassKey + +```typescript +type ChatConversationListClassKey = + | 'root' + | 'scroller' + | 'item' + | 'itemAvatar' + | 'itemContent' + | 'itemTitle' + | 'itemPreview' + | 'itemTimestamp' + | 'itemUnreadBadge' + | 'itemActions' + | 'itemSelected' + | 'itemUnread' + | 'itemFocused' + | 'compact'; +``` + +### ChatConversationListProps + +```typescript +type ChatConversationListProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + /** + * The visual variant of the conversation list. + * - `'default'` – shows avatar, title, preview, timestamp, and unread badge. + * - `'compact'` – shows only a small unread indicator, the title, and an actions button. + * @default 'default' + */ + variant?: ConversationListVariant; + slots?: Partial; + slotProps?: ConversationListRootSlotProps; +}; +``` + +## External Types + +### ConversationListVariant + +```typescript +type ConversationListVariant = 'default' | 'compact'; +``` diff --git a/docs/pages/x/api/chat/types.chat-conversation-list.ts b/docs/pages/x/api/chat/types.chat-conversation-list.ts new file mode 100644 index 0000000000000..36a580cfb17d9 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-list.ts @@ -0,0 +1,4 @@ +import { ChatConversationList } from '@mui/x-chat/ChatConversationList'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConversationList = createTypes(import.meta.url, ChatConversationList); diff --git a/docs/pages/x/api/chat/types.chat-conversation-subtitle.md b/docs/pages/x/api/chat/types.chat-conversation-subtitle.md new file mode 100644 index 0000000000000..699e2153706f7 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-subtitle.md @@ -0,0 +1,235 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-conversation-subtitle.md' + +## API Reference + +### ChatConversation + +**ChatConversation Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeader + +**ChatConversationHeader Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderSlotProps` | - | - | +| slots | `Partial` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderActions + +**ChatConversationHeaderActions Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderActionsSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderInfo + +**ChatConversationHeaderInfo Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderInfoSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationSubtitle + +**ChatConversationSubtitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationSubtitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatConversationTitle + +**ChatConversationTitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationTitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatConversationUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatConversationUtilityClasses + +**useChatConversationUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatConversationUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatConversationClasses; +``` + +## Additional Types + +### chatConversationClasses + +```typescript +type chatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClasses + +```typescript +type ChatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClassKey + +```typescript +type ChatConversationClassKey = + | 'title' + | 'root' + | 'header' + | 'headerInfo' + | 'subtitle' + | 'headerActions'; +``` + +### ChatConversationHeaderActionsProps + +```typescript +type ChatConversationHeaderActionsProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderActionsSlotProps; +}; +``` + +### ChatConversationHeaderInfoProps + +```typescript +type ChatConversationHeaderInfoProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderInfoSlotProps; +}; +``` + +### ChatConversationHeaderProps + +```typescript +type ChatConversationHeaderProps = { + className?: string; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderSlotProps; +}; +``` + +### ChatConversationProps + +```typescript +type ChatConversationProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationRootSlotProps; +}; +``` + +### ChatConversationSubtitleProps + +```typescript +type ChatConversationSubtitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationSubtitleSlotProps; +}; +``` + +### ChatConversationTitleProps + +```typescript +type ChatConversationTitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationTitleSlotProps; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-conversation-subtitle.ts b/docs/pages/x/api/chat/types.chat-conversation-subtitle.ts new file mode 100644 index 0000000000000..5c505d38315b7 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-subtitle.ts @@ -0,0 +1,4 @@ +import { ChatConversationSubtitle } from '@mui/x-chat/ChatConversation'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConversationSubtitle = createTypes(import.meta.url, ChatConversationSubtitle); diff --git a/docs/pages/x/api/chat/types.chat-conversation-title.md b/docs/pages/x/api/chat/types.chat-conversation-title.md new file mode 100644 index 0000000000000..24606e07a2fda --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-title.md @@ -0,0 +1,235 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-conversation-title.md' + +## API Reference + +### ChatConversation + +**ChatConversation Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeader + +**ChatConversationHeader Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderSlotProps` | - | - | +| slots | `Partial` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderActions + +**ChatConversationHeaderActions Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderActionsSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderInfo + +**ChatConversationHeaderInfo Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderInfoSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationSubtitle + +**ChatConversationSubtitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationSubtitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatConversationTitle + +**ChatConversationTitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationTitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatConversationUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatConversationUtilityClasses + +**useChatConversationUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatConversationUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatConversationClasses; +``` + +## Additional Types + +### chatConversationClasses + +```typescript +type chatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClasses + +```typescript +type ChatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClassKey + +```typescript +type ChatConversationClassKey = + | 'title' + | 'root' + | 'header' + | 'headerInfo' + | 'subtitle' + | 'headerActions'; +``` + +### ChatConversationHeaderActionsProps + +```typescript +type ChatConversationHeaderActionsProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderActionsSlotProps; +}; +``` + +### ChatConversationHeaderInfoProps + +```typescript +type ChatConversationHeaderInfoProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderInfoSlotProps; +}; +``` + +### ChatConversationHeaderProps + +```typescript +type ChatConversationHeaderProps = { + className?: string; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderSlotProps; +}; +``` + +### ChatConversationProps + +```typescript +type ChatConversationProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationRootSlotProps; +}; +``` + +### ChatConversationSubtitleProps + +```typescript +type ChatConversationSubtitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationSubtitleSlotProps; +}; +``` + +### ChatConversationTitleProps + +```typescript +type ChatConversationTitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationTitleSlotProps; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-conversation-title.ts b/docs/pages/x/api/chat/types.chat-conversation-title.ts new file mode 100644 index 0000000000000..d21dca9ce6546 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation-title.ts @@ -0,0 +1,4 @@ +import { ChatConversationTitle } from '@mui/x-chat/ChatConversation'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConversationTitle = createTypes(import.meta.url, ChatConversationTitle); diff --git a/docs/pages/x/api/chat/types.chat-conversation.md b/docs/pages/x/api/chat/types.chat-conversation.md new file mode 100644 index 0000000000000..ce80fb50ed837 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation.md @@ -0,0 +1,235 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-conversation.md' + +## API Reference + +### ChatConversation + +**ChatConversation Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeader + +**ChatConversationHeader Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderSlotProps` | - | - | +| slots | `Partial` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderActions + +**ChatConversationHeaderActions Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderActionsSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationHeaderInfo + +**ChatConversationHeaderInfo Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationHeaderInfoSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatConversationSubtitle + +**ChatConversationSubtitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationSubtitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatConversationTitle + +**ChatConversationTitle Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `ConversationTitleSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatConversationUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatConversationUtilityClasses + +**useChatConversationUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatConversationUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatConversationClasses; +``` + +## Additional Types + +### chatConversationClasses + +```typescript +type chatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClasses + +```typescript +type ChatConversationClasses = { + /** Styles applied to the conversation root element. */ + root: string; + /** Styles applied to the conversation header element. */ + header: string; + /** Styles applied to the conversation header info element. */ + headerInfo: string; + /** Styles applied to the conversation title element. */ + title: string; + /** Styles applied to the conversation subtitle element. */ + subtitle: string; + /** Styles applied to the conversation header actions element. */ + headerActions: string; +}; +``` + +### ChatConversationClassKey + +```typescript +type ChatConversationClassKey = + | 'title' + | 'root' + | 'header' + | 'headerInfo' + | 'subtitle' + | 'headerActions'; +``` + +### ChatConversationHeaderActionsProps + +```typescript +type ChatConversationHeaderActionsProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderActionsSlotProps; +}; +``` + +### ChatConversationHeaderInfoProps + +```typescript +type ChatConversationHeaderInfoProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderInfoSlotProps; +}; +``` + +### ChatConversationHeaderProps + +```typescript +type ChatConversationHeaderProps = { + className?: string; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationHeaderSlotProps; +}; +``` + +### ChatConversationProps + +```typescript +type ChatConversationProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + slots?: Partial; + slotProps?: ConversationRootSlotProps; +}; +``` + +### ChatConversationSubtitleProps + +```typescript +type ChatConversationSubtitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationSubtitleSlotProps; +}; +``` + +### ChatConversationTitleProps + +```typescript +type ChatConversationTitleProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: ConversationTitleSlotProps; +}; +``` diff --git a/docs/pages/x/api/chat/types.chat-conversation.ts b/docs/pages/x/api/chat/types.chat-conversation.ts new file mode 100644 index 0000000000000..b456d83a99475 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-conversation.ts @@ -0,0 +1,4 @@ +import { ChatConversation } from '@mui/x-chat/ChatConversation'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatConversation = createTypes(import.meta.url, ChatConversation); diff --git a/docs/pages/x/api/chat/types.chat-date-divider.md b/docs/pages/x/api/chat/types.chat-date-divider.md new file mode 100644 index 0000000000000..e12163caaa05b --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-date-divider.md @@ -0,0 +1,474 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-date-divider.md' + +## API Reference + +### ChatDateDivider + +**ChatDateDivider Props:** + +| Prop | Type | Default | Description | +| :---------- | :------------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| formatDate | `((date: Date) => React.ReactNode)` | - | - | +| index | `number` | - | - | +| items | `string[]` | - | - | +| messageId\* | `string` | - | - | +| slotProps | `MessageListDateDividerSlotProps` | - | - | +| slots | `Partial` | - | - | +| className | `string` | - | - | + +### ChatMessage + +**ChatMessage Props:** + +| Prop | Type | Default | Description | +| :---------- | :---------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| isGrouped | `boolean` | - | - | +| messageId\* | `string` | - | - | +| slotProps | `MessageRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatMessageActions + +**ChatMessageActions Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `MessageActionsSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### ChatMessageAuthorLabel + +**ChatMessageAuthorLabel Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `MessageAuthorLabelSlotProps` | - | - | +| slots | `Partial` | - | - | +| className | `string` | - | - | + +### ChatMessageAvatar + +**ChatMessageAvatar Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `MessageAvatarSlotProps` | - | - | +| slots | `Partial` | - | - | +| className | `string` | - | - | + +### ChatMessageContent + +**ChatMessageContent Props:** + +| Prop | Type | Default | Description | +| :------------------------- | :----------------------------------------------------------------------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------- | +| afterContent | `React.ReactNode` | - | Content rendered inside the bubble after the message parts. Useful for placing inline metadata (e.g. timestamp, status) inside the bubble. | +| classes | `Partial` | - | - | +| partProps | `MessageContentPartProps` | - | Props forwarded to the built-in unstyled part renderer components. Use this to pass `slots` and `slotProps` to individual part type renderers. | +| resolveBuiltInPartRenderer | `((part: ChatBuiltInMessagePart, localeText: ChatLocaleText) => ChatPartRenderer \| null)` | - | - | +| slotProps | `MessageContentSlotProps` | - | - | +| slots | `Partial` | - | - | +| className | `string` | - | - | + +### ChatMessageGroup + +**ChatMessageGroup Props:** + +| Prop | Type | Default | Description | +| :---------- | :---------------------------- | :------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| classes | `Partial` | - | - | +| groupKey | `GroupKeyFn` | `(message) => message.author?.id ?? message.role ?? ''` | A function that maps a message to a group key. Messages that resolve to the same key are visually grouped (shared avatar, author name, etc.). Use `createTimeWindowGroupKey(windowMs)` to replicate time-window-based grouping. | +| index | `number` | - | - | +| items | `string[]` | - | - | +| messageId\* | `string` | - | - | +| slotProps | `MessageGroupSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| children | `React.ReactNode` | - | - | +| className | `string` | - | - | + +### ChatMessageMeta + +**ChatMessageMeta Props:** + +| Prop | Type | Default | Description | +| :-------- | :---------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | +| slotProps | `MessageMetaSlotProps` | - | - | +| slots | `Partial` | - | - | +| sx | `SxProps` | - | - | +| className | `string` | - | - | + +### getChatMessageUtilityClass + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :------- | :------ | :---------- | +| slot | `string` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = string; +``` + +### useChatMessageUtilityClasses + +**useChatMessageUtilityClasses Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------------- | :------ | :---------- | +| classes | `Partial` | - | - | + +**useChatMessageUtilityClasses Return Value:** + +```tsx +type ReturnValue = ChatMessageClasses; +``` + +## Additional Types + +### ChatDateDividerProps + +```typescript +type ChatDateDividerProps = { + className?: string; + classes?: Partial; + messageId: string; + index?: number; + items?: string[]; + formatDate?: (date: Date) => React.ReactNode; + slots?: Partial; + slotProps?: MessageListDateDividerSlotProps; +}; +``` + +### ChatMessageActionsProps + +```typescript +type ChatMessageActionsProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: MessageActionsSlotProps; +}; +``` + +### ChatMessageAuthorLabelProps + +```typescript +type ChatMessageAuthorLabelProps = { + className?: string; + classes?: Partial; + slots?: Partial; + slotProps?: MessageAuthorLabelSlotProps; +}; +``` + +### ChatMessageAvatarProps + +```typescript +type ChatMessageAvatarProps = { + className?: string; + classes?: Partial; + slots?: Partial; + slotProps?: MessageAvatarSlotProps; +}; +``` + +### chatMessageClasses + +```typescript +type chatMessageClasses = { + /** Styles applied to the message root element. */ + root: string; + /** Styles applied to the message avatar element. */ + avatar: string; + /** Styles applied to the message author label element. */ + authorLabel: string; + /** Styles applied to the message content element. */ + content: string; + /** Styles applied to the message bubble element inside content. */ + bubble: string; + /** Styles applied to the message meta element. */ + meta: string; + /** Styles applied to the message actions element. */ + actions: string; + /** Styles applied to the message group element. */ + group: string; + /** Class applied to the group author name element. */ + groupAuthorName: string; + /** Class applied to the group timestamp element (compact variant only). */ + groupTimestamp: string; + /** Styles applied to the inline meta spacer element (default variant). */ + inlineMetaSpacer: string; + /** Styles applied to the inline meta container element (default variant). */ + inlineMeta: string; + /** Styles applied to the date divider element. */ + dateDivider: string; + /** Applied when the message role is 'user' */ + roleUser: string; + /** Applied when the message role is 'assistant' */ + roleAssistant: string; + /** Applied while the message is streaming */ + streaming: string; + /** Applied when the message has an error status */ + error: string; +}; +``` + +### ChatMessageClasses + +```typescript +type ChatMessageClasses = { + /** Styles applied to the message root element. */ + root: string; + /** Styles applied to the message avatar element. */ + avatar: string; + /** Styles applied to the message author label element. */ + authorLabel: string; + /** Styles applied to the message content element. */ + content: string; + /** Styles applied to the message bubble element inside content. */ + bubble: string; + /** Styles applied to the message meta element. */ + meta: string; + /** Styles applied to the message actions element. */ + actions: string; + /** Styles applied to the message group element. */ + group: string; + /** Class applied to the group author name element. */ + groupAuthorName: string; + /** Class applied to the group timestamp element (compact variant only). */ + groupTimestamp: string; + /** Styles applied to the inline meta spacer element (default variant). */ + inlineMetaSpacer: string; + /** Styles applied to the inline meta container element (default variant). */ + inlineMeta: string; + /** Styles applied to the date divider element. */ + dateDivider: string; + /** Applied when the message role is 'user' */ + roleUser: string; + /** Applied when the message role is 'assistant' */ + roleAssistant: string; + /** Applied while the message is streaming */ + streaming: string; + /** Applied when the message has an error status */ + error: string; +}; +``` + +### ChatMessageClassKey + +```typescript +type ChatMessageClassKey = + | 'content' + | 'root' + | 'avatar' + | 'authorLabel' + | 'bubble' + | 'meta' + | 'actions' + | 'group' + | 'groupAuthorName' + | 'groupTimestamp' + | 'inlineMetaSpacer' + | 'inlineMeta' + | 'dateDivider' + | 'roleUser' + | 'roleAssistant' + | 'streaming' + | 'error'; +``` + +### ChatMessageContentProps + +```typescript +type ChatMessageContentProps = { + className?: string; + classes?: Partial; + /** + * Props forwarded to the built-in unstyled part renderer components. + * Use this to pass `slots` and `slotProps` to individual part type renderers. + */ + partProps?: MessageContentPartProps; + /** + * @deprecated + * Use `partProps` instead. + * Callback to resolve a built-in part renderer for a given part type. + * @returns A renderer or null. + */ + resolveBuiltInPartRenderer?: ( + part: ChatBuiltInMessagePart, + localeText: ChatLocaleText, + ) => ChatPartRenderer | null; + /** + * Content rendered inside the bubble after the message parts. + * Useful for placing inline metadata (e.g. timestamp, status) inside the bubble. + */ + afterContent?: React.ReactNode; + slots?: Partial; + slotProps?: MessageContentSlotProps; +}; +``` + +### ChatMessageGroupProps + +```typescript +type ChatMessageGroupProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + children?: React.ReactNode; + messageId: string; + index?: number; + items?: string[]; + /** + * A function that maps a message to a group key. + * Messages that resolve to the same key are visually grouped (shared avatar, author name, etc.). + * Use `createTimeWindowGroupKey(windowMs)` to replicate time-window-based grouping. + * @default (message) => message.author?.id ?? message.role ?? '' + */ + groupKey?: GroupKeyFn; + slots?: Partial; + slotProps?: MessageGroupSlotProps; +}; +``` + +### ChatMessageMetaProps + +```typescript +type ChatMessageMetaProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + slots?: Partial; + slotProps?: MessageMetaSlotProps; +}; +``` + +### ChatMessageProps + +```typescript +type ChatMessageProps = { + className?: string; + sx?: SxProps; + classes?: Partial; + messageId: string; + isGrouped?: boolean; + slots?: Partial; + slotProps?: MessageRootSlotProps; +}; +``` + +## External Types + +### ChatPartRenderer + +```typescript +type ChatPartRenderer = (props: { + part: + | { type: 'text'; text: string; state?: 'streaming' | 'done' | undefined } + | { type: 'reasoning'; text: string; state?: 'streaming' | 'done' | undefined } + | { type: 'file'; mediaType: string; url: string; filename?: string | undefined } + | { type: 'source-url'; sourceId: string; url: string; title?: string | undefined } + | { + type: 'source-document'; + sourceId: string; + title?: string | undefined; + text?: string | undefined; + } + | { type: any; id?: string | undefined; data: unknown; transient?: boolean | undefined } + | { type: 'step-start' } + | { + type: 'tool'; + toolInvocation: { + toolCallId: string; + toolName: string; + state: + | 'input-streaming' + | 'input-available' + | 'approval-requested' + | 'approval-responded' + | 'output-available' + | 'output-error' + | 'output-denied'; + input?: unknown; + output?: unknown; + errorText?: string | undefined; + approval?: { approved: boolean; reason?: string | undefined } | undefined; + providerExecuted?: boolean | undefined; + title?: string | undefined; + callProviderMetadata?: Record | undefined; + preliminary?: boolean | undefined; + }; + } + | { + type: 'dynamic-tool'; + toolInvocation: { + toolCallId: string; + toolName: string; + state: + | 'input-streaming' + | 'input-available' + | 'approval-requested' + | 'approval-responded' + | 'output-available' + | 'output-error' + | 'output-denied'; + input?: unknown; + output?: unknown; + errorText?: string | undefined; + approval?: { approved: boolean; reason?: string | undefined } | undefined; + providerExecuted?: boolean | undefined; + title?: string | undefined; + callProviderMetadata?: Record | undefined; + preliminary?: boolean | undefined; + }; + }; + message: { + id: string; + conversationId?: string | undefined; + role: 'system' | 'user' | 'assistant'; + parts: unknown; + metadata?: {} | undefined; + createdAt?: string | undefined; + updatedAt?: string | undefined; + status?: + | 'pending' + | 'sending' + | 'streaming' + | 'sent' + | 'read' + | 'error' + | 'cancelled' + | undefined; + author?: + | { + id: string; + displayName?: string | undefined; + avatarUrl?: string | undefined; + isOnline?: boolean | undefined; + role?: 'system' | 'user' | 'assistant' | undefined; + metadata?: {} | undefined; + } + | undefined; + editedAt?: string | undefined; + }; + index: number; + onToolCall?: unknown | undefined; +}) => ReactNode; +``` diff --git a/docs/pages/x/api/chat/types.chat-date-divider.ts b/docs/pages/x/api/chat/types.chat-date-divider.ts new file mode 100644 index 0000000000000..80a41f9ebbd78 --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-date-divider.ts @@ -0,0 +1,4 @@ +import { ChatDateDivider } from '@mui/x-chat/ChatMessage'; +import { createTypes } from 'docsx/src/modules/api-docs/createTypes'; + +export const TypesChatDateDivider = createTypes(import.meta.url, ChatDateDivider); diff --git a/docs/pages/x/api/chat/types.chat-layout.md b/docs/pages/x/api/chat/types.chat-layout.md new file mode 100644 index 0000000000000..e1be07f5b39fb --- /dev/null +++ b/docs/pages/x/api/chat/types.chat-layout.md @@ -0,0 +1,4682 @@ +# Chat + +[//]: types.ts '<-- Autogenerated By (do not edit the following markdown directly), run: pnpm docs:validate pages/x/api/chat/types.chat-layout.md' + +## API Reference + +### ChatDensityProvider + +Provides the chat density to all descendant message components. +Controls vertical spacing without prop drilling. + +**ChatDensityProvider Props:** + +| Prop | Type | Default | Description | +| :--------- | :---------------- | :------ | :---------- | +| density\* | `ChatDensity` | - | - | +| children\* | `React.ReactNode` | - | - | + +### ChatLayout + +**ChatLayout Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------- | :------ | :---------- | +| slotProps | `ChatLayoutSlotProps` | - | - | +| slots | `Partial` | - | - | +| children | `React.ReactNode` | - | - | + +### ChatOnData + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------- | :------ | :---------- | +| part | `ChatDataMessagePart` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = void | Promise; +``` + +### ChatOnFinish + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :-------------------- | :------ | :---------- | +| payload | `ChatOnFinishPayload` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = void | Promise; +``` + +### ChatOnToolCall + +**Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------------------- | :------ | :---------- | +| payload | `ChatOnToolCallPayload` | - | - | + +**Return Value:** + +```tsx +type ReturnValue = void | Promise; +``` + +### ChatPartRenderer + +**ChatPartRenderer Props:** + +| Prop | Type | Default | Description | +| :--------- | :----------------------- | :------ | :---------- | +| index\* | `number` | - | - | +| message\* | `ChatMessage` | - | - | +| onToolCall | `ChatOnToolCall` | - | - | +| part\* | `ChatBuiltInMessagePart` | - | - | + +### ChatProvider + +**ChatProvider Props:** + +| Prop | Type | Default | Description | +| :-------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- | +| activeConversationId | `string` | - | - | +| adapter\* | `ChatAdapter` | - | - | +| composerValue | `string` | - | - | +| conversations | `ChatConversation[]` | - | - | +| currentUser | `ChatUser` | - | The local user sending messages. If omitted, derived from `members` by finding the entry with `role === 'user'`. | +| initialActiveConversationId | `string` | - | The initial active conversation ID when uncontrolled. Ignored after initialization and when `activeConversationId` is provided. | +| initialComposerValue | `string` | - | The initial composer value when uncontrolled. Ignored after initialization and when `composerValue` is provided. | +| initialConversations | `ChatConversation[]` | - | The initial conversations when uncontrolled. Ignored after initialization and when `conversations` is provided. | +| initialMessages | `ChatMessage[]` | - | The initial messages when uncontrolled. Ignored after initialization and when `messages` is provided. | +| members | `ChatUser[]` | - | All participants in the chat. The current (local) user is derived as the first member with `role === 'user'`, unless `currentUser` is provided explicitly. | +| messages | `ChatMessage[]` | - | - | +| onActiveConversationChange | `((conversationId?: string) => void)` | - | - | +| onComposerValueChange | `((value: string) => void)` | - | - | +| onConversationsChange | `((conversations: ChatConversation[]) => void)` | - | - | +| onData | `ChatOnData` | - | - | +| onError | `((error: ChatError) => void)` | - | - | +| onFinish | `ChatOnFinish` | - | - | +| onMessagesChange | `((messages: ChatMessage[]) => void)` | - | - | +| onToolCall | `ChatOnToolCall` | - | - | +| partRenderers | `Partial<{ text: ChatPartRenderer; reasoning: ChatPartRenderer; file: ChatPartRenderer; 'source-url': ChatPartRenderer; 'source-document': ChatPartRenderer; 'step-start': ChatPartRenderer; tool: ChatPartRenderer; 'dynamic-tool': ChatPartRenderer }>` | - | - | +| storeClass | `ChatStoreConstructor` | `ChatStore` | The store class to use for this provider. | +| streamFlushInterval | `number` | `16` | Flush interval in milliseconds for batching rapid streaming deltas before applying them to the store. | +| children | `React.ReactNode` | - | - | + +### ChatRoot + +**ChatRoot Props:** + +| Prop | Type | Default | Description | +| :-------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| activeConversationId | `string` | - | - | +| adapter\* | `ChatAdapter` | - | - | +| composerValue | `string` | - | - | +| conversations | `ChatConversation[]` | - | - | +| currentUser | `ChatUser` | - | The local user sending messages. If omitted, derived from `members` by finding the entry with `role === 'user'`. | +| density | `ChatDensity` | - | The vertical spacing density of chat messages. When provided, wraps descendant components with `ChatDensityProvider`. `'compact'` – Reduced vertical spacing between messages.`'standard'` – Default spacing.`'comfortable'` – Increased vertical spacing between messages. | +| initialActiveConversationId | `string` | - | The initial active conversation ID when uncontrolled. Ignored after initialization and when `activeConversationId` is provided. | +| initialComposerValue | `string` | - | The initial composer value when uncontrolled. Ignored after initialization and when `composerValue` is provided. | +| initialConversations | `ChatConversation[]` | - | The initial conversations when uncontrolled. Ignored after initialization and when `conversations` is provided. | +| initialMessages | `ChatMessage[]` | - | The initial messages when uncontrolled. Ignored after initialization and when `messages` is provided. | +| localeText | `Partial` | - | - | +| members | `ChatUser[]` | - | All participants in the chat. The current (local) user is derived as the first member with `role === 'user'`, unless `currentUser` is provided explicitly. | +| messages | `ChatMessage[]` | - | - | +| onActiveConversationChange | `((conversationId?: string) => void)` | - | - | +| onComposerValueChange | `((value: string) => void)` | - | - | +| onConversationsChange | `((conversations: ChatConversation[]) => void)` | - | - | +| onData | `ChatOnData` | - | - | +| onError | `((error: ChatError) => void)` | - | - | +| onFinish | `ChatOnFinish` | - | - | +| onMessagesChange | `((messages: ChatMessage[]) => void)` | - | - | +| onToolCall | `ChatOnToolCall` | - | - | +| partRenderers | `Partial<{ text: ChatPartRenderer; reasoning: ChatPartRenderer; file: ChatPartRenderer; 'source-url': ChatPartRenderer; 'source-document': ChatPartRenderer; 'step-start': ChatPartRenderer; tool: ChatPartRenderer; 'dynamic-tool': ChatPartRenderer }>` | - | - | +| slotProps | `ChatRootSlotProps` | - | - | +| slots | `Partial` | - | - | +| storeClass | `ChatStoreConstructor` | `ChatStore` | The store class to use for this provider. | +| streamFlushInterval | `number` | `16` | Flush interval in milliseconds for batching rapid streaming deltas before applying them to the store. | +| variant | `ChatVariant` | - | The visual layout variant of the chat. When provided, wraps descendant components with `ChatVariantProvider` so message and conversation components can respond to the variant. `'default'` – Standard layout with avatars, individual timestamps, and full spacing.`'compact'` – Messenger-style layout: no avatars, author + timestamp in group header, tighter spacing. | +| children | `React.ReactNode` | - | - | + +### ChatStreamError + +A typed error thrown by the stream processor when a handled stream failure occurs. +Carries the `ChatError` that was already set in the store via `failStream()`. +Callers can distinguish stream failures from unexpected bugs via `instanceof ChatStreamError`. + +**Static Methods:** + +```typescript +function isError(error: unknown): boolean; +``` + +Indicates whether the argument provided is a built-in Error instance or not. + +```typescript +function captureStackTrace(targetObject: {}, constructorOpt?: Function | undefined): void; +``` + +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. + +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` + +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. + +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. + +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); +``` + +```typescript +function prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; +``` + +**Constructor Parameters:** + +| Parameter | Type | Default | Description | +| :-------- | :---------- | :------ | :---------- | +| chatError | `ChatError` | - | - | + +**Properties:** + +| Property | Type | Modifiers | Description | +| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| chatError | `{ code: ChatErrorCode; message: string; source: ChatErrorSource; recoverable: boolean; retryable?: boolean; details?: Record }` | readonly | - | +| name | `string` | - | - | +| message | `string` | - | - | +| stack? | `string` | - | - | +| cause? | `unknown` | - | - | +| stackTraceLimit | `number` | static | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | + +### ChatVariantProvider + +Provides the chat variant to all descendant message components. +Controls how messages are laid out without prop drilling. + +**ChatVariantProvider Props:** + +| Prop | Type | Default | Description | +| :--------- | :---------------- | :------ | :---------- | +| variant\* | `ChatVariant` | - | - | +| children\* | `React.ReactNode` | - | - | + +### ComposerAttachButton + +**ComposerAttachButton Props:** + +| Prop | Type | Default | Description | +| :-------- | :----------------------------------- | :------ | :---------- | +| slotProps | `ComposerAttachButtonSlotProps` | - | - | +| slots | `Partial` | - | - | + +### ComposerAttachmentList + +**ComposerAttachmentList Props:** + +| Prop | Type | Default | Description | +| :-------- | :------------------------------------- | :------ | :---------- | +| slotProps | `ComposerAttachmentListSlotProps` | - | - | +| slots | `Partial` | - | - | + +### ComposerHelperText + +**ComposerHelperText Props:** + +| Prop | Type | Default | Description | +| :-------- | :--------------------------------- | :------ | :---------- | +| slotProps | `ComposerHelperTextSlotProps` | - | - | +| slots | `Partial` | - | - | + +### ComposerLabel + +A `
` element. + +```typescript +type MessageActionsMenuGroupLabelProps = MenuGroupLabelProps; +``` + +### MessageActionsMenuGroupProps + +Groups a set of related menu items together. +Wraps Base UI `Menu.Group`. Renders a `
` element. + +```typescript +type MessageActionsMenuGroupProps = MenuGroupProps; +``` + +### MessageActionsMenuItemProps + +An individual action item inside the menu. Wraps Base UI `Menu.Item`. +Renders a `
` with `role="menuitem"`. + +Receives `data-highlighted` when focused via keyboard or pointer. + +```typescript +type MessageActionsMenuItemProps = MenuItemProps; +``` + +### MessageActionsMenuPopupProps + +The container for menu items. Wraps Base UI `Menu.Popup`. +Renders a `
` with `role="menu"`. + +```typescript +type MessageActionsMenuPopupProps = MenuPopupProps; +``` + +### MessageActionsMenuPositionerProps + +Positions the menu popup relative to the trigger. +Wraps Base UI `Menu.Positioner`. Renders a `
` element. + +Accepts all Base UI anchor-positioning props (`side`, `align`, +`sideOffset`, `alignOffset`, `collisionBoundary`, etc.). + +```typescript +type MessageActionsMenuPositionerProps = MenuPositionerProps; +``` + +### MessageActionsMenuRootProps + +The root of a message action menu. Wraps Base UI `Menu.Root`. +Does not render an HTML element itself. + +Usage: + +```tsx + + + + + Copy + Delete + + + +``` + +```typescript +type MessageActionsMenuRootProps = {}; +``` + +### MessageActionsMenuTriggerProps + +A button that opens the message action menu. Wraps Base UI `Menu.Trigger`. +Renders a `