Skip to content

feat: add metric name for big number chart types #33013#33099

Merged
Antonio-RiveroMartnez merged 20 commits into
apache:masterfrom
fardin-developer:metric-name-big-number
May 7, 2025
Merged

feat: add metric name for big number chart types #33013#33099
Antonio-RiveroMartnez merged 20 commits into
apache:masterfrom
fardin-developer:metric-name-big-number

Conversation

@fardin-developer
Copy link
Copy Markdown
Contributor

Fixes: #32985

SUMMARY

This PR introduces support for displaying the Metric name in Big Number chart types, including Big Number and Big Number with Time Comparison. The metric name appears above the main number, styled consistently with existing elements, and includes customization options in the control panel.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

CHANGES

  • Added metric name display to:
    • Big Number
    • Big Number with Time Comparison
  • Positioning and spacing follow existing patterns of Big Number and subtitle.
  • Metric name font size defaults to 24px and scales responsively with the chart.
  • Added toggle in Customize section to show/hide metric name.
  • Added input to control metric name font size (similar to Subheader Font Size).

BEFORE/AFTER SCREENSHOTS

Before

Screenshot 2025-04-07 at 1 28 27 AM
Screenshot 2025-04-07 at 1 32 45 AM

After

Screenshot 2025-04-07 at 12 34 36 AM
Screenshot 2025-04-07 at 12 35 58 AM

Screen.Recording.2025-04-07.at.12.32.34.AM.mov

ADDITIONAL NOTES

  • Ensured the feature behaves correctly across chart types and screen sizes.
  • Maintained dynamic scaling and visual hierarchy.
  • Verified with RTL support and Storybook examples.

CHECKLIST

  • Displayed metric name above the number for all Big Number chart types.
  • Used responsive font scaling with base size 24px.
  • Added toggle and font size input to Customize controls.
  • Verified RTL compatibility.

@dosubot dosubot Bot added the viz:charts:bignumber Related to BigNumber charts label Apr 11, 2025
Copy link
Copy Markdown

@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.

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/types.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/utils.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/controlPanel.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/sharedControls.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/controlPanel.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/transformProps.ts
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx

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

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Documentation
Logging
Error Handling
Readability
Design
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

@github-actions
Copy link
Copy Markdown
Contributor

@geido Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

@github-actions
Copy link
Copy Markdown
Contributor

@geido Ephemeral environment spinning up at http://44.248.49.123:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

@michael-s-molina
Copy link
Copy Markdown
Member

@fardin-developer Is it possible to hide the metric name? There are cases where they are really extensive or the chart's title is pretty clear.

@rusackas also asked how does it handle really long metric names.

@fardin-developer
Copy link
Copy Markdown
Contributor Author

@fardin-developer Is it possible to hide the metric name? There are cases where they are really extensive or the chart's title is pretty clear.

@rusackas also asked how does it handle really long metric names.

Thanks for your feedback. I have added a checkbox to show metric name, by default it will be hidden.

@geido
Copy link
Copy Markdown
Member

geido commented Apr 15, 2025

I think we have lost the fix that supported showing friendly label names at the dataset level.

Screenshot 2025-04-15 at 14 40 50
Screenshot 2025-04-15 at 14 40 57

@geido geido added the preset:bounty Issues that have been selected by Preset and have a bounty attached. label Apr 15, 2025
@github-actions
Copy link
Copy Markdown
Contributor

@geido Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we create a control we can reuse instead of defining this on all 3 charts every time? something like how you use subtitleControl for example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

resolved it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same with this block, could this be some sort of util we can reuse in the 3 chart types?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the update! I’ve moved the originalLabel logic into a separate getOriginalLabel function and updated it to address issues where the metric key was incorrectly displayed in some cases. The new implementation now works as expected.

@apache apache deleted a comment from github-actions Bot Apr 17, 2025
@apache apache deleted a comment from github-actions Bot Apr 17, 2025
@apache apache deleted a comment from github-actions Bot Apr 17, 2025
@apache apache deleted a comment from github-actions Bot Apr 17, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2025

@Antonio-RiveroMartnez Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2025

@Antonio-RiveroMartnez Ephemeral environment spinning up at http://34.218.224.49:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

Copy link
Copy Markdown
Member

@Antonio-RiveroMartnez Antonio-RiveroMartnez left a comment

Choose a reason for hiding this comment

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

Tested on the ephemeral and LGTM! Thanks for taking care of this

Screen.Recording.2025-05-07.at.4.43.02.PM.mov

@fardin-developer
Copy link
Copy Markdown
Contributor Author

Tested on the ephemeral and LGTM! Thanks for taking care of this

Screen.Recording.2025-05-07.at.4.43.02.PM.mov

Thank you @Antonio-RiveroMartnez .

@Antonio-RiveroMartnez Antonio-RiveroMartnez removed the hold! On hold label May 7, 2025
@Antonio-RiveroMartnez Antonio-RiveroMartnez merged commit a928f8c into apache:master May 7, 2025
56 of 59 checks passed
LevisNgigi pushed a commit to LevisNgigi/superset that referenced this pull request Jun 18, 2025
…#33099)

Co-authored-by: Fardin Mustaque <fardinmustaque@Fardins-Mac-mini.local>
alexandrusoare pushed a commit to alexandrusoare/superset that referenced this pull request Jun 19, 2025
…#33099)

Co-authored-by: Fardin Mustaque <fardinmustaque@Fardins-Mac-mini.local>
(cherry picked from commit a928f8c)
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
…#33099)

Co-authored-by: Fardin Mustaque <fardinmustaque@Fardins-Mac-mini.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins preset:bounty Issues that have been selected by Preset and have a bounty attached. size/XL viz:charts:bignumber Related to BigNumber charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Show Metric for Big Number chart types

7 participants