goto-loop opened a new pull request, #27285:
URL: https://github.com/apache/superset/pull/27285

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   Fixes #21328.
   
   If you create a Gauge Chart with interval bounds and a minimum value set, 
the color boundaries are placed incorrectly. This PR changes the boundary 
calculation to take the minimum value into account during normalization by 
using the formula described [here](https://stats.stackexchange.com/a/70807).
   
   I've also updated the part of the test file where the interval calculation 
gets tested.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   Before (boundary between green and red should be at value 10 but isn't):
   ![Screenshot from 2024-02-27 
16-58-21](https://github.com/apache/superset/assets/102797966/524860b7-4d41-4ee8-a163-8169f7f2f13a)
   After:
   ![Screenshot from 2024-02-27 
16-59-06](https://github.com/apache/superset/assets/102797966/676f341d-048f-45ab-835a-b8eeb3a7d16e)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   1. Create a new Gauge chart, e.g. with exported_stats example dataset
   2. Select AVG(daily_members_posting_messages) as Metric
   3. On Customize tab, set INTERVAL BOUNDS to 10, 16.53 and INTERVAL COLORS to 
3, 6
   4. Set MIN to 8
   5. Now the boundary between green and red gets updated with the rest of the 
chart
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: #21328 
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
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]

Reply via email to