Sheet kit command
drawing.chart
Change Chart
Changes a chart drawing object: its kind, title, legend, data labels, gridlines, axis titles and series, and each series' format (seriesFormat).
- Kit
- Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb))
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
categories | any | no | read by the command beside its listed parameters |
dataLabelPosition | string | no | read by the command beside its listed parameters |
dataLabels | any | no | |
gridlines | any | no | |
id | integer | string | no | |
ids | any[] | no | read by the command beside its listed parameters |
kind | string | no | a chart kind such as column, bar, line, pie |
legend | "top" | "bottom" | "left" | "right" | null | no | |
series | object[] | no | [{name, values, color?}] (colours only: the data are the cells); colours only: the data are the cells |
seriesFormat | any[] | no | per series, by index from 0: {index, kind?: column|stackedColumn|bar|line|lineMarkers|area|scatter (a series of another type than the chart's makes it a combination; null: the chart's), secondary?: bool (the second value axis), color?: "#RRGGBB", lineWidth?: points, marker?: none|circle|square|diamond|triangle|x|star|dash|dot|plus, smooth?: bool, trendline?: linear|exp|log|poly|power|movingAvg or {kind, order?, period?, forward?, backward?}|null, errorBars?: {kind: fixedVal|percentage|stdDev|stdErr, value?}|null} |
title | string | null | no | |
xAxis | any | no | read by the command beside its listed parameters |
xTitle | string | no | |
yAxis | any | no | read by the command beside its listed parameters |
yTitle | string | no |
Call through sheet_run
text
sheet_run {
"path": "<file>.xlsx",
"steps": [{ "command": "drawing.chart" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: categories, dataLabelPosition, dataLabels, gridlines, id, ids, kind, legend, series, seriesFormat, title, xAxis, xTitle, yAxis, yTitle. sheet_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
json
{
"additionalProperties": false,
"properties": {
"categories": {
"description": "read by the command beside its listed parameters"
},
"dataLabelPosition": {
"description": "read by the command beside its listed parameters",
"type": "string"
},
"dataLabels": {},
"gridlines": {},
"id": {
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-khp-types": [
"Chart"
]
},
"ids": {
"description": "read by the command beside its listed parameters",
"type": "array",
"x-khp-types": [
"Chart"
]
},
"kind": {
"description": "a chart kind such as column, bar, line, pie",
"type": "string"
},
"legend": {
"oneOf": [
{
"enum": [
"top",
"bottom",
"left",
"right"
],
"type": "string"
},
{
"type": "null"
}
]
},
"series": {
"description": "[{name, values, color?}] (colours only: the data are the cells); colours only: the data are the cells",
"items": {
"additionalProperties": true,
"properties": {
"color": {
"type": "string"
},
"name": {
"type": "string"
},
"values": {}
},
"type": "object"
},
"type": "array"
},
"seriesFormat": {
"description": "per series, by index from 0: {index, kind?: column|stackedColumn|bar|line|lineMarkers|area|scatter (a series of another type than the chart's makes it a combination; null: the chart's), secondary?: bool (the second value axis), color?: \"#RRGGBB\", lineWidth?: points, marker?: none|circle|square|diamond|triangle|x|star|dash|dot|plus, smooth?: bool, trendline?: linear|exp|log|poly|power|movingAvg or {kind, order?, period?, forward?, backward?}|null, errorBars?: {kind: fixedVal|percentage|stdDev|stdErr, value?}|null}",
"items": {},
"type": "array"
},
"title": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"xAxis": {
"description": "read by the command beside its listed parameters"
},
"xTitle": {
"type": "string"
},
"yAxis": {
"description": "read by the command beside its listed parameters"
},
"yTitle": {
"type": "string"
}
},
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (sheet_commands through @kition/[email protected], built from KitionAI/kition-sheet@82f13b2). As data: commands.jsonl.