Skip to content

Conversation

@alex241728
Copy link
Contributor

@alex241728 alex241728 commented Oct 30, 2025

SUMMARY

According to the issue #32902, the scatter point charts lack of generic axes, which means the scatter point charts only allow x-axis to be formatted with time formats. So, to fix the problem mentioned in this issue, our team adds a new floating-point formats for x-axis.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

The before screenshot can be checked in issue #32902

The after screenshot:
Screenshot 2025-10-30 at 13 24 10

TESTING INSTRUCTIONS

  1. Create a scatter point chart or open an existing scatter point chart.
  2. Select an "X-axis" in "Data" tab.
  3. Check and select the format of "X-axis" in "Customize" tab. If the x-axis has a floating point data type (e.g. FLOAT, DOUBLE, REAL, NUMERIC, DECIMAL), the user interface will show "X Axis Number Format" and you can select formats for floating point numbers. If the x-axis has a time data type (e.g. TIMESTAMP WITHOUT TIME ZONE, TIMESTAMP WITH TIME ZONE), the user interface will show "Time Format" and you can select formats for time. The floating point formats are new features for x-axis, but the time formats are old features.

ADDITIONAL INFORMATION

@dosubot dosubot bot added the viz:charts:scatterplot Related to the Scatterplot chart label Oct 30, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Performance Inefficient linear search in visibility function ▹ view
Functionality Overly permissive numeric type detection ▹ view
Design Duplicated Column Type Checking Logic ▹ view
Files scanned
File Path Reviewed
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@bito-code-review
Copy link
Contributor

Interaction Diagram by Bito
sequenceDiagram
participant Dev as Developer
participant SharedCtrl as sharedControls.tsx<br/>🟩 Added | ●●● High
participant CtrlPanel as controlPanel.tsx<br/>🔄 Updated | ●●● High
participant Types as types.ts<br/>🔄 Updated | ●●○ Medium
participant Constants as constants.ts<br/>🔄 Updated | ●●○ Medium
participant TransformProps as transformProps.ts<br/>🔄 Updated | ●●● High
participant EchartsUI as EchartsTimeseries Component
Dev->>SharedCtrl: Define x_axis_number_format control
SharedCtrl-->>CtrlPanel: Export new control config
CtrlPanel->>CtrlPanel: Add visibility logic for numeric X-axis
CtrlPanel->>Types: Pass xAxisNumberFormat field
Types->>Constants: Initialize with SMART_NUMBER default
Constants->>TransformProps: Provide default format value
TransformProps->>TransformProps: Check if X-axis is Numeric type
TransformProps->>TransformProps: Apply getNumberFormatter(xAxisNumberFormat)
TransformProps-->>EchartsUI: Return formatted echartOptions
Loading

Critical path: Developer->sharedControls.tsx->controlPanel.tsx->transformProps.ts->EchartsTimeseries Component

Note: The diff adds support for numeric X-axis formatting in Timeseries charts. A new shared control 'x_axis_number_format' is defined, integrated into the control panel with conditional visibility for numeric columns, and used in transformProps to format numeric X-axis values alongside existing time-format support.

Copy link
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #2e97c7

Actionable Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx - 1
    • Incorrect time format visibility for DATE columns · Line 127-127
Review Details
  • Files reviewed - 5 · Commit Range: 0fab5cb..f6a95e7
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
    • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/types.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@sadpandajoe
Copy link
Member

@alex241728 thanks for creating the PR. Do you mind adding tests to your new feature?

@rusackas
Copy link
Member

rusackas commented Nov 3, 2025

Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:

pip3 install -r requirements/development.txt
pre-commit install

A series of checks will now run when you make a git commit.

Alternatively it is possible to run pre-commit by running pre-commit manually:

pre-commit run --all-files

@rusackas
Copy link
Member

rusackas commented Nov 5, 2025

Re-running CI 🤞

@alex241728
Copy link
Contributor Author

Re-running CI 🤞

I have completed the tests and rerun the precommit checks. I think the tests and checks are all passed. Can you check the pull request again. @rusackas

@sadpandajoe
Copy link
Member

For tests, we should move away from it() and use test() as done in this PR: https://github.com/apache/superset/pull/35305/files

@alex241728
Copy link
Contributor Author

For tests, we should move away from it() and use test() as done in this PR: https://github.com/apache/superset/pull/35305/files

@sadpandajoe @rusackas The test format has been fixed.

@rusackas rusackas requested a review from Copilot November 12, 2025 17:27
Copilot finished reviewing on behalf of rusackas November 12, 2025 17:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds floating-point number formatting support for scatter chart x-axes, addressing the limitation where only time formatting was previously available. The implementation introduces a new xAxisNumberFormat control that appears when a numeric column (specifically floating-point types like FLOAT, DOUBLE, REAL, NUMERIC, DECIMAL) is selected for the x-axis.

Key Changes:

  • Added conditional number formatting for x-axis based on data type (numeric vs temporal)
  • Introduced new x_axis_number_format control with visibility logic tied to column data types
  • Default number format set to 'SMART_NUMBER' for numeric x-axes

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
transformProps.test.ts Added comprehensive tests for both time and number formatting on scatter chart x-axes
controlPanel.test.ts Added tests validating visibility logic for time and number format controls
types.ts Extended form data type definition to include xAxisNumberFormat property
transformProps.ts Implemented conditional formatter selection based on x-axis data type (Temporal vs Numeric)
constants.ts Added default value 'SMART_NUMBER' for xAxisNumberFormat
controlPanel.tsx Added visibility-controlled UI controls for time and number formatting with data-type-specific logic
sharedControls.tsx Defined reusable x_axis_number_format control configuration

