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

   ### SUMMARY
   Fixes #36806 
   
   This PR fixes a regression where offset metrics (time comparisons like "1 
year ago") were not displayed as dashed lines when charts have no dimensions.
   
   **Root Cause:**
   The `isDerivedSeries` function only applied dashed styling when 
`comparison_type === "Values"`, and `hasTimeOffset` didn't detect series where 
the name exactly matched a time offset (which happens when there are no 
dimensions).
   
   **Changes:**
   - Removed the restrictive `comparison_type === "Values"` check in 
`isDerivedSeries.ts`
   - Added exact match handling in `timeOffset.ts` for dimension-less charts
   - Updated tests to reflect new behavior
   
   ### BEFORE/AFTER
   
   **BEFORE**
   <img width="848" height="493" alt="image" 
src="https://github.com/user-attachments/assets/ede17d65-3f65-4140-adf9-689351702c65";
 />
   
   
   **AFTER **
   
   <img width="830" height="693" alt="image" 
src="https://github.com/user-attachments/assets/05de1656-c8cf-47fc-8194-a25f81ea59b5";
 />
   
   
   ### TESTING INSTRUCTIONS
   1. Create a new Line Chart
   2. Select a dataset with a time column (e.g., `birth_names` with `ds`)
   3. Add a metric (e.g., `COUNT(*)`)
   4. Set Time Range to a valid range (e.g., `2005-01-01 to 2008-12-31`)
   5. In Advanced Analytics, add Time Comparison: `1 year ago`
   6. **Do NOT add any dimensions** (leave Dimensions empty)
   7. Click "Update Chart"
   8. Verify the offset metric line (`1 year ago`) appears **dashed**, not solid
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #36806
   - [ ] Required feature flags: None
   - [x] Changes UI
   - [ ] Includes DB Migration
     - [ ] 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