feat(explore): Add time shift color control to ECharts
SUMMARY
Adds a new checkbox control to timeseries capable charts allowing the user to choose whether or not to duplicate the original series colors for the shifts.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
https://github.com/user-attachments/assets/0df125af-3917-4a0e-b5c8-927357bbf3a4
TESTING INSTRUCTIONS
- Create a new chart using the Sales dataset.
- Use
COUNT(*)as your metric. - Set
order_dateas the X-Axis and a Month time grain. - Apply any time range filter that returns data.
- Expand the time comparison and set 1 month ago.
- Click on
CREATE CHART. - Navigate to
Customizetab - Click the
Time Shift colorcheckbox
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
/testenv up
@yousoph Ephemeral environment spinning up at http://35.90.51.45:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.
The only concern that I have with this approach is about charts consumption at the dashboard layer. It might be confusing for users that time shifts are represented differently among charts which might harm UX. I'm not sure if we should discuss more about this as you can see in https://github.com/apache/superset/issues/26041
Another option is to assume that all time shifts will be of varied colors and remove the need for this checkbox. Essentially, not make the correlation between series and their time shifts using colors, only the legend.
I'm not too concerned about the dashboard level - I'm guessing that there will be consistency at the org or creator level with this control based on preference so there aren't likely to be too many discrepancies at the dashboard level.
In terms of defaulting to use varied colors, I'm not opposed to that but I thought the original fix in https://github.com/apache/superset/pull/24048 was to retain the same color for the time shift as the original control. Since that was the fix that was implemented, we thought adding a control would be the best way to give the flexibility to use either option.
I'm not too concerned about the dashboard level - I'm guessing that there will be consistency at the org or creator level with this control based on preference so there aren't likely to be too many discrepancies at the dashboard level.
This is a good point @yousoph. We have other controls that might provoke the same effect if not used consistently. Thank you for the additional context 👍🏼
Hello, any news about this feature? It's really important for us. Thanks
Ephemeral environment shutdown and build artifacts deleted.
@fpassantino sorry for the delay.