@rusackas
Copy link
Member

Looking at some of the failing CI stuff, this PR might need a rebase, pulling in the latest changes from master to resolve a couple of the items (at least I hope it will fix the typescript issue I'm currently seeing).

@alex241728
Copy link
Contributor Author

alex241728 commented Nov 12, 2025

Looking at some of the failing CI stuff, this PR might need a rebase, pulling in the latest changes from master to resolve a couple of the items (at least I hope it will fix the typescript issue I'm currently seeing).

@rusackas I have solved the suggestions provided by copilot. However, there is one thing I cannot solve in the pre-commit checks, which is provided in the quote. By the way, the transformProps.test for bar chart contains the same superTheme from the same file. It has the type error too.

Type checking 3 changed TypeScript files...
Running targeted type check on 3 files...
plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts:20:31 - error TS6305: Output file '/Users/alex241728/superset/superset-frontend/packages/superset-core/lib/ui/index.d.ts' has not been built from source file '/Users/alex241728/superset/superset-frontend/packages/superset-core/src/ui/index.ts'.
20 import { supersetTheme } from '@apache-superset/core/ui';
~~~~~~~~~~~~~~~~~~~~~~~~~~
plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts:33:31 - error TS6305: Output file '/Users/alex241728/superset/superset-frontend/packages/superset-core/lib/ui/index.d.ts' has not been built from source file '/Users/alex241728/superset/superset-frontend/packages/superset-core/src/ui/index.ts'.
33 import { supersetTheme } from '@apache-superset/core/ui';
~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 2 errors in 2 files.
Errors Files
1 plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts:20
1 plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts:33
Failed to execute type checking: Type check failed with exit code 2

@alex241728
Copy link
Contributor Author

Looking at some of the failing CI stuff, this PR might need a rebase, pulling in the latest changes from master to resolve a couple of the items (at least I hope it will fix the typescript issue I'm currently seeing).

@rusackas I have solved the suggestions provided by copilot. However, there is one thing I cannot solve in the pre-commit checks, which is provided in the quote. By the way, the transformProps.test for bar chart contains the same superTheme from the same file. It has the type error too.

Type checking 3 changed TypeScript files...
Running targeted type check on 3 files...
plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts:20:31 - error TS6305: Output file '/Users/alex241728/superset/superset-frontend/packages/superset-core/lib/ui/index.d.ts' has not been built from source file '/Users/alex241728/superset/superset-frontend/packages/superset-core/src/ui/index.ts'.
20 import { supersetTheme } from '@apache-superset/core/ui';

plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts:33:31 - error TS6305: Output file '/Users/alex241728/superset/superset-frontend/packages/superset-core/lib/ui/index.d.ts' has not been built from source file '/Users/alex241728/superset/superset-frontend/packages/superset-core/src/ui/index.ts'.
33 import { supersetTheme } from '@apache-superset/core/ui';

Found 2 errors in 2 files.
Errors Files
1 plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts:20
1 plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts:33
Failed to execute type checking: Type check failed with exit code 2

The error is fixed by

cd superset-frontend
npm run plugins:build

@rusackas rusackas added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Nov 14, 2025
@github-actions github-actions bot added 🎪 feeb12a 🚦 building Environment feeb12a status: building 🎪 feeb12a 📅 2025-11-14T00-25 Environment feeb12a created at 2025-11-14T00-25 🎪 feeb12a ⌛ 48h Environment feeb12a expires after 48h 🎪 feeb12a 🤡 rusackas Environment feeb12a requested by rusackas and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Nov 14, 2025
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for feeb12a

@github-actions github-actions bot added 🎪 feeb12a 🚦 deploying Environment feeb12a status: deploying 🎪 feeb12a 🚦 running Environment feeb12a status: running 🎪 🎯 feeb12a Active environment pointer - feeb12a is receiving traffic 🎪 feeb12a 🌐 35.89.8.79:8080 Environment feeb12a URL: http://35.89.8.79:8080 (click to visit) and removed 🎪 feeb12a 🚦 building Environment feeb12a status: building 🎪 feeb12a 🚦 deploying Environment feeb12a status: deploying 🎪 feeb12a 🚦 running Environment feeb12a status: running 🎪 🎯 feeb12a Active environment pointer - feeb12a is receiving traffic labels Nov 14, 2025
@github-actions
Copy link
Contributor

🎪 Showtime deployed environment on GHA for feeb12a

Environment: http://35.89.8.79:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for the contribution!

@rusackas rusackas merged commit 001b6cb into apache:master Nov 14, 2025
68 checks passed
aminghadersohi pushed a commit to aminghadersohi/superset that referenced this pull request Nov 17, 2025
Co-authored-by: Vincent <vincent.trung4@gmail.com>
kshi020302 pushed a commit to jl141/superset that referenced this pull request Nov 30, 2025
Co-authored-by: Vincent <vincent.trung4@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎪 feeb12a 🚦 running Environment feeb12a status: running 🎪 feeb12a 🤡 rusackas Environment feeb12a requested by rusackas 🎪 feeb12a 🌐 35.89.8.79:8080 Environment feeb12a URL: http://35.89.8.79:8080 (click to visit) 🎪 feeb12a ⌛ 48h Environment feeb12a expires after 48h 🎪 feeb12a 📅 2025-11-14T00-25 Environment feeb12a created at 2025-11-14T00-25 packages plugins size/L viz:charts:scatterplot Related to the Scatterplot chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scatter chart x-axis custom formatting option ignored with GENERIC_CHART_AXES enabled

4 participants