VanessaGiannoni opened a new pull request, #37405:
URL: https://github.com/apache/superset/pull/37405

   <!---
   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 label positioning and readability issues for negative values in 
stacked bar charts. Previously, labels on negative stacked bars were positioned 
outside the chart area making them hard to understand in relation to their data 
segments.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   #### Test only with NEGATIVE values
   1. Create a stacked bar chart with mixed positive and negative values:
   2. Go to http://localhost:8088/sqllab and paste this script
   ```SQL
   WITH chart_data AS (
   SELECT *
   FROM (VALUES
   ('Bar 1', 'Segment A', -10),
   ('Bar 1', 'Segment B', -5),
   ('Bar 2', 'Segment A', -7),
   ('Bar 2', 'Segment B', -3),
   ('Bar 3', 'Segment A', -12),
   ('Bar 3', 'Segment B', -6)
   ) AS t(bar, segment, value)
   )
   SELECT *
   FROM chart_data;
   ```
    
   3. Then press the "Create chart" button
   <img width="190" height="103" alt="image" 
src="https://github.com/user-attachments/assets/8fbacf08-bc26-467a-833a-b2f81894854d";
 />
   
   4. Configure:
       - Chart Type: Time-series Bar Chart
       - X-axis: column1
       - Metrics: SUM(column3)
       - Customize tab:
           - Show Value: ✓ Enable
           - Stacked Style: Stack
   5. Check the labels are positioned inside the bar at the very edge
   6. Change the color scheme and make sure the label changes its color to keep 
the color ratio according to AA standard 
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] 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