+
Loading...
);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/Stories.tsx
index a1ab6879264d0..6cdca623a1c82 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/Stories.tsx
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/Stories.tsx
@@ -19,9 +19,9 @@
/* eslint-disable no-magic-numbers */
import React from 'react';
-import { SuperChart } from '@superset-ui/core';
+import { SuperChart, useTheme } from '@superset-ui/core';
import MapBoxChartPlugin from '@superset-ui/legacy-plugin-chart-map-box';
-import data from './data';
+import { generateData } from './data';
new MapBoxChartPlugin().configure({ key: 'map-box' }).register();
@@ -29,27 +29,30 @@ export default {
title: 'Legacy Chart Plugins/legacy-plugin-chart-map-box',
};
-export const basic = () => (
-
-);
+export const Basic = () => {
+ const theme = useTheme();
+ return (
+
+ );
+};
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts
index 2d688e5fc4147..19a3c4c5a592f 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts
@@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+import { SupersetTheme } from '@superset-ui/core';
/* eslint-disable sort-keys, no-magic-numbers */
-export default {
+export const generateData = (theme: SupersetTheme) => ({
geoJSON: {
type: 'FeatureCollection',
features: [
@@ -5538,5 +5539,5 @@ export default {
],
renderWhileDragging: true,
tooltip: null,
- color: 'rgb(0, 122, 135)',
-};
+ color: theme.colors.primary.base,
+});
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/Stories.tsx
index 0a561473197bf..c6bef9a7f13d2 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/Stories.tsx
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/Stories.tsx
@@ -38,6 +38,7 @@ export const basic = () => (
formData={{
maxBubbleSize: '25',
showBubbles: true,
+ colorPicker: {},
}}
/>
);
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Stories.tsx
index d5b90dad9731c..486d6cca41e62 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Stories.tsx
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Stories.tsx
@@ -20,9 +20,9 @@
/* eslint-disable sort-keys */
/* eslint-disable no-magic-numbers */
import React from 'react';
-import { SuperChart } from '@superset-ui/core';
+import { SuperChart, useTheme } from '@superset-ui/core';
import { PathChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl';
-import payload from './payload';
+import { payload } from './payload';
import dummyDatasource from '../../../../shared/dummyDatasource';
new PathChartPlugin().configure({ key: 'deck_path' }).register();
@@ -31,51 +31,54 @@ export default {
title: 'Legacy Chart Plugins/legacy-preset-chart-deckgl/PathChartPlugin',
};
-export const PathChartViz = () => (
-
-);
+export const PathChartViz = () => {
+ const theme = useTheme();
+ return (
+
+ );
+};
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/payload.js b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/payload.js
index a30aad826984f..a303f8ac08875 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/payload.js
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/payload.js
@@ -19,7 +19,7 @@
/* eslint-disable sort-keys */
/* eslint-disable no-magic-numbers */
-export default {
+export const payload = theme => ({
cache_key: null,
cached_dttm: null,
cache_timeout: 86400,
@@ -82,7 +82,7 @@ export default {
data: {
features: [
{
- color: '#ed1c24',
+ color: theme.colors.primary.base,
path: [
[-122.3535851, 37.9360513],
[-122.3179784, 37.9249513],
@@ -109,10 +109,10 @@ export default {
[-122.3876274, 37.5993171],
],
__timestamp: null,
- extraProps: { color: '#ed1c24' },
+ extraProps: { color: theme.colors.primary.base },
},
{
- color: '#faa61a',
+ color: theme.colors.warning.base,
path: [
[-122.353165, 37.936887],
[-122.317269, 37.925655],
@@ -134,10 +134,10 @@ export default {
[-121.9772135, 37.5567286],
],
__timestamp: null,
- extraProps: { color: '#faa61a' },
+ extraProps: { color: theme.colors.warning.base },
},
{
- color: '#ffe800',
+ color: theme.colors.error.base,
path: [
[-121.945154, 38.018914],
[-122.024597, 38.003275],
@@ -167,10 +167,10 @@ export default {
[-122.38666, 37.599787],
],
__timestamp: null,
- extraProps: { color: '#ffe800' },
+ extraProps: { color: theme.colors.error.base },
},
{
- color: '#00aeef',
+ color: theme.colors.success.base,
path: [
[-121.900367, 37.701695],
[-121.928099, 37.699759],
@@ -192,10 +192,10 @@ export default {
[-122.469081, 37.706121],
],
__timestamp: null,
- extraProps: { color: '#00aeef' },
+ extraProps: { color: theme.colors.success.base },
},
{
- color: '#4db848',
+ color: theme.colors.warning.base,
path: [
[-121.9764, 37.557355],
[-122.017867, 37.591208],
@@ -218,11 +218,11 @@ export default {
[-122.4683093, 37.705461],
],
__timestamp: null,
- extraProps: { color: '#4db848' },
+ extraProps: { color: theme.colors.warning.base },
},
],
mapboxApiKey:
'pk.eyJ1Ijoia3Jpc3R3IiwiYSI6ImNqbGg1N242NTFlczczdnBhazViMjgzZ2sifQ.lUneM-o3NucXN189EYyXxQ',
metricLabels: [],
},
-};
+});
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/Stories.tsx
index 7267fd55c5288..ba48ad66acad8 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/Stories.tsx
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/Stories.tsx
@@ -54,7 +54,7 @@ export const basic = ({ width, height }) => (
formData={{
encoding: {
color: {
- value: '#0097e6',
+ field: 'name',
},
fontSize: {
field: 'sum__num',
@@ -120,7 +120,7 @@ export const encodesFontByFirstLetter = ({ width, height }) => (
formData={{
encoding: {
color: {
- value: '#8c7ae6',
+ field: 'name',
},
fontFamily: {
field: 'name[0]',
diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/timeShift.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/timeShift.tsx
index fe6201bf09530..12a85fe280075 100644
--- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/timeShift.tsx
+++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/preset-chart-xy/Line/stories/timeShift.tsx
@@ -18,80 +18,83 @@
*/
import React from 'react';
-import { SuperChart } from '@superset-ui/core';
+import { SuperChart, useTheme } from '@superset-ui/core';
import data from '../data/data2';
import { LINE_PLUGIN_TYPE } from '../constants';
import dummyDatasource from '../../../../../shared/dummyDatasource';
-export default () => (
-
{
+ const theme = useTheme();
+ return (
+
-);
+ }}
+ />
+ );
+};
diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.js b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.js
index 74a9aecb49da3..0417ea3e8b5af 100644
--- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.js
+++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.js
@@ -50,6 +50,7 @@ const propTypes = {
timeFormatter: PropTypes.func,
valueFormatter: PropTypes.func,
verboseMap: PropTypes.object,
+ theme: PropTypes.object,
};
function Calendar(element, props) {
@@ -69,6 +70,7 @@ function Calendar(element, props) {
timeFormatter,
valueFormatter,
verboseMap,
+ theme,
} = props;
const container = d3Select(element)
@@ -120,7 +122,7 @@ function Calendar(element, props) {
colorScale,
min: legendColors[0],
max: legendColors[legendColors.length - 1],
- empty: 'white',
+ empty: theme.colors.grayscale.light5,
},
displayLegend: showLegend,
itemName: '',
diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx
index e7d39d6310ca4..8908fc5242032 100644
--- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx
+++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx
@@ -18,83 +18,86 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
-import { reactify, styled, css } from '@superset-ui/core';
+import { reactify, styled, css, useTheme } from '@superset-ui/core';
import { Global } from '@emotion/react';
import Component from './Calendar';
const ReactComponent = reactify(Component);
-const Calender = ({ className, ...otherProps }) => (
-
- css`
- .d3-tip {
- line-height: 1;
- padding: ${theme.gridUnit * 3}px;
- background: ${theme.colors.grayscale.dark2};
- color: ${theme.colors.grayscale.light5};
- border-radius: 4px;
- pointer-events: none;
- z-index: 1000;
- font-size: ${theme.typography.sizes.s}px;
- }
- /* Creates a small triangle extender for the tooltip */
- .d3-tip:after {
- box-sizing: border-box;
- display: inline;
- font-size: ${theme.typography.sizes.xs};
- width: 100%;
- line-height: 1;
- color: ${theme.colors.grayscale.dark2};
- position: absolute;
- pointer-events: none;
- }
- /* Northward tooltips */
- .d3-tip.n:after {
- content: '\\25BC';
- margin: -${theme.gridUnit}px 0 0 0;
- top: 100%;
- left: 0;
- text-align: center;
- }
- /* Eastward tooltips */
- .d3-tip.e:after {
- content: '\\25C0';
- margin: -${theme.gridUnit}px 0 0 0;
- top: 50%;
- left: -${theme.gridUnit * 2}px;
- }
- /* Southward tooltips */
- .d3-tip.s:after {
- content: '\\25B2';
- margin: 0;
- top: -${theme.gridUnit * 2}px;
- left: 0;
- text-align: center;
- }
- /* Westward tooltips */
- .d3-tip.w:after {
- content: '\\25B6';
- margin: -${theme.gridUnit}px 0 0 0px;
- top: 50%;
- left: 100%;
- }
- `}
- />
-
-
-);
-
-Calender.defaultProps = {
+const Calendar = ({ className, ...otherProps }) => {
+ const theme = useTheme();
+ return (
+
+
+
+
+ );
+};
+
+Calendar.defaultProps = {
otherProps: {},
};
-Calender.propTypes = {
+Calendar.propTypes = {
className: PropTypes.string.isRequired,
otherProps: PropTypes.objectOf(PropTypes.any),
};
-export default styled(Calender)`
+export default styled(Calendar)`
${({ theme }) => `
.superset-legacy-chart-calendar {
padding: ${theme.gridUnit * 3}px;
diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx
index 52b20f1bdafab..91efe6b0cbcaa 100644
--- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx
+++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx
@@ -18,16 +18,19 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
-import { styled, reactify } from '@superset-ui/core';
+import { styled, reactify, useTheme } from '@superset-ui/core';
import WorldMap from './WorldMap';
const ReactWorldMap = reactify(WorldMap);
-const WorldMapComponent = ({ className, ...otherProps }) => (
-
-
-
-);
+const WorldMapComponent = ({ className, ...otherProps }) => {
+ const theme = useTheme();
+ return (
+
+
+
+ );
+};
WorldMapComponent.propTypes = {
className: PropTypes.string.isRequired,
diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js
index c7253e10d0e68..b22c2b6e62493 100644
--- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js
+++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js
@@ -55,6 +55,7 @@ function WorldMap(element, props) {
showBubbles,
linearColorScheme,
color,
+ theme,
} = props;
const div = d3.select(element);
div.classed('superset-legacy-chart-world-map', true);
@@ -90,14 +91,14 @@ function WorldMap(element, props) {
height,
data: processedData,
fills: {
- defaultFill: '#eee',
+ defaultFill: theme.colors.grayscale.light2,
},
geographyConfig: {
popupOnHover: true,
highlightOnHover: true,
borderWidth: 1,
- borderColor: '#feffff',
- highlightBorderColor: '#feffff',
+ borderColor: theme.colors.grayscale.light5,
+ highlightBorderColor: theme.colors.grayscale.light5,
highlightFillColor: color,
highlightBorderWidth: 1,
popupTemplate: (geo, d) =>
@@ -119,7 +120,7 @@ function WorldMap(element, props) {
animate: true,
highlightOnHover: true,
highlightFillColor: color,
- highlightBorderColor: 'black',
+ highlightBorderColor: theme.colors.grayscale.dark2,
highlightBorderWidth: 2,
highlightBorderOpacity: 1,
highlightFillOpacity: 0.85,
diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx
index 8a80e310f6d6c..9b20113448b7f 100644
--- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx
+++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx
@@ -17,7 +17,8 @@
* under the License.
*/
-import React, { useMemo, CSSProperties } from 'react';
+import { styled } from '@superset-ui/core';
+import React, { useMemo } from 'react';
import { filterXSS } from 'xss';
export type TooltipProps = {
@@ -31,6 +32,22 @@ export type TooltipProps = {
| undefined;
};
+const StyledDiv = styled.div<{ top: number; left: number }>`
+ ${({ theme, top, left }) => `
+ position: absolute;
+ top: ${top}px;
+ left: ${left}px;
+ padding: ${theme.gridUnit * 2}px;
+ margin: ${theme.gridUnit * 2}px;
+ background: ${theme.colors.grayscale.dark2};
+ color: ${theme.colors.grayscale.light5};
+ maxWidth: 300px;
+ fontSize: ${theme.typography.sizes.s}px;
+ zIndex: 9;
+ pointerEvents: none;
+ `}
+`;
+
export default function Tooltip(props: TooltipProps) {
const { tooltip } = props;
if (typeof tooltip === 'undefined' || tooltip === null) {
@@ -39,24 +56,6 @@ export default function Tooltip(props: TooltipProps) {
const { x, y, content } = tooltip;
- // eslint-disable-next-line react-hooks/rules-of-hooks
- const style: CSSProperties = useMemo(
- () => ({
- position: 'absolute',
- top: `${y}px`,
- left: `${x}px`,
- padding: '8px',
- margin: '8px',
- background: 'rgba(0, 0, 0, 0.8)',
- color: '#fff',
- maxWidth: '300px',
- fontSize: '12px',
- zIndex: 9,
- pointerEvents: 'none',
- }),
- [x, y],
- );
-
if (typeof content === 'string') {
// eslint-disable-next-line react-hooks/rules-of-hooks
const contentHtml = useMemo(
@@ -66,14 +65,18 @@ export default function Tooltip(props: TooltipProps) {
[content],
);
return (
-
+
);
}
- return {content}
;
+ return (
+
+ {content}
+
+ );
}
diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
index ab2d9b727ef1d..1cd079044d884 100644
--- a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
+++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
@@ -55,9 +55,18 @@ const PivotTableWrapper = styled.div`
`;
const METRIC_KEY = 'metric';
-const iconStyle = { stroke: 'black', strokeWidth: '16px' };
const vals = ['value'];
+const StyledPlusSquareOutlined = styled(PlusSquareOutlined)`
+ stroke: ${({ theme }) => theme.colors.grayscale.light2};
+ stroke-width: 16px;
+`;
+
+const StyledMinusSquareOutlined = styled(MinusSquareOutlined)`
+ stroke: ${({ theme }) => theme.colors.grayscale.light2};
+ stroke-width: 16px;
+`;
+
const aggregatorsFactory = (formatter: NumberFormatter) => ({
Count: aggregatorTemplates.count(formatter),
'Count Unique Values': aggregatorTemplates.countUnique(formatter),
@@ -345,8 +354,8 @@ export default function PivotTableChart(props: PivotTableProps) {
() => ({
colSubtotalDisplay: { displayOnTop: colSubtotalPosition },
rowSubtotalDisplay: { displayOnTop: rowSubtotalPosition },
- arrowCollapsed: ,
- arrowExpanded: ,
+ arrowCollapsed: ,
+ arrowExpanded: ,
}),
[colSubtotalPosition, rowSubtotalPosition],
);
diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx
index 5d8ae0105e1af..a903c26fbc70b 100644
--- a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx
+++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx
@@ -105,7 +105,7 @@ class WordCloud extends React.PureComponent<
text: 'Text',
},
defaultEncoding: {
- color: { value: 'black' },
+ color: { value: this.props.theme.colors.grayscale.dark2 },
fontFamily: { value: this.props.theme.typography.families.sansSerif },
fontSize: { value: 20 },
fontWeight: { value: 'bold' },
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx
index f4825c369bb2d..a6b99ed18020d 100644
--- a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx
+++ b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/BoxPlot.tsx
@@ -68,7 +68,9 @@ type Props = {
Readonly;
export default class BoxPlot extends React.PureComponent {
- private createEncoder = boxPlotEncoderFactory.createSelector();
+ private createEncoder = boxPlotEncoderFactory(
+ this.props.theme?.colors.darkGray,
+ ).createSelector();
private createMargin = createMarginSelector();
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/Encoder.ts b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/Encoder.ts
index ff33c8090446c..27cd33809ab06 100644
--- a/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/Encoder.ts
+++ b/superset-frontend/plugins/preset-chart-xy/src/components/BoxPlot/Encoder.ts
@@ -25,7 +25,7 @@ export type BoxPlotEncodingConfig = {
color: ['Color', string];
};
-export const boxPlotEncoderFactory =
+export const boxPlotEncoderFactory = (darkGray: string) =>
createEncoderFactory({
channelTypes: {
x: 'XBand',
@@ -35,7 +35,7 @@ export const boxPlotEncoderFactory =
defaultEncoding: {
x: { field: 'x', type: 'nominal' },
y: { field: 'y', type: 'quantitative' },
- color: { value: '#222' },
+ color: { value: darkGray },
},
});
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/Encoder.ts b/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/Encoder.ts
index bc860f4e8213b..49d747603830f 100644
--- a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/Encoder.ts
+++ b/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/Encoder.ts
@@ -34,7 +34,7 @@ export type ScatterPlotEncodingConfig = {
tooltip: ['Text', string, 'multiple'];
};
-export const scatterPlotEncoderFactory =
+export const scatterPlotEncoderFactory = (darkGray: string) =>
createEncoderFactory({
channelTypes: {
x: 'X',
@@ -48,7 +48,7 @@ export const scatterPlotEncoderFactory =
defaultEncoding: {
x: { field: 'x', type: 'quantitative' },
y: { field: 'y', type: 'quantitative' },
- fill: { value: '#222' },
+ fill: { value: darkGray },
group: [],
size: { value: 5 },
stroke: { value: 'none' },
diff --git a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx b/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx
index 2df0d688d5ea2..ddf259a839ed4 100644
--- a/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx
+++ b/superset-frontend/plugins/preset-chart-xy/src/components/ScatterPlot/ScatterPlot.tsx
@@ -67,7 +67,9 @@ type Props = {
Readonly;
export default class ScatterPlot extends PureComponent {
- private createEncoder = scatterPlotEncoderFactory.createSelector();
+ private createEncoder = scatterPlotEncoderFactory(
+ this.props.theme?.colors.darkGray,
+ ).createSelector();
private createMargin = createMarginSelector();