GitHub user dosubot[bot] added a comment to the discussion: Questions about 
mixed chart.

<!-- Greeting -->
Hi @julihermes! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.

<!-- Answer -->
The Mixed Chart in Superset is [limited to exactly 2 queries (Query A and Query 
B)](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts#L44-L93)
 - this is a hardcoded architectural constraint and cannot be extended.

Additionally, [both queries must use the same 
datasource](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts#L128).
 You cannot select different datasets for each query.

**Workaround for multiple datasets**: If you need to combine data from multiple 
sources, the recommended approach is to [create a database view that joins or 
unions the necessary 
tables](https://github.com/apache/superset/discussions/32495#discussioncomment-12385933),
 then use that view as your single datasource for the mixed chart.

Within the 2-query limit, you can customize each query independently with 
different metrics, series types (line, bar, scatter), Y-axis assignments 
(primary/secondary), stacking, and styling options.


<!-- 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/cd8082df-5eb7-497d-bb8a-8495f0f4fd26?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/cd8082df-5eb7-497d-bb8a-8495f0f4fd26?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/cd8082df-5eb7-497d-bb8a-8495f0f4fd26?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/cd8082df-5eb7-497d-bb8a-8495f0f4fd26?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/cd8082df-5eb7-497d-bb8a-8495f0f4fd26?feedback_type=hallucination)
 | [Report 
šŸ›](https://app.dosu.dev/response-feedback/cd8082df-5eb7-497d-bb8a-8495f0f4fd26?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/cd8082df-5eb7-497d-bb8a-8495f0f4fd26?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20Mixed%20Chart%20in%20Superset%20is%20%5Blimited%20to%20exactly%202%20queries%20%28Query%20A%20and%20Query%20B%29%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts%23L44-L93%29%20-%20this%20is%20a%20hardcoded%20architectural%20constraint%20and%20cannot%20be%20extended.%0A%0AAdditionally%2C%20%5Bboth%20queries%20must%20use%20the%20same%20datasource%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts%23L128%29.%20You%20cannot%20select%20different%20datasets%20for%20each%20query.%0A%0A%2A%2AWorkaround%20for%20mult
 
iple%20datasets%2A%2A%3A%20If%20you%20need%20to%20combine%20data%20from%20multiple%20sources%2C%20the%20recommended%20approach%20is%20to%20%5Bcreate%20a%20database%20view%20that%20joins%20or%20unions%20the%20necessary%20tables%5D%28https%3A//github.com/apache/superset/discussions/32495%23discussioncomment-12385933%29%2C%20then%20use%20that%20view%20as%20your%20single%20datasource%20for%20the%20mixed%20chart.%0A%0AWithin%20the%202-query%20limit%2C%20you%20can%20customize%20each%20query%20independently%20with%20different%20metrics%2C%20series%20types%20%28line%2C%20bar%2C%20scatter%29%2C%20Y-axis%20assignments%20%28primary/secondary%29%2C%20stacking%2C%20and%20styling%20options.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com
 /apache/superset/discussions/38220)

GitHub link: 
https://github.com/apache/superset/discussions/38220#discussioncomment-15911830

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to