You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2026/05/02 02:57:40 UTC
Re: [D] How to add a new chart type in superset version 4.1.1? [superset]
GitHub user dosubot[bot] edited a comment on the discussion: How to add a new chart type in superset version 4.1.1?
<!-- Answer -->
To add a new chart type (visualization plugin) in Superset 4.1.1, the recommended workflow is:
1. **Scaffold your plugin**: Use the Yeoman generator (`@superset-ui/generator-superset`) to create a new visualization plugin as a standalone TypeScript/JavaScript package. This sets up all necessary files for your chart, including code, control panel, query logic, and tests. See the [how-to guide](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docs/docs/contributing/howtos.mdx) and [generator README](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/generator-superset/README.md).
2. **Build and install**: Build your plugin (`npm run build`), then install it into Superset’s `superset-frontend` directory (`npm i -S /path/to/your/plugin`).
3. **Register the plugin**: Import your chart plugin in `superset-frontend/src/visualizations/presets/MainPreset.js` and add it to the `plugins` array, e.g.:
```js
import { SupersetPluginChartHelloWorld } from 'superset-plugin-chart-hello-world';
...
new SupersetPluginChartHelloWorld().configure({ key: 'ext-hello-world' }),
```
[See example in MainPreset.js](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/visualizations/presets/MainPreset.js).
4. **Feature flags**: If your chart is experimental, you can conditionally include it based on the `CHART_PLUGINS_EXPERIMENTAL` feature flag. Enable this by adding `FEATURE_FLAGS = {"CHART_PLUGINS_EXPERIMENTAL": True}` to your config or setting the environment variable `SUPERSET_FEATURE_CHART_PLUGINS_EXPERIMENTAL=True` ([details](https://github.com/apache/superset/discussions/31426)).
5. **Backend changes**: For most modern plugins, backend (Python) changes are not needed. If you require custom server-side data processing, subclass `BaseViz` in `superset/viz.py` and assign a unique `viz_type` ([reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/viz.py)). Otherwise, focus on frontend development.
For more resources and community guides, check out the [Superset Community Resource Library](https://github.com/apache/superset/wiki/Community-Resource-Library#creating-custom-data-visualizations).
Let me know if you need more details on any step!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=da85870e-cd4a-4744-a51c-f8e189f0612d) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34817#discussioncomment-14188249
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org