files_add_chart
Adds a native (Excel-style) chart that visualizes data from an A1 cell range — no Python. Native charts stay live as the referenced cells change and are editable in the Chart Editor. The chart floats over the grid anchored at a cell; it does not occupy cells. data_range is a rectangular A1 range (default: first row = series headers, first column = category labels, other columns = series). When position is null the chart is auto-placed two columns right of the data; when a position is given and it would overlap another chart or non-empty cells, the chart is moved down to free space and the result reports the final position. Requires edit permission. Signature: files_add_chart(file_uuid, chart_type, data_range, sheet?, chart_name?, title?, position?, width_cells?, height_cells?, transpose?, first_row_headers?, first_col_labels?, x_column?).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_uuid": "<file_uuid>",
"chart_type": "<chart_type>",
"data_range": "<data_range>"
},
"name": "files_add_chart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet | No | Sheet name (defaults to the first sheet). | |
| title | No | Chart title. Null = none. | |
| position | No | Top-left anchor cell in A1, e.g. 'E1'. Null = auto-place. | |
| x_column | No | 0-based category (X) column index within the range. Null = first. | |
| file_uuid | Yes | ||
| transpose | No | Swap rows/columns. Null = false. | |
| chart_name | No | Display name (unique on the sheet; must not look like a cell reference). Null = auto 'Диаграмма N'. | |
| chart_type | Yes | Chart type, e.g. 'bar', 'line', 'pie', 'scatter', 'area', 'bar-stacked', 'histogram', 'radar', 'bubble', 'bar-3d', 'pie-3d'. | |
| data_range | Yes | Rectangular A1 data range, e.g. 'A1:C10'. | |
| data_labels | No | Show value labels on the marks. Null = off. | |
| width_cells | No | Chart width in columns (min 2). Null = default. | |
| height_cells | No | Chart height in rows (min 4). Null = default. | |
| series_marks | No | Combo only: mark of each series ('bar' | 'line' | 'area' | 'point'). Null = first series bars, the rest lines. | |
| trend_series | No | Canonical column indexes of series with a linear trendline; empty array = all series. Null = none. | |
| first_col_labels | No | First column = category labels. Null = true. | |
| secondary_series | No | Canonical column indexes of series drawn against the right-hand axis. Null = all on the left. | |
| data_label_points | No | Which points get labels: first | last | first-last | min-max. Null = all. | |
| data_label_series | No | Canonical column indexes of series with value labels (needs data_labels). Null = all series. | |
| first_row_headers | No | First row = series headers. Null = true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| moved | Yes | ||
| chart_id | Yes | ||
| position | Yes | ||
| file_uuid | Yes | ||
| sequence_number | Yes |