You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/03 06:24:51 UTC

(superset) branch legacy-viz-t3-compare created (now b033709e5bb)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a change to branch legacy-viz-t3-compare
in repository https://gitbox.apache.org/repos/asf/superset.git


      at b033709e5bb feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin

This branch includes the following new commits:

     new b033709e5bb feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch legacy-viz-t3-compare
in repository https://gitbox.apache.org/repos/asf/superset.git

commit b033709e5bb36d7b9e8dc7d64813e4fe3cf63fbe
Author: Claude Code <no...@anthropic.com>
AuthorDate: Thu Jul 2 23:23:53 2026 -0700

    feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin
    
    Adds a MigrateCompareChart processor (the shared TimeseriesChart base
    already handles the timeseries control mapping, including normalizing
    the legacy 'absolute' comparison type), registers it with the viz
    migration CLI, and adds the Alembic revision with the standard MySQL
    MEDIUMTEXT widening and reversible form_data backups. The nvd3 Compare
    plugin, its registrations, the NVD3CompareTimeSeriesViz backend class
    and the cumulative-line renderer branch are removed.
    
    The nvd3 renderer's interactive re-basing (clicking a point to re-base
    percentages) is not preserved by the ECharts line chart; noted for
    UPDATING.md.
    
    Co-Authored-By: Claude Fable 5 <no...@anthropic.com>
---
 .../src/Compare/controlPanel.ts                    |  76 --
 .../src/Compare/images/example-dark.jpg            | Bin 63894 -> 0 bytes
 .../src/Compare/images/example.jpg                 | Bin 66360 -> 0 bytes
 .../src/Compare/images/thumbnail-dark.png          | Bin 89728 -> 0 bytes
 .../src/Compare/images/thumbnail.png               | Bin 32162 -> 0 bytes
 .../src/Compare/images/thumbnailLarge.png          | Bin 90272 -> 0 bytes
 .../legacy-preset-chart-nvd3/src/Compare/index.ts  |  62 --
 .../src/Compare/stories/NVD3Compare.stories.tsx    | 208 -----
 .../src/Compare/stories/data.ts                    | 927 ---------------------
 .../legacy-preset-chart-nvd3/src/NVD3Vis.ts        |  17 +-
 .../plugins/legacy-preset-chart-nvd3/src/index.ts  |   1 -
 .../plugins/legacy-preset-chart-nvd3/src/preset.ts |   2 -
 .../src/visualizations/presets/MainPreset.ts       |   2 -
 superset/cli/viz_migrations.py                     |   3 +
 .../migrations/shared/migrate_viz/processors.py    |   5 +
 ...5f6a7b8c9d0_migrate_compare_chart_to_echarts.py |  55 ++
 superset/viz.py                                    |   7 -
 .../viz/nvd3_compare_chart_to_echarts_test.py      |  39 +
 18 files changed, 103 insertions(+), 1301 deletions(-)

diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts
deleted file mode 100644
index 5a8f8bfb1a1..00000000000
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { t } from '@apache-superset/core/translation';
-import {
-  ControlPanelConfig,
-  getStandardizedControls,
-  sections,
-} from '@superset-ui/chart-controls';
-import {
-  xAxisLabel,
-  yAxisLabel,
-  bottomMargin,
-  xTicksLayout,
-  xAxisFormat,
-  yLogScale,
-  yAxisBounds,
-  xAxisShowMinmax,
-  yAxisShowMinmax,
-  leftMargin,
-  timeSeriesSection,
-} from '../NVD3Controls';
-
-const config: ControlPanelConfig = {
-  controlPanelSections: [
-    sections.legacyTimeseriesTime,
-    timeSeriesSection[0],
-    {
-      label: t('Chart Options'),
-      expanded: true,
-      controlSetRows: [['color_scheme']],
-    },
-    {
-      label: t('X Axis'),
-      expanded: true,
-      controlSetRows: [
-        [xAxisLabel, bottomMargin],
-        [xTicksLayout, xAxisFormat],
-        [xAxisShowMinmax, null],
-      ],
-    },
-    {
-      label: t('Y Axis'),
-      expanded: true,
-      controlSetRows: [
-        [yAxisLabel, leftMargin],
-        [yAxisShowMinmax, yLogScale],
-        ['y_axis_format', yAxisBounds],
-      ],
-    },
-    timeSeriesSection[1],
-    sections.annotations,
-  ],
-  formDataOverrides: formData => ({
-    ...formData,
-    groupby: getStandardizedControls().popAllColumns(),
-    metrics: getStandardizedControls().popAllMetrics(),
-  }),
-};
-
-export default config;
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/example-dark.jpg b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/example-dark.jpg
deleted file mode 100644
index 658db25a815..00000000000
Binary files a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/example-dark.jpg and /dev/null differ
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/example.jpg b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/example.jpg
deleted file mode 100644
index 375ef57a6aa..00000000000
Binary files a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/example.jpg and /dev/null differ
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnail-dark.png b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnail-dark.png
deleted file mode 100644
index 1707dc5503c..00000000000
Binary files a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnail-dark.png and /dev/null differ
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnail.png b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnail.png
deleted file mode 100644
index df29a818d38..00000000000
Binary files a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnail.png and /dev/null differ
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnailLarge.png b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnailLarge.png
deleted file mode 100644
index 86b38069a9b..00000000000
Binary files a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/images/thumbnailLarge.png and /dev/null differ
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/index.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/index.ts
deleted file mode 100644
index 28229f649b9..00000000000
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/index.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { t } from '@apache-superset/core/translation';
-import { ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core';
-import transformProps from '../transformProps';
-import thumbnail from './images/thumbnail.png';
-import thumbnailDark from './images/thumbnail-dark.png';
-import example from './images/example.jpg';
-import exampleDark from './images/example-dark.jpg';
-import controlPanel from './controlPanel';
-
-const metadata = new ChartMetadata({
-  category: t('Evolution'),
-  credits: ['http://nvd3.org'],
-  description: t(
-    'Visualizes many different time-series objects in a single chart. This chart is being deprecated and we recommend using the Time-series Chart instead.',
-  ),
-  exampleGallery: [{ url: example, urlDark: exampleDark }],
-  label: ChartLabel.Deprecated,
-  name: t('Time-series Percent Change'),
-  tags: [
-    t('Legacy'),
-    t('Time'),
-    t('nvd3'),
-    t('Advanced-Analytics'),
-    t('Comparison'),
-    t('Line'),
-    t('Percentages'),
-    t('Predictive'),
-    t('Trend'),
-  ],
-  thumbnail,
-  thumbnailDark,
-  useLegacyApi: true,
-});
-
-export default class CompareChartPlugin extends ChartPlugin {
-  constructor() {
-    super({
-      loadChart: () => import('../ReactNVD3'),
-      metadata,
-      transformProps,
-      controlPanel,
-    });
-  }
-}
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/stories/NVD3Compare.stories.tsx b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/stories/NVD3Compare.stories.tsx
deleted file mode 100644
index 86686c90a6a..00000000000
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/stories/NVD3Compare.stories.tsx
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { SuperChart, VizType } from '@superset-ui/core';
-import { CompareChartPlugin } from '@superset-ui/legacy-preset-chart-nvd3';
-import { dummyDatasource, withResizableChartDemo } from '@storybook-shared';
-import data from './data';
-
-new CompareChartPlugin().configure({ key: VizType.Compare }).register();
-
-export default {
-  title: 'Legacy Chart Plugins/legacy-preset-chart-nvd3/Compare',
-  decorators: [withResizableChartDemo],
-  args: {
-    colorScheme: 'd3Category10',
-    contribution: false,
-    yLogScale: false,
-  },
-  argTypes: {
-    colorScheme: {
-      control: 'select',
-      options: [
-        'supersetColors',
-        'd3Category10',
-        'bnbColors',
-        'googleCategory20c',
-      ],
-    },
-    contribution: {
-      control: 'boolean',
-      description: 'Compute contribution to total',
-    },
-    yLogScale: { control: 'boolean' },
-  },
-};
-
-export const Basic = ({
-  colorScheme,
-  contribution,
-  yLogScale,
-  width,
-  height,
-}: {
-  colorScheme: string;
-  contribution: boolean;
-  yLogScale: boolean;
-  width: number;
-  height: number;
-}) => (
-  <SuperChart
-    chartType="compare"
-    width={width}
-    height={height}
-    datasource={dummyDatasource}
-    queriesData={[{ data }]}
-    formData={{
-      bottom_margin: 'auto',
-      color_scheme: colorScheme,
-      contribution,
-      left_margin: 'auto',
-      viz_type: VizType.Compare,
-      x_axis_format: 'smart_date',
-      x_axis_label: '',
-      x_axis_showminmax: false,
-      x_ticks_layout: 'auto',
-      y_axis_bounds: [null, null],
-      y_axis_format: '.3s',
-      y_axis_label: '',
-      y_axis_showminmax: false,
-      y_log_scale: yLogScale,
-    }}
-  />
-);
-
-/* eslint-disable no-magic-numbers */
-const timeFormatData = [
-  {
-    key: ['Africa and Middle East'],
-    values: [
-      { x: 1606348800000, y: 3985 },
-      { x: 1606435200000, y: 5882 },
-      { x: 1606521600000, y: 7983 },
-      { x: 1606608000000, y: 16462 },
-      { x: 1606694400000, y: 5542 },
-      { x: 1606780800000, y: 2825 },
-    ],
-  },
-  {
-    key: ['Asia'],
-    values: [
-      { x: 1606348800000, y: 34837 },
-      { x: 1606435200000, y: 40718 },
-      { x: 1606521600000, y: 58507 },
-      { x: 1606608000000, y: 110120 },
-      { x: 1606694400000, y: 43443 },
-      { x: 1606780800000, y: 33538 },
-    ],
-  },
-  {
-    key: ['Australia'],
-    values: [
-      { x: 1606348800000, y: 12975 },
-      { x: 1606435200000, y: 18471 },
-      { x: 1606521600000, y: 17880 },
-      { x: 1606608000000, y: 52204 },
-      { x: 1606694400000, y: 26690 },
-      { x: 1606780800000, y: 16423 },
-    ],
-  },
-  {
-    key: ['Europe'],
-    values: [
-      { x: 1606348800000, y: 127029 },
-      { x: 1606435200000, y: 177637 },
-      { x: 1606521600000, y: 172653 },
-      { x: 1606608000000, y: 203654 },
-      { x: 1606694400000, y: 79200 },
-      { x: 1606780800000, y: 45238 },
-    ],
-  },
-  {
-    key: ['LatAm'],
-    values: [
-      { x: 1606348800000, y: 22513 },
-      { x: 1606435200000, y: 24594 },
-      { x: 1606521600000, y: 32578 },
-      { x: 1606608000000, y: 34733 },
-      { x: 1606694400000, y: 71696 },
-      { x: 1606780800000, y: 166611 },
-    ],
-  },
-  {
-    key: ['North America'],
-    values: [
-      { x: 1606348800000, y: 104596 },
-      { x: 1606435200000, y: 109850 },
-      { x: 1606521600000, y: 136873 },
-      { x: 1606608000000, y: 133243 },
-      { x: 1606694400000, y: 327739 },
-      { x: 1606780800000, y: 162711 },
-    ],
-  },
-];
-
-export const timeFormat = () => (
-  <SuperChart
-    chartType="compare"
-    width={400}
-    height={400}
-    datasource={dummyDatasource}
-    queriesData={[{ data: timeFormatData }]}
-    formData={{
-      datasource: '24771__table',
-      vizType: VizType.Compare,
-      urlParams: {},
-      timeRangeEndpoints: ['inclusive', 'exclusive'],
-      granularitySqla: '__time',
-      timeGrainSqla: 'P1D',
-      timeRange: 'Last week',
-      metrics: ['random_metric'],
-      adhocFilters: [],
-      groupby: ['dim_origin_region'],
-      timeseriesLimitMetric: null,
-      orderDesc: true,
-      contribution: false,
-      rowLimit: 10000,
-      colorScheme: 'd3Category10',
-      labelColors: {},
-      xAxisLabel: '',
-      bottomMargin: 'auto',
-      xTicksLayout: 'auto',
-      xAxisFormat: 'smart_date',
-      xAxisShowminmax: false,
-      yAxisLabel: '',
-      leftMargin: 'auto',
-      yAxisShowminmax: false,
-      yLogScale: false,
-      yAxisFormat: 'SMART_NUMBER',
-      yAxisBounds: [null, null],
-      rollingType: 'None',
-      comparisonType: 'values',
-      resampleRule: null,
-      resampleMethod: null,
-      annotationLayers: [],
-      appliedTimeExtras: {},
-      where: '',
-      having: '',
-      havingFilters: [],
-      filters: [],
-    }}
-  />
-);
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/stories/data.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/stories/data.ts
deleted file mode 100644
index 5d43d8e4bec..00000000000
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/stories/data.ts
+++ /dev/null
@@ -1,927 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* eslint-disable sort-keys, no-magic-numbers */
-export default [
-  {
-    key: ['Christopher'],
-    values: [
-      {
-        x: -157766400000.0,
-        y: 24703,
-      },
-      {
-        x: -126230400000.0,
-        y: 27861,
-      },
-      {
-        x: -94694400000.0,
-        y: 29436,
-      },
-      {
-        x: -63158400000.0,
-        y: 31463,
-      },
-      {
-        x: -31536000000.0,
-        y: 35718,
-      },
-      {
-        x: 0.0,
-        y: 41758,
-      },
-      {
-        x: 31536000000.0,
-        y: 48172,
-      },
-      {
-        x: 63072000000.0,
-        y: 52092,
-      },
-      {
-        x: 94694400000.0,
-        y: 48217,
-      },
-      {
-        x: 126230400000.0,
-        y: 48476,
-      },
-      {
-        x: 157766400000.0,
-        y: 46438,
-      },
-      {
-        x: 189302400000.0,
-        y: 45086,
-      },
-      {
-        x: 220924800000.0,
-        y: 46610,
-      },
-      {
-        x: 252460800000.0,
-        y: 47107,
-      },
-      {
-        x: 283996800000.0,
-        y: 50514,
-      },
-      {
-        x: 315532800000.0,
-        y: 48969,
-      },
-      {
-        x: 347155200000.0,
-        y: 50108,
-      },
-      {
-        x: 378691200000.0,
-        y: 59055,
-      },
-      {
-        x: 410227200000.0,
-        y: 59188,
-      },
-      {
-        x: 441763200000.0,
-        y: 59859,
-      },
-      {
-        x: 473385600000.0,
-        y: 59516,
-      },
-      {
-        x: 504921600000.0,
-        y: 56633,
-      },
-      {
-        x: 536457600000.0,
-        y: 54466,
-      },
-      {
-        x: 567993600000.0,
-        y: 52996,
-      },
-      {
-        x: 599616000000.0,
-        y: 53205,
-      },
-      {
-        x: 631152000000.0,
-        y: 52322,
-      },
-      {
-        x: 662688000000.0,
-        y: 47109,
-      },
-      {
-        x: 694224000000.0,
-        y: 42470,
-      },
-      {
-        x: 725846400000.0,
-        y: 38257,
-      },
-      {
-        x: 757382400000.0,
-        y: 34823,
-      },
-      {
-        x: 788918400000.0,
-        y: 32728,
-      },
-      {
-        x: 820454400000.0,
-        y: 30988,
-      },
-      {
-        x: 852076800000.0,
-        y: 29179,
-      },
-      {
-        x: 883612800000.0,
-        y: 27083,
-      },
-      {
-        x: 915148800000.0,
-        y: 25700,
-      },
-      {
-        x: 946684800000.0,
-        y: 24959,
-      },
-      {
-        x: 978307200000.0,
-        y: 23180,
-      },
-      {
-        x: 1009843200000.0,
-        y: 21731,
-      },
-      {
-        x: 1041379200000.0,
-        y: 20793,
-      },
-      {
-        x: 1072915200000.0,
-        y: 19739,
-      },
-      {
-        x: 1104537600000.0,
-        y: 19190,
-      },
-      {
-        x: 1136073600000.0,
-        y: 19674,
-      },
-      {
-        x: 1167609600000.0,
-        y: 19986,
-      },
-      {
-        x: 1199145600000.0,
-        y: 17771,
-      },
-    ],
-  },
-  {
-    key: ['David'],
-    values: [
-      {
-        x: -157766400000.0,
-        y: 67646,
-      },
-      {
-        x: -126230400000.0,
-        y: 66207,
-      },
-      {
-        x: -94694400000.0,
-        y: 66581,
-      },
-      {
-        x: -63158400000.0,
-        y: 63531,
-      },
-      {
-        x: -31536000000.0,
-        y: 63502,
-      },
-      {
-        x: 0.0,
-        y: 61570,
-      },
-      {
-        x: 31536000000.0,
-        y: 52948,
-      },
-      {
-        x: 63072000000.0,
-        y: 46218,
-      },
-      {
-        x: 94694400000.0,
-        y: 40968,
-      },
-      {
-        x: 126230400000.0,
-        y: 41654,
-      },
-      {
-        x: 157766400000.0,
-        y: 39019,
-      },
-      {
-        x: 189302400000.0,
-        y: 39165,
-      },
-      {
-        x: 220924800000.0,
-        y: 40407,
-      },
-      {
-        x: 252460800000.0,
-        y: 40533,
-      },
-      {
-        x: 283996800000.0,
-        y: 41898,
-      },
-      {
-        x: 315532800000.0,
-        y: 41743,
-      },
-      {
-        x: 347155200000.0,
-        y: 40486,
-      },
-      {
-        x: 378691200000.0,
-        y: 40283,
-      },
-      {
-        x: 410227200000.0,
-        y: 39048,
-      },
-      {
-        x: 441763200000.0,
-        y: 38346,
-      },
-      {
-        x: 473385600000.0,
-        y: 38395,
-      },
-      {
-        x: 504921600000.0,
-        y: 37021,
-      },
-      {
-        x: 536457600000.0,
-        y: 36672,
-      },
-      {
-        x: 567993600000.0,
-        y: 35214,
-      },
-      {
-        x: 599616000000.0,
-        y: 35139,
-      },
-      {
-        x: 631152000000.0,
-        y: 33661,
-      },
-      {
-        x: 662688000000.0,
-        y: 30347,
-      },
-      {
-        x: 694224000000.0,
-        y: 28344,
-      },
-      {
-        x: 725846400000.0,
-        y: 26947,
-      },
-      {
-        x: 757382400000.0,
-        y: 24784,
-      },
-      {
-        x: 788918400000.0,
-        y: 22967,
-      },
-      {
-        x: 820454400000.0,
-        y: 22941,
-      },
-      {
-        x: 852076800000.0,
-        y: 21824,
-      },
-      {
-        x: 883612800000.0,
-        y: 20816,
-      },
-      {
-        x: 915148800000.0,
-        y: 20267,
-      },
-      {
-        x: 946684800000.0,
-        y: 19695,
-      },
-      {
-        x: 978307200000.0,
-        y: 19281,
-      },
-      {
-        x: 1009843200000.0,
-        y: 18600,
-      },
-      {
-        x: 1041379200000.0,
-        y: 18557,
-      },
-      {
-        x: 1072915200000.0,
-        y: 18315,
-      },
-      {
-        x: 1104537600000.0,
-        y: 18017,
-      },
-      {
-        x: 1136073600000.0,
-        y: 17510,
-      },
-      {
-        x: 1167609600000.0,
-        y: 17400,
-      },
-      {
-        x: 1199145600000.0,
-        y: 16049,
-      },
-    ],
-  },
-  {
-    key: ['James'],
-    values: [
-      {
-        x: -157766400000.0,
-        y: 67506,
-      },
-      {
-        x: -126230400000.0,
-        y: 65036,
-      },
-      {
-        x: -94694400000.0,
-        y: 61554,
-      },
-      {
-        x: -63158400000.0,
-        y: 60584,
-      },
-      {
-        x: -31536000000.0,
-        y: 59824,
-      },
-      {
-        x: 0.0,
-        y: 61597,
-      },
-      {
-        x: 31536000000.0,
-        y: 54463,
-      },
-      {
-        x: 63072000000.0,
-        y: 46960,
-      },
-      {
-        x: 94694400000.0,
-        y: 42782,
-      },
-      {
-        x: 126230400000.0,
-        y: 41258,
-      },
-      {
-        x: 157766400000.0,
-        y: 39471,
-      },
-      {
-        x: 189302400000.0,
-        y: 38203,
-      },
-      {
-        x: 220924800000.0,
-        y: 39916,
-      },
-      {
-        x: 252460800000.0,
-        y: 39783,
-      },
-      {
-        x: 283996800000.0,
-        y: 39237,
-      },
-      {
-        x: 315532800000.0,
-        y: 39185,
-      },
-      {
-        x: 347155200000.0,
-        y: 38176,
-      },
-      {
-        x: 378691200000.0,
-        y: 38750,
-      },
-      {
-        x: 410227200000.0,
-        y: 36228,
-      },
-      {
-        x: 441763200000.0,
-        y: 35728,
-      },
-      {
-        x: 473385600000.0,
-        y: 35750,
-      },
-      {
-        x: 504921600000.0,
-        y: 33955,
-      },
-      {
-        x: 536457600000.0,
-        y: 32552,
-      },
-      {
-        x: 567993600000.0,
-        y: 32418,
-      },
-      {
-        x: 599616000000.0,
-        y: 32658,
-      },
-      {
-        x: 631152000000.0,
-        y: 32288,
-      },
-      {
-        x: 662688000000.0,
-        y: 30460,
-      },
-      {
-        x: 694224000000.0,
-        y: 28450,
-      },
-      {
-        x: 725846400000.0,
-        y: 26193,
-      },
-      {
-        x: 757382400000.0,
-        y: 24706,
-      },
-      {
-        x: 788918400000.0,
-        y: 22691,
-      },
-      {
-        x: 820454400000.0,
-        y: 21122,
-      },
-      {
-        x: 852076800000.0,
-        y: 20368,
-      },
-      {
-        x: 883612800000.0,
-        y: 19651,
-      },
-      {
-        x: 915148800000.0,
-        y: 18508,
-      },
-      {
-        x: 946684800000.0,
-        y: 17939,
-      },
-      {
-        x: 978307200000.0,
-        y: 17023,
-      },
-      {
-        x: 1009843200000.0,
-        y: 16905,
-      },
-      {
-        x: 1041379200000.0,
-        y: 16832,
-      },
-      {
-        x: 1072915200000.0,
-        y: 16459,
-      },
-      {
-        x: 1104537600000.0,
-        y: 16046,
-      },
-      {
-        x: 1136073600000.0,
-        y: 16139,
-      },
-      {
-        x: 1167609600000.0,
-        y: 15821,
-      },
-      {
-        x: 1199145600000.0,
-        y: 14920,
-      },
-    ],
-  },
-  {
-    key: ['John'],
-    values: [
-      {
-        x: -157766400000.0,
-        y: 71390,
-      },
-      {
-        x: -126230400000.0,
-        y: 64858,
-      },
-      {
-        x: -94694400000.0,
-        y: 61480,
-      },
-      {
-        x: -63158400000.0,
-        y: 60754,
-      },
-      {
-        x: -31536000000.0,
-        y: 58644,
-      },
-      {
-        x: 0.0,
-        y: 58348,
-      },
-      {
-        x: 31536000000.0,
-        y: 51382,
-      },
-      {
-        x: 63072000000.0,
-        y: 43028,
-      },
-      {
-        x: 94694400000.0,
-        y: 39061,
-      },
-      {
-        x: 126230400000.0,
-        y: 37553,
-      },
-      {
-        x: 157766400000.0,
-        y: 34970,
-      },
-      {
-        x: 189302400000.0,
-        y: 33876,
-      },
-      {
-        x: 220924800000.0,
-        y: 34103,
-      },
-      {
-        x: 252460800000.0,
-        y: 33895,
-      },
-      {
-        x: 283996800000.0,
-        y: 35305,
-      },
-      {
-        x: 315532800000.0,
-        y: 35131,
-      },
-      {
-        x: 347155200000.0,
-        y: 34761,
-      },
-      {
-        x: 378691200000.0,
-        y: 34560,
-      },
-      {
-        x: 410227200000.0,
-        y: 33047,
-      },
-      {
-        x: 441763200000.0,
-        y: 32484,
-      },
-      {
-        x: 473385600000.0,
-        y: 31397,
-      },
-      {
-        x: 504921600000.0,
-        y: 30103,
-      },
-      {
-        x: 536457600000.0,
-        y: 29462,
-      },
-      {
-        x: 567993600000.0,
-        y: 29301,
-      },
-      {
-        x: 599616000000.0,
-        y: 29751,
-      },
-      {
-        x: 631152000000.0,
-        y: 29011,
-      },
-      {
-        x: 662688000000.0,
-        y: 27727,
-      },
-      {
-        x: 694224000000.0,
-        y: 26156,
-      },
-      {
-        x: 725846400000.0,
-        y: 24918,
-      },
-      {
-        x: 757382400000.0,
-        y: 24119,
-      },
-      {
-        x: 788918400000.0,
-        y: 23174,
-      },
-      {
-        x: 820454400000.0,
-        y: 22104,
-      },
-      {
-        x: 852076800000.0,
-        y: 21330,
-      },
-      {
-        x: 883612800000.0,
-        y: 20556,
-      },
-      {
-        x: 915148800000.0,
-        y: 20280,
-      },
-      {
-        x: 946684800000.0,
-        y: 20032,
-      },
-      {
-        x: 978307200000.0,
-        y: 18839,
-      },
-      {
-        x: 1009843200000.0,
-        y: 17400,
-      },
-      {
-        x: 1041379200000.0,
-        y: 17170,
-      },
-      {
-        x: 1072915200000.0,
-        y: 16381,
-      },
-      {
-        x: 1104537600000.0,
-        y: 15692,
-      },
-      {
-        x: 1136073600000.0,
-        y: 15083,
-      },
-      {
-        x: 1167609600000.0,
-        y: 14348,
-      },
-      {
-        x: 1199145600000.0,
-        y: 13110,
-      },
-    ],
-  },
-  {
-    key: ['Michael'],
-    values: [
-      {
-        x: -157766400000.0,
-        y: 80812,
-      },
-      {
-        x: -126230400000.0,
-        y: 79709,
-      },
-      {
-        x: -94694400000.0,
-        y: 82204,
-      },
-      {
-        x: -63158400000.0,
-        y: 81785,
-      },
-      {
-        x: -31536000000.0,
-        y: 84893,
-      },
-      {
-        x: 0.0,
-        y: 85015,
-      },
-      {
-        x: 31536000000.0,
-        y: 77321,
-      },
-      {
-        x: 63072000000.0,
-        y: 71197,
-      },
-      {
-        x: 94694400000.0,
-        y: 67598,
-      },
-      {
-        x: 126230400000.0,
-        y: 67304,
-      },
-      {
-        x: 157766400000.0,
-        y: 68149,
-      },
-      {
-        x: 189302400000.0,
-        y: 66686,
-      },
-      {
-        x: 220924800000.0,
-        y: 67344,
-      },
-      {
-        x: 252460800000.0,
-        y: 66875,
-      },
-      {
-        x: 283996800000.0,
-        y: 67473,
-      },
-      {
-        x: 315532800000.0,
-        y: 68375,
-      },
-      {
-        x: 347155200000.0,
-        y: 68467,
-      },
-      {
-        x: 378691200000.0,
-        y: 67904,
-      },
-      {
-        x: 410227200000.0,
-        y: 67708,
-      },
-      {
-        x: 441763200000.0,
-        y: 67457,
-      },
-      {
-        x: 473385600000.0,
-        y: 64667,
-      },
-      {
-        x: 504921600000.0,
-        y: 63959,
-      },
-      {
-        x: 536457600000.0,
-        y: 63442,
-      },
-      {
-        x: 567993600000.0,
-        y: 63924,
-      },
-      {
-        x: 599616000000.0,
-        y: 65233,
-      },
-      {
-        x: 631152000000.0,
-        y: 65138,
-      },
-      {
-        x: 662688000000.0,
-        y: 60646,
-      },
-      {
-        x: 694224000000.0,
-        y: 54216,
-      },
-      {
-        x: 725846400000.0,
-        y: 49443,
-      },
-      {
-        x: 757382400000.0,
-        y: 44361,
-      },
-      {
-        x: 788918400000.0,
-        y: 41311,
-      },
-      {
-        x: 820454400000.0,
-        y: 38284,
-      },
-      {
-        x: 852076800000.0,
-        y: 37459,
-      },
-      {
-        x: 883612800000.0,
-        y: 36525,
-      },
-      {
-        x: 915148800000.0,
-        y: 33820,
-      },
-      {
-        x: 946684800000.0,
-        y: 31956,
-      },
-      {
-        x: 978307200000.0,
-        y: 29612,
-      },
-      {
-        x: 1009843200000.0,
-        y: 28156,
-      },
-      {
-        x: 1041379200000.0,
-        y: 27031,
-      },
-      {
-        x: 1072915200000.0,
-        y: 25418,
-      },
-      {
-        x: 1104537600000.0,
-        y: 23678,
-      },
-      {
-        x: 1136073600000.0,
-        y: 22498,
-      },
-      {
-        x: 1167609600000.0,
-        y: 21805,
-      },
-      {
-        x: 1199145600000.0,
-        y: 20271,
-      },
-    ],
-  },
-];
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts
index 0531a8d869b..319c43fce51 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts
@@ -47,7 +47,6 @@ import {
   cleanColorInput,
   computeYDomain,
   drawBarValues,
-  generateCompareTooltipContent,
   generateTimePivotTooltip,
   generateTooltipClassName,
   getMaxLabelSize,
@@ -124,7 +123,7 @@ const BREAKPOINTS = {
   small: 340,
 };
 
-const TIMESERIES_VIZ_TYPES = [VizType.Compare, VizType.TimePivot];
+const TIMESERIES_VIZ_TYPES = [VizType.TimePivot];
 
 const CHART_ID_PREFIX = 'chart-id-';
 
@@ -182,7 +181,6 @@ const propTypes = {
     VizType.BoxPlot,
     'bubble',
     VizType.Bullet,
-    VizType.Compare,
     'column',
     VizType.TimePivot,
     'pie',
@@ -399,13 +397,6 @@ function nvd3Vis(element, props) {
         chart = nv.models.multiBarChart().reduceXTicks(false);
         break;
 
-      case VizType.Compare:
-        chart = nv.models.cumulativeLineChart();
-        chart.xScale(d3.time.scale.utc());
-        chart.useInteractiveGuideline(true);
-        chart.xAxis.showMaxMin(false);
-        break;
-
       case VizType.BoxPlot:
         colorKey = 'label';
         chart = nv.models.boxPlotChart();
@@ -553,12 +544,6 @@ function nvd3Vis(element, props) {
       );
     }
 
-    if (isVizTypes([VizType.Compare])) {
-      chart.interactiveLayer.tooltip.contentGenerator(d =>
-        generateCompareTooltipContent(d, yAxisFormatter),
-      );
-    }
-
     // This is needed for correct chart dimensions if a chart is rendered in a hidden container
     chart.width(width);
     chart.height(height);
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/index.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/index.ts
index eb77d57c6a3..e49f353cb95 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/index.ts
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/index.ts
@@ -19,5 +19,4 @@
 
 export { default as NVD3ChartPreset } from './preset';
 export { default as BulletChartPlugin } from './Bullet';
-export { default as CompareChartPlugin } from './Compare';
 export { default as TimePivotChartPlugin } from './TimePivot';
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/preset.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/preset.ts
index 584579488fc..19f918092df 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/preset.ts
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/preset.ts
@@ -18,7 +18,6 @@
  */
 import { Preset, VizType } from '@superset-ui/core';
 import BulletChartPlugin from './Bullet';
-import CompareChartPlugin from './Compare';
 import TimePivotChartPlugin from './TimePivot';
 
 export default class NVD3ChartPreset extends Preset {
@@ -27,7 +26,6 @@ export default class NVD3ChartPreset extends Preset {
       name: 'NVD3 charts',
       plugins: [
         new BulletChartPlugin().configure({ key: VizType.Bullet }),
-        new CompareChartPlugin().configure({ key: VizType.Compare }),
         new TimePivotChartPlugin().configure({ key: VizType.TimePivot }),
       ],
     });
diff --git a/superset-frontend/src/visualizations/presets/MainPreset.ts b/superset-frontend/src/visualizations/presets/MainPreset.ts
index fc76bb907a0..c7e3e9f6e34 100644
--- a/superset-frontend/src/visualizations/presets/MainPreset.ts
+++ b/superset-frontend/src/visualizations/presets/MainPreset.ts
@@ -35,7 +35,6 @@ import { WordCloudChartPlugin } from '@superset-ui/plugin-chart-word-cloud';
 import WorldMapChartPlugin from '@superset-ui/legacy-plugin-chart-world-map';
 import {
   BulletChartPlugin,
-  CompareChartPlugin,
   TimePivotChartPlugin,
 } from '@superset-ui/legacy-preset-chart-nvd3';
 import { DeckGLChartPreset } from '@superset-ui/preset-chart-deckgl';
@@ -116,7 +115,6 @@ export default class MainPreset extends Preset {
         new BulletChartPlugin().configure({ key: VizType.Bullet }),
         new CalendarChartPlugin().configure({ key: VizType.Calendar }),
         new ChordChartPlugin().configure({ key: VizType.Chord }),
-        new CompareChartPlugin().configure({ key: VizType.Compare }),
         new CountryMapChartPlugin().configure({ key: VizType.CountryMap }),
         new EchartsFunnelChartPlugin().configure({ key: VizType.Funnel }),
         new EchartsSankeyChartPlugin().configure({ key: VizType.Sankey }),
diff --git a/superset/cli/viz_migrations.py b/superset/cli/viz_migrations.py
index df62a598584..793142a425c 100644
--- a/superset/cli/viz_migrations.py
+++ b/superset/cli/viz_migrations.py
@@ -33,6 +33,7 @@ from superset.migrations.shared.migrate_viz.processors import (
     MigrateAreaChart,
     MigrateBarChart,
     MigrateBubbleChart,
+    MigrateCompareChart,
     MigrateDistBarChart,
     MigrateDualLine,
     MigrateHeatmapChart,
@@ -50,6 +51,7 @@ class VizType(str, Enum):
     AREA = "area"
     BAR = "bar"
     BUBBLE = "bubble"
+    COMPARE = "compare"
     DIST_BAR = "dist_bar"
     DUAL_LINE = "dual_line"
     HEATMAP = "heatmap"
@@ -65,6 +67,7 @@ MIGRATIONS: dict[VizType, Type[MigrateViz]] = {
     VizType.AREA: MigrateAreaChart,
     VizType.BAR: MigrateBarChart,
     VizType.BUBBLE: MigrateBubbleChart,
+    VizType.COMPARE: MigrateCompareChart,
     VizType.DIST_BAR: MigrateDistBarChart,
     VizType.DUAL_LINE: MigrateDualLine,
     VizType.HEATMAP: MigrateHeatmapChart,
diff --git a/superset/migrations/shared/migrate_viz/processors.py b/superset/migrations/shared/migrate_viz/processors.py
index c60b6bd42fc..8a1a931cff8 100644
--- a/superset/migrations/shared/migrate_viz/processors.py
+++ b/superset/migrations/shared/migrate_viz/processors.py
@@ -388,6 +388,11 @@ class MigrateLineChart(TimeseriesChart):
         return super()._build_query()
 
 
+class MigrateCompareChart(TimeseriesChart):
+    source_viz_type = "compare"
+    target_viz_type = "echarts_timeseries_line"
+
+
 class MigrateAreaChart(TimeseriesChart):
     source_viz_type = "area"
     target_viz_type = "echarts_area"
diff --git a/superset/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py b/superset/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py
new file mode 100644
index 00000000000..03dce76dd5b
--- /dev/null
+++ b/superset/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""migrate_compare_chart_to_echarts
+
+Revision ID: e5f6a7b8c9d0
+Revises: d4e5f6a7b8c9
+Create Date: 2026-07-02 21:30:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import text
+from sqlalchemy.dialects.mysql.base import MySQLDialect
+
+from superset import db
+from superset.migrations.shared.migrate_viz import MigrateCompareChart
+
+# revision identifiers, used by Alembic.
+revision = "e5f6a7b8c9d0"
+down_revision = "d4e5f6a7b8c9"
+
+
+def upgrade():
+    bind = op.get_bind()
+
+    # Ensure `slice.params` and `slice.query_context` in MySQL is MEDIUMTEXT
+    # before migration, as the migration will save a duplicate form_data backup
+    # which may significantly increase the size of these fields.
+    if isinstance(bind.dialect, MySQLDialect):
+        # If the columns are already MEDIUMTEXT, this is a no-op
+        op.execute(text("ALTER TABLE slices MODIFY params MEDIUMTEXT"))
+        op.execute(text("ALTER TABLE slices MODIFY query_context MEDIUMTEXT"))
+
+    session = db.Session(bind=bind)
+    MigrateCompareChart.upgrade(session)
+
+
+def downgrade():
+    bind = op.get_bind()
+    session = db.Session(bind=bind)
+    MigrateCompareChart.downgrade(session)
diff --git a/superset/viz.py b/superset/viz.py
index e329d56d620..1536af58da4 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1200,13 +1200,6 @@ class NVD3TimePivotViz(NVD3TimeSeriesViz):
         return chart_data
 
 
-class NVD3CompareTimeSeriesViz(NVD3TimeSeriesViz):
-    """A line chart component where you can compare the % change over time"""
-
-    viz_type = "compare"
-    verbose_name = _("Time Series - Percent Change")
-
-
 class ChordViz(BaseViz):
     """A Chord diagram"""
 
diff --git a/tests/unit_tests/migrations/viz/nvd3_compare_chart_to_echarts_test.py b/tests/unit_tests/migrations/viz/nvd3_compare_chart_to_echarts_test.py
new file mode 100644
index 00000000000..6107efc44fd
--- /dev/null
+++ b/tests/unit_tests/migrations/viz/nvd3_compare_chart_to_echarts_test.py
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from typing import Any
+
+from superset.migrations.shared.migrate_viz import MigrateCompareChart
+from tests.unit_tests.migrations.viz.utils import (
+    migrate_and_assert,
+    TIMESERIES_SOURCE_FORM_DATA,
+    TIMESERIES_TARGET_FORM_DATA,
+)
+
+SOURCE_FORM_DATA: dict[str, Any] = {
+    "viz_type": "compare",
+}
+
+TARGET_FORM_DATA: dict[str, Any] = {
+    "form_data_bak": SOURCE_FORM_DATA,
+    "viz_type": "echarts_timeseries_line",
+}
+
+
+def test_migration() -> None:
+    SOURCE_FORM_DATA.update(TIMESERIES_SOURCE_FORM_DATA)
+    TARGET_FORM_DATA.update(TIMESERIES_TARGET_FORM_DATA)
+    migrate_and_assert(MigrateCompareChart, SOURCE_FORM_DATA, TARGET_FORM_DATA)