diff --git a/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js b/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js index 0b7cb49f2..4c2d72ee3 100644 --- a/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js +++ b/plugins/superset-ui-plugins/packages/superset-ui-legacy-preset-chart-nvd3/src/utils.js @@ -33,6 +33,7 @@ export function cleanColorInput(value) { // for superset series that should have the same color return String(value) .trim() + .replace(' (right axis)', '') .split(', ') .filter(k => !TIME_SHIFT_PATTERN.test(k)) .join(', '); diff --git a/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/DualLine/Stories.jsx b/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/DualLine/Stories.jsx index 6e6b92ad3..4518e9dcb 100644 --- a/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/DualLine/Stories.jsx +++ b/plugins/superset-ui-plugins/packages/superset-ui-plugins-demo/storybook/stories/legacy-preset-chart-nvd3/DualLine/Stories.jsx @@ -3,6 +3,11 @@ import React from 'react'; import { SuperChart } from '@superset-ui/chart'; import data from './data'; +const reverseData = data.map(series => ({ + ...series, + yAxis: series.yAxis === 1 ? 2 : 1, +})); + export default [ { renderStory: () => ( @@ -12,8 +17,6 @@ export default [ datasource: { verboseMap: {} }, formData: { colorScheme: 'd3Category10', - metric: 'avg__num', - metric2: 'sum__num', vizType: 'dual_line', xAxisFormat: 'smart_date', yAxis2Format: '.3s', @@ -28,4 +31,44 @@ export default [ storyName: 'Basic', storyPath: 'legacy-|preset-chart-nvd3|DualLineChartPlugin', }, + { + renderStory: () => ( +
+ + +
+ ), + storyName: 'Swap y-axis with consistent color', + storyPath: 'legacy-|preset-chart-nvd3|DualLineChartPlugin', + }, ];