Sheet kit command

chart.set

Chart Properties

Changes a chart's properties in one call: type, title, legend, data labels, gridlines, style, axis titles, position and size, and a waterfall's totals.

Kit
Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb))
Changes the document
yes
Acts on
chart (one id), which a run step’s on fills

Parameters

Parameters of chart.set
NameTypeRequiredDescription
atstringnothe top-left cell in A1 notation such as C3
chartinteger | stringno
dataLabelsanyno
dxnumberno
dynumberno
gridlinesanyno
heightnumberno
legend"none" | "bottom" | "top" | "left" | "right"no
styleintegernoa chart style number, clamped to 1 through 16
titlestringno
totalsinteger[]noa waterfall's points (by index from 0) set as totals; [] sets none
typestringnoa chart type such as column, bar, line, pie
widthnumberno
xTitlestringno
yTitlestringno

Call through sheet_run

text
sheet_run {
  "path": "<file>.xlsx",
  "steps": [{ "command": "chart.set" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: at, chart, dataLabels, dx, dy, gridlines, height, legend, style, title, totals, type, width, xTitle, 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": {
    "at": {
      "description": "the top-left cell in A1 notation such as C3",
      "type": "string"
    },
    "chart": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-types": [
        "Chart"
      ]
    },
    "dataLabels": {},
    "dx": {
      "type": "number"
    },
    "dy": {
      "type": "number"
    },
    "gridlines": {},
    "height": {
      "type": "number"
    },
    "legend": {
      "enum": [
        "none",
        "bottom",
        "top",
        "left",
        "right"
      ],
      "type": "string"
    },
    "style": {
      "description": "a chart style number, clamped to 1 through 16",
      "type": "integer"
    },
    "title": {
      "type": "string"
    },
    "totals": {
      "description": "a waterfall's points (by index from 0) set as totals; [] sets none",
      "items": {
        "type": "integer"
      },
      "type": "array"
    },
    "type": {
      "description": "a chart type such as column, bar, line, pie",
      "type": "string"
    },
    "width": {
      "type": "number"
    },
    "xTitle": {
      "type": "string"
    },
    "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.