dosubot[bot] commented on issue #34143: URL: https://github.com/apache/superset/issues/34143#issuecomment-3137582400
<!-- Answer --> To implement time comparison (dotted/dashed) line styling in the mixed chart, you'll want to adapt the logic from the classic line chart's `transformProps.ts` file: - In the classic line chart, the relevant code is in `superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts`. Here, each series is checked with the `isDerivedSeries` utility, and if it's a time comparison (derived) series, a `lineStyle.type` (dash/dot pattern) and opacity are set before passing to `transformSeries` for rendering. See the loop over `rawSeries` for the exact implementation and how `lineStyle` is constructed and passed in the options to `transformSeries` ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts)). - In the mixed chart, the file to update is `superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts`. The loops over `rawSeriesA` and `rawSeriesB` currently do not check for derived series or assign a special `lineStyle` ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts)). You can add similar logic as in the line chart: use `isDerivedSeries` (imported from `superset-ui-chart-controls/src/operators/utils/isDerivedSeries.ts`) to detect time comparison series, then set a `lineStyle.type` (e.g., dash/dot array) and pass it to `transformSeries`. The utilities you need (`isDerivedSeries` and `transformSeries`) are already available and used in both chart types. After making the change, test by creating a mixed chart with time comparison enabled and verify that the derived lines appear dashed/dotted as expected. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/9e0dc69b-0054-4b5d-a497-b853392a9947?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9e0dc69b-0054-4b5d-a497-b853392a9947?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9e0dc69b-0054-4b5d-a497-b853392a9947?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9e0dc69b-0054-4b5d-a497-b853392a9947?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9e0dc69b-0054-4b5d-a497-b853392a9947?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9e0dc69b-0054-4b5d-a497-b853392a9947?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9e0dc69b-0054-4b5d-a497-b853392a9947?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34143) -- 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]
