aminghadersohi opened a new pull request, #37188:
URL: https://github.com/apache/superset/pull/37188
### SUMMARY
Add `stacked` field to XYChartConfig schema in the MCP service that enables
stacking bars/areas on top of each other instead of displaying them
side-by-side.
**Changes:**
- Added `stacked: bool` field to `XYChartConfig` in `schemas.py` (default:
`False`)
- Updated `map_xy_config()` in `chart_utils.py` to set `form_data["stack"] =
"Stack"` when `stacked=True`
This allows LLM clients using the MCP service to create stacked bar and area
charts by simply setting `stacked: true` in the chart configuration.
**Example usage:**
```json
{
"dataset_id": 123,
"config": {
"chart_type": "xy",
"x": {"name": "month"},
"y": [{"name": "revenue", "aggregate": "SUM"}],
"group_by": {"name": "product_line"},
"kind": "bar",
"stacked": true
}
}
```
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - This is a schema/API enhancement, no UI changes.
### TESTING INSTRUCTIONS
1. Start the MCP service
2. Use `generate_chart` or `update_chart` tool with `stacked: true` in the
XY chart config
3. Verify the resulting chart displays bars/areas stacked instead of
side-by-side
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [x] 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]