aminghadersohi opened a new pull request, #40307:
URL: https://github.com/apache/superset/pull/40307
### SUMMARY
Adds a `series_limit` parameter to `XYChartConfig` in the `generate_chart`
MCP tool.
When `group_by` is set on an XY chart (line, bar, area, scatter), users can
now control the maximum number of distinct series rendered by specifying
`series_limit`. The value is forwarded as `form_data["series_limit"]`, which
Superset's echarts timeseries plugins use to cap the number of rendered series
lines/bars.
**Usage example:**
```json
{
"dataset_id": 123,
"config": {
"chart_type": "xy",
"x": {"name": "order_date"},
"y": [{"name": "revenue", "aggregate": "SUM"}],
"group_by": [{"name": "region"}],
"kind": "line",
"series_limit": 10
}
}
```
When `series_limit` is not set (default `None`), the field is omitted from
form_data and Superset applies no series cap.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend schema change only.
### TESTING INSTRUCTIONS
1. Call `generate_chart` with an XY config that includes `group_by` and
`series_limit: 5`
2. Verify the returned `form_data` contains `"series_limit": 5`
3. Open the explore URL — the chart should show at most 5 series
4. Call without `series_limit` — verify `form_data` does not contain
`series_limit`
### 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]