create_visualization
Creates a chart or counter on a saved Redash query and returns its ID, so the visualization can be placed on a dashboard.
Instructions
Create a chart (line, column, area, pie, scatter) or counter on a saved query, so it can be shown in Redash and placed on a dashboard. Behavior: creates the visualization and returns its id. Usage: save the SQL with create_query first; column names must exactly match the query's result columns (run get_query_result to see them). Then call add_widget with the returned id to put the chart on a dashboard.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Display name for the chart | |
| type | Yes | Chart type: line, column (bar), area, pie, scatter, or counter (a single big number) | |
| stacked | No | Stack the series (column/area charts) | |
| query_id | Yes | ID of the saved query to chart (from create_query/list_queries) | |
| x_column | No | Result column for the X axis (pie: slice labels). Not used for counter | |
| y_columns | Yes | Result column(s) for the values. Counter uses the first column of the first row | |
| horizontal | No | Swap axes for horizontal bars | |
| series_column | No | Optional column that splits rows into separate series/lines (e.g. model_name) |