liang-wenjie opened a new pull request, #44138:
URL: https://github.com/apache/superset/pull/44138

   ### SUMMARY
   
   Adds a new ECharts plugin **"Big Number with YoY & MoM"** 
(`BigNumberYoyMom`) that renders a KPI card with an optional title, a big 
number and two comparison rows (MoM / YoY), modeled after the existing "Big 
Number with Trendline" plugin. Every fixed ECharts `graphic` text style from 
the reference option is exposed as a configurable control.
   
   Highlights:
   
   - Two mutually exclusive comparison sources per slot:
     - **Time comparison** (time shift): renders the percentage change using 
the configured offset (e.g. `1 month ago` / `1 year ago`).
     - **Comparison value metric**: picks a column or a custom SQL expression 
and renders the computed value directly, with direction arrows (`↑` / `↓`) 
based on the sign.
   - Time column (X axis) and time grain controls; adhoc SQL time columns (e.g. 
`STR_TO_DATE(...)`) are supported by downgrading the granularity to a plain 
column.
   - Open time ranges (e.g. "No filter"): point-to-point comparison — the 
render path shifts the newest point by the offset and matches it against the 
time series; missing points render as `—`. No enclosed time range is required.
   - Layout: 5-tier ratio font sizes reused from Big Number controls, 
configurable positions/gaps (blank values equal 0), and auto-spacing by 
estimated text width to prevent overlap.
   - The big number Number/Currency format does not affect MoM/YoY rows; each 
comparison slot has its own number format.
   - Chinese translations for the new controls and the plugin name/description, 
plus light/dark thumbnails.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Light and dark thumbnails are included in the plugin 
(`images/thumbnail.png`, `images/thumbnail-dark.png`). In-browser screenshots 
can be provided on request.
   
   ### TESTING INSTRUCTIONS
   
   1. Create a chart with "Big Number with YoY & MoM".
   2. Configure a metric; optionally set a time column and time grain.
   3. For each comparison slot choose:
      - Time comparison + offset → verify percentage change with `↑`/`↓`;
      - Comparison value metric (column or custom SQL) → verify the computed 
value is rendered with direction arrows.
   4. With an open time range ("No filter") verify the point-to-point lookup 
renders values and `—` when the previous point is missing.
   5. Verify layout: 5-tier font sizes, gaps (blank = 0), auto-spacing, no 
overlap between title/big number/comparison rows.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to