You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2026/03/26 01:10:25 UTC

[PR] fix(echart): multiple time shift line pattern [superset]

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

   ### SUMMARY
   
   fixes #38639
   
   When using multiple time comparison offsets (e.g. 1 year ago, 2 years ago) in the Timeseries chart, all comparison series were assigned visually similar dash patterns, making them hard to distinguish. This fix ensures each time-shifted series gets a unique combination of dash pattern and marker symbol.
   
     Changes:
     - Replaced the old numeric [dash, gap] pattern generation with a curated visibleDashPatterns array ('dashed', 'dotted', [6, 15], [2, 10], [20, 3])
     that are visually distinct from each other
     - Added visibleSymbols (rect, triangle, diamond, roundRect, pin) so each time-shifted series also gets a unique data point marker, providing a second
     visual differentiator beyond color
     - Dash pattern and symbol assignment now only applies when timeShiftColor is enabled (previously applied unconditionally to any derivedSeries)
     - Fixed tooltip markers to render the correct symbol shape per series (instead of always rendering a circle) using a new getSymbolMarker() helper
     - Added color field to ForecastValue type to pass series color into the tooltip renderer
     - Updated existing tests to include timeShiftColor: true and reflect the new pattern expectations; added a new test verifying that multiple offsets receive distinct patterns and symbols
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before:
   
   <img width="732" height="904" alt="Image" src="https://github.com/user-attachments/assets/c6894e9f-a63c-41e4-9cb8-ba0c667cfbca" />
   
   After:
   
   <img width="1019" height="895" alt="Screenshot 2026-03-25 at 5 03 07 PM" src="https://github.com/user-attachments/assets/e0cf8caf-d997-4bdf-a726-9f5bd04a40da" />
   
   
   ### TESTING INSTRUCTIONS
   
   1. Create a line chart
   2. Set multiple time shift (i.e. 1 year ago, 2 year ago, 3 year ago)
   3. Each time shift line is represented with the same color and dashed style, making it difficult to distinguish between them.
   
   
   ### 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:
   - [ ] 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(echart): multiple time shift line pattern [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #38866:
URL: https://github.com/apache/superset/pull/38866#issuecomment-4130865032

   ## **Sequence Diagram**
   
   This PR updates the timeseries chart transform so each time shifted series receives a distinct dash pattern and symbol when timeShiftColor is enabled, and ensures tooltip markers use the same symbol and color as the rendered series.
   
   ```mermaid
   sequenceDiagram
       participant Client
       participant TimeseriesChart
       participant ChartTransform
       participant Tooltip
   
       Client->>TimeseriesChart: Request timeseries with multiple time offsets
       TimeseriesChart->>ChartTransform: Transform props into chart options
       ChartTransform->>ChartTransform: Assign distinct dash pattern and symbol per time shift
       ChartTransform-->>TimeseriesChart: Return series with patterns and symbols
       TimeseriesChart-->>Client: Render chart with unique styled lines
   
       TimeseriesChart->>Tooltip: On hover send series params with color
       Tooltip->>ChartTransform: Build forecast tooltip values with color
       ChartTransform-->>Tooltip: Return tooltip entries with matching symbol markers
   ```
   
   ---
   *Generated by [CodeAnt AI](https://codeant.ai)*
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(echart): multiple time shift line pattern [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #38866:
URL: https://github.com/apache/superset/pull/38866


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(echart): multiple time shift line pattern [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38866:
URL: https://github.com/apache/superset/pull/38866#issuecomment-4130854451

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(echart): multiple time shift line pattern [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #38866:
URL: https://github.com/apache/superset/pull/38866#discussion_r2991952140


##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/forecast.ts:
##########
@@ -69,6 +69,7 @@ export const extractForecastValuesFromTooltipParams = (
           marker: marker || '',
         };
       const forecastValues = values[context.name];
+      forecastValues.color = color;
       if (context.type === ForecastSeriesEnum.Observation)

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Unnecessary undefined property assignment</b></div>
   <div id="fix">
   
   The assignment of `color` occurs unconditionally, even when `color` is undefined from the destructuring. This adds an unnecessary `color: undefined` property to the `forecastValues` object, which could affect object equality checks or serialization. Consider adding a check like `if (color !== undefined) forecastValues.color = color;` to only set the property when a valid color is present.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
         const forecastValues = values[context.name];
         if (color !== undefined) forecastValues.color = color;
         if (context.type === ForecastSeriesEnum.Observation)
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #fedcdb</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(echart): multiple time shift line pattern [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #38866:
URL: https://github.com/apache/superset/pull/38866#issuecomment-4130868047

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 00349a371fe64b404fd83749d4fc41eaa7158f87 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69c48782efe4b3000942090c |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-38866--superset-docs-preview.netlify.app](https://deploy-preview-38866--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTM4ODY2LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.Vfp4NwD7QCQL3nQ0ip6NwnFWu2-AfQb9IH-ooIL7tow)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-38866--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org