superset icon indicating copy to clipboard operation
superset copied to clipboard

feat(explore): Add time shift color control to ECharts

Open rtexelm opened this issue 1 year ago • 7 comments

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

  1. Create a new chart using the Sales dataset.
  2. Use COUNT(*) as your metric.
  3. Set order_date as the X-Axis and a Month time grain.
  4. Apply any time range filter that returns data.
  5. Expand the time comparison and set 1 month ago.
  6. Click on CREATE CHART.
  7. Navigate to Customize tab
  8. Click the Time Shift color checkbox

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

rtexelm avatar Aug 08 '24 23:08 rtexelm

/testenv up

yousoph avatar Aug 08 '24 23:08 yousoph

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

github-actions[bot] avatar Aug 09 '24 00:08 github-actions[bot]

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

michael-s-molina avatar Aug 12 '24 17:08 michael-s-molina

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.

michael-s-molina avatar Aug 12 '24 17:08 michael-s-molina

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.

yousoph avatar Aug 13 '24 17:08 yousoph

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 👍🏼

michael-s-molina avatar Aug 13 '24 17:08 michael-s-molina

Hello, any news about this feature? It's really important for us. Thanks

fpassantino avatar Aug 27 '24 07:08 fpassantino

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar Sep 12 '24 16:09 github-actions[bot]

@fpassantino sorry for the delay.

rtexelm avatar Sep 12 '24 16:09 rtexelm