liang-wenjie opened a new pull request, #44140:
URL: https://github.com/apache/superset/pull/44140
## Summary
Add a new ECharts chart type "Big Number with YoY & MoM" that renders a KPI
card with an optional title, a big number, and MoM/YoY comparison rows
(reference: "Big Number with Trendline").
- Two mutually exclusive comparison sources per slot: time shift (percentage
change) or comparison value metric (column / custom SQL rendered as the
computed value with direction arrows)
- Time column (X axis) + time grain controls; adhoc SQL time columns
supported
- Open time ranges use point-to-point comparison (missing points render as
"—")
- 5-tier ratio font sizes; configurable positions/gaps (blank = 0);
auto-spacing against overlap
- Big number number/currency format independent from MoM/YoY formats
- Chinese translations and light/dark thumbnails
Closes #44139.
## BEFORE / AFTER
Adds a new chart type; existing charts are unaffected.
## TESTING INSTRUCTIONS
1. Create a chart with the new "带同比与环比的大数字" (Big Number with YoY & MoM) viz
type.
2. Configure a main metric and optionally a title.
3. For each comparison slot, either:
- choose a time shift (e.g. "1 month ago" / "1 year ago") to show the
percentage change, or
- pick a comparison value metric (column or custom SQL) to render the
value directly with an up/down arrow.
4. With a time column set and no time range ("No filter"), the comparison
matches the previous period point-to-point; missing points render as "—".
5. Verify layout controls: 5-tier font sizes, gaps from title / big number,
comparison spacing, swap MoM and YoY positions, per-slot percent difference
formats.
## ADDITIONAL INFORMATION
- Has associated issue: #44139
- Changes UI: yes
- Introduces new feature: yes
- Python backend unchanged
--
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]