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): force min y-tick for log axis with zero #24186

Merged
merged 1 commit into from
May 23, 2023

Conversation

villebro
Copy link
Member

@villebro villebro commented May 23, 2023

SUMMARY

When choosing "Log axis" for a set of series that contain zero values, the y-axis is fixed to the interval 1-10, despite values being in excess of 10. To get around this limitation, we calculate the best lower bound for the chart by recording the lowest positive series value on the chart and set the minimum based on that if undefined. This appears to be how Google Sheets does it; the resulting chart in GS is very similar to the one that this solution produces. Note, that if the user wishes to specify a custom lower bound, that will be used.

AFTER

For a series with the lowest defined value at approx. 400, the lower tick mark is set to 100:
image
If a min bound is specified, the calculated lower bound is not used:
image

BEFORE

Previously, the y-axis would be fixed to 1-10:
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

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #24186 (c3b5179) into master (fc8c537) will increase coverage by 0.05%.
The diff coverage is 88.40%.

❗ Current head c3b5179 differs from pull request most recent head efe65f7. Consider uploading reports for the commit efe65f7 to get more accurate results

@@            Coverage Diff             @@
##           master   #24186      +/-   ##
==========================================
+ Coverage   68.23%   68.29%   +0.05%     
==========================================
  Files        1955     1955              
  Lines       75405    75506     +101     
  Branches     8215     8223       +8     
==========================================
+ Hits        51455    51564     +109     
+ Misses      21844    21834      -10     
- Partials     2106     2108       +2     
Flag Coverage Δ
javascript 54.69% <73.91%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...end/src/features/databases/DatabaseModal/index.tsx 43.63% <ø> (ø)
superset/charts/api.py 87.07% <ø> (+0.98%) ⬆️
superset/constants.py 100.00% <ø> (ø)
...gin-chart-echarts/src/Timeseries/transformProps.ts 56.77% <33.33%> (-0.98%) ⬇️
superset/datasets/schemas.py 97.48% <50.00%> (ø)
superset-frontend/src/views/CRUD/hooks.ts 53.14% <66.66%> (+0.19%) ⬆️
superset/dashboards/permalink/commands/create.py 90.32% <66.66%> (-2.54%) ⬇️
superset/explore/permalink/commands/create.py 88.88% <66.66%> (-2.03%) ⬇️
superset/databases/api.py 91.10% <76.92%> (-0.46%) ⬇️
superset/key_value/types.py 90.62% <84.00%> (-4.50%) ⬇️
... and 17 more

... and 6 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@villebro villebro merged commit bc0079f into apache:master May 23, 2023
29 checks passed
@villebro villebro deleted the villebro/log-zero branch May 23, 2023 10:25
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 8, 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/M 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants