Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin-chart-echarts): xAxis scale is not correct when time grain is quarter #19686

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

stephenLYZ
Copy link
Member

@stephenLYZ stephenLYZ commented Apr 13, 2022

SUMMARY

This PR fixes the xAxis scale in the time series chart V2 when time grain is quarter, which is different from the time series chart V1. The bar chart looks like it contains three months. Actually, the bar width does not represent how many months it contains but is an optimization done by echart itself to look better, echart does not know whether it is month or quarter.

So here we use echart.minInterval to make sure that xAxis scale is the same as time grain, which does not lead to user misunderstanding.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before

Time-series chart (nvd3)

image

Time-series chart V2 (echart)

image

after

image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix.

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #19686 (092d2e5) into master (6a3220f) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master   #19686      +/-   ##
==========================================
- Coverage   66.47%   66.46%   -0.02%     
==========================================
  Files        1681     1681              
  Lines       64468    64451      -17     
  Branches     6607     6608       +1     
==========================================
- Hits        42857    42839      -18     
  Misses      19917    19917              
- Partials     1694     1695       +1     
Flag Coverage Δ
javascript 51.12% <50.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...gin-chart-echarts/src/Timeseries/transformProps.ts 57.89% <50.00%> (-0.17%) ⬇️
superset-frontend/src/views/components/Menu.tsx 50.00% <0.00%> (-10.00%) ⬇️
...perset-frontend/src/views/CRUD/welcome/Welcome.tsx 74.22% <0.00%> (-0.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a3220f...092d2e5. Read the comment docs.

@villebro
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

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

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Wonderful improvement @stephenLYZ ! ❤️

@zhaoyongjie zhaoyongjie merged commit 059cb4e into apache:master Apr 13, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants