From 14c7b09e7379d06f4b32c252b558a3891b66846e Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Wed, 5 Feb 2025 17:19:20 +0100 Subject: [PATCH 1/6] [charts] Add `color` prop to Sparkline. Deprecated `colors`. Update `colors` defaults. --- .../src/SparkLineChart/SparkLineChart.tsx | 27 +++++++++++++++++-- .../src/colorPalettes/colorPalettes.ts | 2 ++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx b/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx index fc5b4d30d6658..b318f8de278ff 100644 --- a/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx +++ b/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import { MakeOptional } from '@mui/x-internals/types'; +import { ChartsColor, ChartsColorPalette } from '../colorPalettes'; import { BarPlot } from '../BarChart'; import { LinePlot, AreaPlot, LineHighlightPlot } from '../LineChart'; import { ChartContainer, ChartContainerProps } from '../ChartContainer'; @@ -106,6 +107,19 @@ export interface SparkLineChartProps * @default {} */ slotProps?: SparkLineChartSlotProps; + + /** + * Color palette used to colorize multiple series. + * @default rainbowSurgePalette + * @deprecated use {@link color} prop instead + */ + colors?: ChartContainerProps['colors']; + + /** + * Color used to colorize the sparkline. + * @default rainbowSurgePalette + */ + color?: ChartsColor; } const SPARKLINE_DEFAULT_MARGIN = { @@ -134,7 +148,8 @@ const SparkLineChart = React.forwardRef(function SparkLineChart( width, height, margin = SPARKLINE_DEFAULT_MARGIN, - colors, + color, + colors: deprecatedColors, sx, showTooltip, showHighlight, @@ -160,6 +175,14 @@ const SparkLineChart = React.forwardRef(function SparkLineChart( const Tooltip = props.slots?.tooltip ?? ChartsTooltip; + const colors: ChartsColorPalette | undefined = React.useMemo(() => { + if (color == null) { + return undefined; + } + + return typeof color === 'function' ? (mode: 'light' | 'dark') => [color(mode)] : [color]; + }, [color]); + return ( string[]; export type ChartsColorPalette = string[] | ChartsColorPaletteCallback; +export type ChartsColorCallback = (mode: 'light' | 'dark') => string; +export type ChartsColor = string | ChartsColorCallback; export const rainbowSurgePaletteLight = [ '#4254FB', From 39e159538cbe8ea497c560ca57cc4909d57d2e45 Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Wed, 5 Feb 2025 17:30:04 +0100 Subject: [PATCH 2/6] Add docs --- .../charts/sparkline/ColorCustomization.js | 18 +++++++++++++++ .../charts/sparkline/ColorCustomization.tsx | 18 +++++++++++++++ .../sparkline/ColorCustomization.tsx.preview | 1 + .../sparkline/ColorCustomizationMode.js | 22 +++++++++++++++++++ .../sparkline/ColorCustomizationMode.tsx | 22 +++++++++++++++++++ .../ColorCustomizationMode.tsx.preview | 5 +++++ docs/data/charts/sparkline/sparkline.md | 12 ++++++++++ 7 files changed, 98 insertions(+) create mode 100644 docs/data/charts/sparkline/ColorCustomization.js create mode 100644 docs/data/charts/sparkline/ColorCustomization.tsx create mode 100644 docs/data/charts/sparkline/ColorCustomization.tsx.preview create mode 100644 docs/data/charts/sparkline/ColorCustomizationMode.js create mode 100644 docs/data/charts/sparkline/ColorCustomizationMode.tsx create mode 100644 docs/data/charts/sparkline/ColorCustomizationMode.tsx.preview diff --git a/docs/data/charts/sparkline/ColorCustomization.js b/docs/data/charts/sparkline/ColorCustomization.js new file mode 100644 index 0000000000000..418f0da69581b --- /dev/null +++ b/docs/data/charts/sparkline/ColorCustomization.js @@ -0,0 +1,18 @@ +import * as React from 'react'; +import Stack from '@mui/material/Stack'; +import { SparkLineChart } from '@mui/x-charts/SparkLineChart'; + +const settings = { + height: 100, + yAxis: { min: 0, max: 100 }, +}; + +const values = [0, 2, 3, 4, 6, 8, 7, 9, 15, 6, 8, 7, 12]; + +export default function ColorCustomization() { + return ( + + + + ); +} diff --git a/docs/data/charts/sparkline/ColorCustomization.tsx b/docs/data/charts/sparkline/ColorCustomization.tsx new file mode 100644 index 0000000000000..97f9876449d97 --- /dev/null +++ b/docs/data/charts/sparkline/ColorCustomization.tsx @@ -0,0 +1,18 @@ +import * as React from 'react'; +import Stack from '@mui/material/Stack'; +import { SparkLineChart } from '@mui/x-charts/SparkLineChart'; + +const settings = { + height: 100, + yAxis: { min: 0, max: 100 }, +} as const; + +const values = [0, 2, 3, 4, 6, 8, 7, 9, 15, 6, 8, 7, 12]; + +export default function ColorCustomization() { + return ( + + + + ); +} diff --git a/docs/data/charts/sparkline/ColorCustomization.tsx.preview b/docs/data/charts/sparkline/ColorCustomization.tsx.preview new file mode 100644 index 0000000000000..29e0fd333e956 --- /dev/null +++ b/docs/data/charts/sparkline/ColorCustomization.tsx.preview @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/data/charts/sparkline/ColorCustomizationMode.js b/docs/data/charts/sparkline/ColorCustomizationMode.js new file mode 100644 index 0000000000000..671cb764c74e8 --- /dev/null +++ b/docs/data/charts/sparkline/ColorCustomizationMode.js @@ -0,0 +1,22 @@ +import * as React from 'react'; +import Stack from '@mui/material/Stack'; +import { SparkLineChart } from '@mui/x-charts/SparkLineChart'; + +const settings = { + height: 100, + yAxis: { min: 0, max: 100 }, +}; + +const values = [0, 2, 3, 4, 6, 8, 7, 9, 15, 6, 8, 7, 12]; + +export default function ColorCustomizationMode() { + return ( + + (mode === 'light' ? 'black' : 'white')} + {...settings} + /> + + ); +} diff --git a/docs/data/charts/sparkline/ColorCustomizationMode.tsx b/docs/data/charts/sparkline/ColorCustomizationMode.tsx new file mode 100644 index 0000000000000..841d1ad3f66af --- /dev/null +++ b/docs/data/charts/sparkline/ColorCustomizationMode.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import Stack from '@mui/material/Stack'; +import { SparkLineChart } from '@mui/x-charts/SparkLineChart'; + +const settings = { + height: 100, + yAxis: { min: 0, max: 100 }, +} as const; + +const values = [0, 2, 3, 4, 6, 8, 7, 9, 15, 6, 8, 7, 12]; + +export default function ColorCustomizationMode() { + return ( + + (mode === 'light' ? 'black' : 'white')} + {...settings} + /> + + ); +} diff --git a/docs/data/charts/sparkline/ColorCustomizationMode.tsx.preview b/docs/data/charts/sparkline/ColorCustomizationMode.tsx.preview new file mode 100644 index 0000000000000..8c193007e8bbf --- /dev/null +++ b/docs/data/charts/sparkline/ColorCustomizationMode.tsx.preview @@ -0,0 +1,5 @@ + (mode === 'light' ? 'black' : 'white')} + {...settings} +/> \ No newline at end of file diff --git a/docs/data/charts/sparkline/sparkline.md b/docs/data/charts/sparkline/sparkline.md index aa87a158cd487..2df5e19f5d1e3 100644 --- a/docs/data/charts/sparkline/sparkline.md +++ b/docs/data/charts/sparkline/sparkline.md @@ -66,3 +66,15 @@ The demo below shows different ways to set the y-axis range. They always display the same data, going from -15 to 92, but with different `domainLimit` settings. {{"demo": "CustomDomainYAxis.js"}} + +## Color Customization + +You can customize the color of the sparkline by providing a color to the `color` prop. + +{{"demo": "ColorCustomization.js"}} + +The `color` prop also accepts a function that will be called with the mode (light or dark), so you can adapt the color to user preferences. + +The following example will show a white line if this page is in dark mode, or a black one if it is in light mode. + +{{"demo": "ColorCustomizationMode.js"}} From 167fbfcfb5cb82f2aea87d616ea4dee8e4a16ec4 Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Thu, 6 Feb 2025 08:43:48 +0100 Subject: [PATCH 3/6] Revert default color; move to different PR. --- .../corePlugins/useChartSeries/useChartSeries.types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts b/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts index 05960bab80a2b..3ba2b68e4e5b8 100644 --- a/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts +++ b/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts @@ -17,7 +17,7 @@ export interface UseChartSeriesParameters[]; /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors?: ChartsColorPalette; theme?: 'light' | 'dark'; @@ -33,7 +33,7 @@ export type UseChartSeriesDefaultizedParameters[]; /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: ChartsColorPalette; theme: 'light' | 'dark'; From 3dd0253105c7f1c35d362cbef4a4c62f99f6c359 Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Thu, 6 Feb 2025 08:56:00 +0100 Subject: [PATCH 4/6] Fix vale lint --- docs/data/charts/sparkline/sparkline.md | 4 ++-- docs/pages/x/api/charts/bar-chart-pro.json | 2 +- docs/pages/x/api/charts/bar-chart.json | 2 +- docs/pages/x/api/charts/chart-container.json | 2 +- docs/pages/x/api/charts/chart-data-provider-pro.json | 2 +- docs/pages/x/api/charts/chart-data-provider.json | 2 +- docs/pages/x/api/charts/heatmap.json | 2 +- docs/pages/x/api/charts/line-chart-pro.json | 2 +- docs/pages/x/api/charts/line-chart.json | 2 +- docs/pages/x/api/charts/pie-chart.json | 2 +- docs/pages/x/api/charts/scatter-chart-pro.json | 2 +- docs/pages/x/api/charts/scatter-chart.json | 2 +- docs/pages/x/api/charts/spark-line-chart.json | 8 +++++++- .../charts/spark-line-chart/spark-line-chart.json | 1 + packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx | 2 +- .../src/ChartDataProviderPro/ChartDataProviderPro.tsx | 2 +- packages/x-charts-pro/src/Heatmap/Heatmap.tsx | 2 +- packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx | 2 +- .../x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx | 2 +- packages/x-charts/src/BarChart/BarChart.tsx | 2 +- packages/x-charts/src/ChartContainer/ChartContainer.tsx | 2 +- .../x-charts/src/ChartDataProvider/ChartDataProvider.tsx | 2 +- packages/x-charts/src/LineChart/LineChart.tsx | 2 +- packages/x-charts/src/PieChart/PieChart.tsx | 2 +- packages/x-charts/src/ScatterChart/ScatterChart.tsx | 2 +- packages/x-charts/src/SparkLineChart/SparkLineChart.tsx | 6 ++++++ scripts/x-charts-pro.exports.json | 2 ++ scripts/x-charts.exports.json | 2 ++ 28 files changed, 42 insertions(+), 25 deletions(-) diff --git a/docs/data/charts/sparkline/sparkline.md b/docs/data/charts/sparkline/sparkline.md index 2df5e19f5d1e3..0455dc1250a4a 100644 --- a/docs/data/charts/sparkline/sparkline.md +++ b/docs/data/charts/sparkline/sparkline.md @@ -73,8 +73,8 @@ You can customize the color of the sparkline by providing a color to the `color` {{"demo": "ColorCustomization.js"}} -The `color` prop also accepts a function that will be called with the mode (light or dark), so you can adapt the color to user preferences. +The `color` prop also accepts a function that is called with the mode (`'light'` or `'dark'`), so you can adapt the color to user preferences. -The following example will show a white line if this page is in dark mode, or a black one if it is in light mode. +The following example shows a white line if this page is in dark mode, or a black one if it is in light mode. {{"demo": "ColorCustomizationMode.js"}} diff --git a/docs/pages/x/api/charts/bar-chart-pro.json b/docs/pages/x/api/charts/bar-chart-pro.json index f5b7f52de5034..e9416c23a399b 100644 --- a/docs/pages/x/api/charts/bar-chart-pro.json +++ b/docs/pages/x/api/charts/bar-chart-pro.json @@ -22,7 +22,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/bar-chart.json b/docs/pages/x/api/charts/bar-chart.json index 5f87e7c0fccc7..c46279678e7be 100644 --- a/docs/pages/x/api/charts/bar-chart.json +++ b/docs/pages/x/api/charts/bar-chart.json @@ -22,7 +22,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/chart-container.json b/docs/pages/x/api/charts/chart-container.json index 007425cb86b80..5eeba095e6acd 100644 --- a/docs/pages/x/api/charts/chart-container.json +++ b/docs/pages/x/api/charts/chart-container.json @@ -2,7 +2,7 @@ "props": { "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/chart-data-provider-pro.json b/docs/pages/x/api/charts/chart-data-provider-pro.json index 3553c23034f75..353dabda0016d 100644 --- a/docs/pages/x/api/charts/chart-data-provider-pro.json +++ b/docs/pages/x/api/charts/chart-data-provider-pro.json @@ -2,7 +2,7 @@ "props": { "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/chart-data-provider.json b/docs/pages/x/api/charts/chart-data-provider.json index 5e5fa438de519..c7afc0b433604 100644 --- a/docs/pages/x/api/charts/chart-data-provider.json +++ b/docs/pages/x/api/charts/chart-data-provider.json @@ -1,6 +1,6 @@ { "props": { - "colors": { "type": { "name": "any" }, "default": "rainbowSurgePalette" }, + "colors": { "type": { "name": "any" }, "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "any" } }, "height": { "type": { "name": "any" } }, "id": { "type": { "name": "any" } }, diff --git a/docs/pages/x/api/charts/heatmap.json b/docs/pages/x/api/charts/heatmap.json index 370e2aa36817e..2145a8d6bc870 100644 --- a/docs/pages/x/api/charts/heatmap.json +++ b/docs/pages/x/api/charts/heatmap.json @@ -24,7 +24,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/line-chart-pro.json b/docs/pages/x/api/charts/line-chart-pro.json index 8e8492e5285fc..0e65f0efc1ac1 100644 --- a/docs/pages/x/api/charts/line-chart-pro.json +++ b/docs/pages/x/api/charts/line-chart-pro.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/line-chart.json b/docs/pages/x/api/charts/line-chart.json index f01718cbb0702..554ae19bd1767 100644 --- a/docs/pages/x/api/charts/line-chart.json +++ b/docs/pages/x/api/charts/line-chart.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/pie-chart.json b/docs/pages/x/api/charts/pie-chart.json index bf48f90e23d2b..469ab5bd89586 100644 --- a/docs/pages/x/api/charts/pie-chart.json +++ b/docs/pages/x/api/charts/pie-chart.json @@ -6,7 +6,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "height": { "type": { "name": "number" } }, diff --git a/docs/pages/x/api/charts/scatter-chart-pro.json b/docs/pages/x/api/charts/scatter-chart-pro.json index 6a892c4892a1b..c9ad94f1a89bb 100644 --- a/docs/pages/x/api/charts/scatter-chart-pro.json +++ b/docs/pages/x/api/charts/scatter-chart-pro.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/scatter-chart.json b/docs/pages/x/api/charts/scatter-chart.json index 01d61648e737f..79803709e9749 100644 --- a/docs/pages/x/api/charts/scatter-chart.json +++ b/docs/pages/x/api/charts/scatter-chart.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "blueberryTwilightPalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/spark-line-chart.json b/docs/pages/x/api/charts/spark-line-chart.json index fb4738c3dcb1e..f02c9c985dd9a 100644 --- a/docs/pages/x/api/charts/spark-line-chart.json +++ b/docs/pages/x/api/charts/spark-line-chart.json @@ -5,9 +5,15 @@ "required": true }, "area": { "type": { "name": "bool" }, "default": "false" }, + "color": { + "type": { "name": "union", "description": "func
| string" }, + "default": "rainbowSurgePalette" + }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "rainbowSurgePalette" + "default": "rainbowSurgePalette", + "deprecated": true, + "deprecationInfo": "use {@link color} prop instead" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/translations/api-docs/charts/spark-line-chart/spark-line-chart.json b/docs/translations/api-docs/charts/spark-line-chart/spark-line-chart.json index 1414108091530..f3975a490a2a8 100644 --- a/docs/translations/api-docs/charts/spark-line-chart/spark-line-chart.json +++ b/docs/translations/api-docs/charts/spark-line-chart/spark-line-chart.json @@ -4,6 +4,7 @@ "area": { "description": "Set to true to fill spark line area. Has no effect if plotType='bar'." }, + "color": { "description": "Color used to colorize the sparkline." }, "colors": { "description": "Color palette used to colorize multiple series." }, "data": { "description": "Data to plot." }, "dataset": { diff --git a/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx b/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx index ca97302564544..6edde91a82402 100644 --- a/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx +++ b/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx @@ -168,7 +168,7 @@ BarChartPro.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx b/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx index 1112d71adf234..89cf1af2261dc 100644 --- a/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx +++ b/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx @@ -82,7 +82,7 @@ ChartDataProviderPro.propTypes = { children: PropTypes.node, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/Heatmap/Heatmap.tsx b/packages/x-charts-pro/src/Heatmap/Heatmap.tsx index 6997842e1f505..f8757a5a99206 100644 --- a/packages/x-charts-pro/src/Heatmap/Heatmap.tsx +++ b/packages/x-charts-pro/src/Heatmap/Heatmap.tsx @@ -220,7 +220,7 @@ Heatmap.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx b/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx index 758af80c177dc..e1747a00fbce8 100644 --- a/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx +++ b/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx @@ -224,7 +224,7 @@ LineChartPro.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx b/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx index 695c301719114..07010b555d822 100644 --- a/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx +++ b/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx @@ -106,7 +106,7 @@ ScatterChartPro.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/BarChart/BarChart.tsx b/packages/x-charts/src/BarChart/BarChart.tsx index b2cdac00eed16..afa34793e5273 100644 --- a/packages/x-charts/src/BarChart/BarChart.tsx +++ b/packages/x-charts/src/BarChart/BarChart.tsx @@ -179,7 +179,7 @@ BarChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/ChartContainer/ChartContainer.tsx b/packages/x-charts/src/ChartContainer/ChartContainer.tsx index 452f205c4f93f..b569755661293 100644 --- a/packages/x-charts/src/ChartContainer/ChartContainer.tsx +++ b/packages/x-charts/src/ChartContainer/ChartContainer.tsx @@ -69,7 +69,7 @@ ChartContainer.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx b/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx index afaff3a73327b..300d7c9dcfee1 100644 --- a/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx +++ b/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx @@ -68,7 +68,7 @@ ChartDataProvider.propTypes = { children: PropTypes.node, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.any, /** diff --git a/packages/x-charts/src/LineChart/LineChart.tsx b/packages/x-charts/src/LineChart/LineChart.tsx index c16f16a3d0192..2bd625481d7bc 100644 --- a/packages/x-charts/src/LineChart/LineChart.tsx +++ b/packages/x-charts/src/LineChart/LineChart.tsx @@ -200,7 +200,7 @@ LineChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/PieChart/PieChart.tsx b/packages/x-charts/src/PieChart/PieChart.tsx index 3f33cd0635340..f987e531af9cd 100644 --- a/packages/x-charts/src/PieChart/PieChart.tsx +++ b/packages/x-charts/src/PieChart/PieChart.tsx @@ -170,7 +170,7 @@ PieChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/ScatterChart/ScatterChart.tsx b/packages/x-charts/src/ScatterChart/ScatterChart.tsx index 9a984c2045f2a..f5948c70bf36b 100644 --- a/packages/x-charts/src/ScatterChart/ScatterChart.tsx +++ b/packages/x-charts/src/ScatterChart/ScatterChart.tsx @@ -177,7 +177,7 @@ ScatterChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default rainbowSurgePalette + * @default blueberryTwilightPalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx b/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx index b318f8de278ff..c25e4f7158d40 100644 --- a/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx +++ b/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx @@ -260,9 +260,15 @@ SparkLineChart.propTypes = { }), children: PropTypes.node, className: PropTypes.string, + /** + * Color used to colorize the sparkline. + * @default rainbowSurgePalette + */ + color: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), /** * Color palette used to colorize multiple series. * @default rainbowSurgePalette + * @deprecated use {@link color} prop instead */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/scripts/x-charts-pro.exports.json b/scripts/x-charts-pro.exports.json index a4b79e39148a9..cfc7ec6590d97 100644 --- a/scripts/x-charts-pro.exports.json +++ b/scripts/x-charts-pro.exports.json @@ -76,6 +76,8 @@ { "name": "ChartsAxisTooltipContentProps", "kind": "Interface" }, { "name": "ChartsClipPath", "kind": "Function" }, { "name": "ChartsClipPathProps", "kind": "TypeAlias" }, + { "name": "ChartsColor", "kind": "TypeAlias" }, + { "name": "ChartsColorCallback", "kind": "TypeAlias" }, { "name": "ChartsColorPalette", "kind": "TypeAlias" }, { "name": "ChartsColorPaletteCallback", "kind": "TypeAlias" }, { "name": "ChartsGrid", "kind": "Function" }, diff --git a/scripts/x-charts.exports.json b/scripts/x-charts.exports.json index 458225330811f..098f1810b895d 100644 --- a/scripts/x-charts.exports.json +++ b/scripts/x-charts.exports.json @@ -72,6 +72,8 @@ { "name": "ChartsAxisTooltipContentProps", "kind": "Interface" }, { "name": "ChartsClipPath", "kind": "Function" }, { "name": "ChartsClipPathProps", "kind": "TypeAlias" }, + { "name": "ChartsColor", "kind": "TypeAlias" }, + { "name": "ChartsColorCallback", "kind": "TypeAlias" }, { "name": "ChartsColorPalette", "kind": "TypeAlias" }, { "name": "ChartsColorPaletteCallback", "kind": "TypeAlias" }, { "name": "ChartsGrid", "kind": "Function" }, From 5d122ad4e7b8aa4b22dd6725861a229814e705c7 Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Thu, 6 Feb 2025 09:04:24 +0100 Subject: [PATCH 5/6] Small doc fixes --- docs/pages/x/api/charts/spark-line-chart.json | 4 ++-- packages/x-charts/src/SparkLineChart/SparkLineChart.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/pages/x/api/charts/spark-line-chart.json b/docs/pages/x/api/charts/spark-line-chart.json index f02c9c985dd9a..907c88cf58d3b 100644 --- a/docs/pages/x/api/charts/spark-line-chart.json +++ b/docs/pages/x/api/charts/spark-line-chart.json @@ -7,13 +7,13 @@ "area": { "type": { "name": "bool" }, "default": "false" }, "color": { "type": { "name": "union", "description": "func
| string" }, - "default": "rainbowSurgePalette" + "default": "rainbowSurgePalette[0]" }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, "default": "rainbowSurgePalette", "deprecated": true, - "deprecationInfo": "use {@link color} prop instead" + "deprecationInfo": "use the color prop instead" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx b/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx index c25e4f7158d40..53be4d040ceef 100644 --- a/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx +++ b/packages/x-charts/src/SparkLineChart/SparkLineChart.tsx @@ -111,13 +111,13 @@ export interface SparkLineChartProps /** * Color palette used to colorize multiple series. * @default rainbowSurgePalette - * @deprecated use {@link color} prop instead + * @deprecated use the `color` prop instead */ colors?: ChartContainerProps['colors']; /** * Color used to colorize the sparkline. - * @default rainbowSurgePalette + * @default rainbowSurgePalette[0] */ color?: ChartsColor; } @@ -262,13 +262,13 @@ SparkLineChart.propTypes = { className: PropTypes.string, /** * Color used to colorize the sparkline. - * @default rainbowSurgePalette + * @default rainbowSurgePalette[0] */ color: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), /** * Color palette used to colorize multiple series. * @default rainbowSurgePalette - * @deprecated use {@link color} prop instead + * @deprecated use the `color` prop instead */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** From c855839fa4677d137a25fa2034fa123f08473bba Mon Sep 17 00:00:00 2001 From: Bernardo Belchior Date: Thu, 6 Feb 2025 11:24:40 +0100 Subject: [PATCH 6/6] Update default color from master. --- docs/pages/x/api/charts/bar-chart-pro.json | 2 +- docs/pages/x/api/charts/bar-chart.json | 2 +- docs/pages/x/api/charts/chart-container.json | 2 +- docs/pages/x/api/charts/chart-data-provider-pro.json | 2 +- docs/pages/x/api/charts/chart-data-provider.json | 2 +- docs/pages/x/api/charts/heatmap.json | 2 +- docs/pages/x/api/charts/line-chart-pro.json | 2 +- docs/pages/x/api/charts/line-chart.json | 2 +- docs/pages/x/api/charts/pie-chart.json | 2 +- docs/pages/x/api/charts/scatter-chart-pro.json | 2 +- docs/pages/x/api/charts/scatter-chart.json | 2 +- packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx | 2 +- .../src/ChartDataProviderPro/ChartDataProviderPro.tsx | 2 +- packages/x-charts-pro/src/Heatmap/Heatmap.tsx | 2 +- packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx | 2 +- packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx | 2 +- packages/x-charts/src/BarChart/BarChart.tsx | 2 +- packages/x-charts/src/ChartContainer/ChartContainer.tsx | 2 +- packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx | 2 +- packages/x-charts/src/LineChart/LineChart.tsx | 2 +- packages/x-charts/src/PieChart/PieChart.tsx | 2 +- packages/x-charts/src/ScatterChart/ScatterChart.tsx | 2 +- .../corePlugins/useChartSeries/useChartSeries.types.ts | 4 ++-- 23 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/pages/x/api/charts/bar-chart-pro.json b/docs/pages/x/api/charts/bar-chart-pro.json index e9416c23a399b..f5b7f52de5034 100644 --- a/docs/pages/x/api/charts/bar-chart-pro.json +++ b/docs/pages/x/api/charts/bar-chart-pro.json @@ -22,7 +22,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/bar-chart.json b/docs/pages/x/api/charts/bar-chart.json index c46279678e7be..5f87e7c0fccc7 100644 --- a/docs/pages/x/api/charts/bar-chart.json +++ b/docs/pages/x/api/charts/bar-chart.json @@ -22,7 +22,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/chart-container.json b/docs/pages/x/api/charts/chart-container.json index 5eeba095e6acd..007425cb86b80 100644 --- a/docs/pages/x/api/charts/chart-container.json +++ b/docs/pages/x/api/charts/chart-container.json @@ -2,7 +2,7 @@ "props": { "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/chart-data-provider-pro.json b/docs/pages/x/api/charts/chart-data-provider-pro.json index 353dabda0016d..3553c23034f75 100644 --- a/docs/pages/x/api/charts/chart-data-provider-pro.json +++ b/docs/pages/x/api/charts/chart-data-provider-pro.json @@ -2,7 +2,7 @@ "props": { "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/chart-data-provider.json b/docs/pages/x/api/charts/chart-data-provider.json index c7afc0b433604..5e5fa438de519 100644 --- a/docs/pages/x/api/charts/chart-data-provider.json +++ b/docs/pages/x/api/charts/chart-data-provider.json @@ -1,6 +1,6 @@ { "props": { - "colors": { "type": { "name": "any" }, "default": "blueberryTwilightPalette" }, + "colors": { "type": { "name": "any" }, "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "any" } }, "height": { "type": { "name": "any" } }, "id": { "type": { "name": "any" } }, diff --git a/docs/pages/x/api/charts/heatmap.json b/docs/pages/x/api/charts/heatmap.json index 2145a8d6bc870..370e2aa36817e 100644 --- a/docs/pages/x/api/charts/heatmap.json +++ b/docs/pages/x/api/charts/heatmap.json @@ -24,7 +24,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/line-chart-pro.json b/docs/pages/x/api/charts/line-chart-pro.json index 0e65f0efc1ac1..8e8492e5285fc 100644 --- a/docs/pages/x/api/charts/line-chart-pro.json +++ b/docs/pages/x/api/charts/line-chart-pro.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/line-chart.json b/docs/pages/x/api/charts/line-chart.json index 554ae19bd1767..f01718cbb0702 100644 --- a/docs/pages/x/api/charts/line-chart.json +++ b/docs/pages/x/api/charts/line-chart.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/pie-chart.json b/docs/pages/x/api/charts/pie-chart.json index 469ab5bd89586..bf48f90e23d2b 100644 --- a/docs/pages/x/api/charts/pie-chart.json +++ b/docs/pages/x/api/charts/pie-chart.json @@ -6,7 +6,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "height": { "type": { "name": "number" } }, diff --git a/docs/pages/x/api/charts/scatter-chart-pro.json b/docs/pages/x/api/charts/scatter-chart-pro.json index c9ad94f1a89bb..6a892c4892a1b 100644 --- a/docs/pages/x/api/charts/scatter-chart-pro.json +++ b/docs/pages/x/api/charts/scatter-chart-pro.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/docs/pages/x/api/charts/scatter-chart.json b/docs/pages/x/api/charts/scatter-chart.json index 79803709e9749..01d61648e737f 100644 --- a/docs/pages/x/api/charts/scatter-chart.json +++ b/docs/pages/x/api/charts/scatter-chart.json @@ -21,7 +21,7 @@ }, "colors": { "type": { "name": "union", "description": "Array<string>
| func" }, - "default": "blueberryTwilightPalette" + "default": "rainbowSurgePalette" }, "dataset": { "type": { "name": "arrayOf", "description": "Array<object>" } }, "disableAxisListener": { "type": { "name": "bool" }, "default": "false" }, diff --git a/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx b/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx index 6edde91a82402..ca97302564544 100644 --- a/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx +++ b/packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx @@ -168,7 +168,7 @@ BarChartPro.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx b/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx index 89cf1af2261dc..1112d71adf234 100644 --- a/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx +++ b/packages/x-charts-pro/src/ChartDataProviderPro/ChartDataProviderPro.tsx @@ -82,7 +82,7 @@ ChartDataProviderPro.propTypes = { children: PropTypes.node, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/Heatmap/Heatmap.tsx b/packages/x-charts-pro/src/Heatmap/Heatmap.tsx index f8757a5a99206..6997842e1f505 100644 --- a/packages/x-charts-pro/src/Heatmap/Heatmap.tsx +++ b/packages/x-charts-pro/src/Heatmap/Heatmap.tsx @@ -220,7 +220,7 @@ Heatmap.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx b/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx index e1747a00fbce8..758af80c177dc 100644 --- a/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx +++ b/packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx @@ -224,7 +224,7 @@ LineChartPro.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx b/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx index 07010b555d822..695c301719114 100644 --- a/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx +++ b/packages/x-charts-pro/src/ScatterChartPro/ScatterChartPro.tsx @@ -106,7 +106,7 @@ ScatterChartPro.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/BarChart/BarChart.tsx b/packages/x-charts/src/BarChart/BarChart.tsx index afa34793e5273..b2cdac00eed16 100644 --- a/packages/x-charts/src/BarChart/BarChart.tsx +++ b/packages/x-charts/src/BarChart/BarChart.tsx @@ -179,7 +179,7 @@ BarChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/ChartContainer/ChartContainer.tsx b/packages/x-charts/src/ChartContainer/ChartContainer.tsx index b569755661293..452f205c4f93f 100644 --- a/packages/x-charts/src/ChartContainer/ChartContainer.tsx +++ b/packages/x-charts/src/ChartContainer/ChartContainer.tsx @@ -69,7 +69,7 @@ ChartContainer.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx b/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx index 300d7c9dcfee1..afaff3a73327b 100644 --- a/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx +++ b/packages/x-charts/src/ChartDataProvider/ChartDataProvider.tsx @@ -68,7 +68,7 @@ ChartDataProvider.propTypes = { children: PropTypes.node, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.any, /** diff --git a/packages/x-charts/src/LineChart/LineChart.tsx b/packages/x-charts/src/LineChart/LineChart.tsx index 2bd625481d7bc..c16f16a3d0192 100644 --- a/packages/x-charts/src/LineChart/LineChart.tsx +++ b/packages/x-charts/src/LineChart/LineChart.tsx @@ -200,7 +200,7 @@ LineChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/PieChart/PieChart.tsx b/packages/x-charts/src/PieChart/PieChart.tsx index f987e531af9cd..3f33cd0635340 100644 --- a/packages/x-charts/src/PieChart/PieChart.tsx +++ b/packages/x-charts/src/PieChart/PieChart.tsx @@ -170,7 +170,7 @@ PieChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/ScatterChart/ScatterChart.tsx b/packages/x-charts/src/ScatterChart/ScatterChart.tsx index f5948c70bf36b..9a984c2045f2a 100644 --- a/packages/x-charts/src/ScatterChart/ScatterChart.tsx +++ b/packages/x-charts/src/ScatterChart/ScatterChart.tsx @@ -177,7 +177,7 @@ ScatterChart.propTypes = { className: PropTypes.string, /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]), /** diff --git a/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts b/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts index 3ba2b68e4e5b8..05960bab80a2b 100644 --- a/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts +++ b/packages/x-charts/src/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.ts @@ -17,7 +17,7 @@ export interface UseChartSeriesParameters[]; /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors?: ChartsColorPalette; theme?: 'light' | 'dark'; @@ -33,7 +33,7 @@ export type UseChartSeriesDefaultizedParameters[]; /** * Color palette used to colorize multiple series. - * @default blueberryTwilightPalette + * @default rainbowSurgePalette */ colors: ChartsColorPalette; theme: 'light' | 'dark';