---
title: "drawing.chart: Change Chart — Slide kit command — Kition"
description: "Changes a chart drawing object's kind, title, legend, data labels or data."
canonical: "https://developer.kition.ai/docs/kits/slide/commands/drawing.chart"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/slide/commands/drawing.chart](https://developer.kition.ai/docs/kits/slide/commands/drawing.chart)

# drawing.chart

**Change Chart.** Changes a chart drawing object's kind, title, legend, data labels or data.

- Kit: Slide 0.1.0 (.kslide and .pptx); reference: [Slide kit commands](https://developer.kition.ai/docs/kits/slide.md)
- Changes the document: yes
- Acts on: `ids` (a list of ids), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `categories` | `string[]` | no |  |
| `dataLabelPosition` | `any` | no |  |
| `dataLabels` | `boolean` | no |  |
| `gridlines` | `boolean` | no |  |
| `id` | `integer \| string` | no |  |
| `ids` | `(integer \| string)[]` | no | one chart, instead of id |
| `kind` | `string` | no | the chart kind: column, bar, line, pie, … |
| `legend` | `"top" \| "bottom" \| "left" \| "right" \| "topRight" \| null` | no | legend position, null for none |
| `onSlide` | `integer` | no | the slide the ids are on, from 1 |
| `series` | `object[]` | no | [{name, values, color?}] |
| `seriesFormat` | `object[]` | no | [{index, color?, lineWidth?, marker?, smooth?, trendline?, errorBars?}] |
| `title` | `string \| null` | no | chart title, null for none |
| `xAxis` | `object` | no | {min?, max?, major?, numberFormat?, hidden?} |
| `xTitle` | `string \| null` | no | x axis title |
| `yAxis` | `object` | no | {min?, max?, major?, numberFormat?, hidden?} |
| `yTitle` | `string \| null` | no | y axis title |

## Call through slide_run

```text
slide_run {
  "path": "<file>.pptx",
  "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`, `onSlide`, `series`, `seriesFormat`, `title`, `xAxis`, `xTitle`, `yAxis`, `yTitle`. slide_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": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "dataLabelPosition": {},
    "dataLabels": {
      "type": "boolean"
    },
    "gridlines": {
      "type": "boolean"
    },
    "id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-types": [
        "Shape"
      ]
    },
    "ids": {
      "description": "one chart, instead of id",
      "items": {
        "description": "an id",
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "array",
      "x-khp-types": [
        "Shape"
      ]
    },
    "kind": {
      "description": "the chart kind: column, bar, line, pie, …",
      "type": "string"
    },
    "legend": {
      "description": "legend position, null for none",
      "oneOf": [
        {
          "enum": [
            "top",
            "bottom",
            "left",
            "right",
            "topRight"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "onSlide": {
      "description": "the slide the ids are on, from 1",
      "type": "integer"
    },
    "series": {
      "description": "[{name, values, color?}]",
      "items": {
        "additionalProperties": true,
        "properties": {
          "color": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "values": {}
        },
        "type": "object"
      },
      "type": "array"
    },
    "seriesFormat": {
      "description": "[{index, color?, lineWidth?, marker?, smooth?, trendline?, errorBars?}]",
      "items": {
        "additionalProperties": true,
        "properties": {
          "color": {
            "type": "string"
          },
          "errorBars": {},
          "index": {
            "description": "a position counted from 0 (the first is 0)",
            "type": "integer"
          },
          "lineWidth": {},
          "marker": {},
          "smooth": {},
          "trendline": {}
        },
        "type": "object"
      },
      "type": "array"
    },
    "title": {
      "description": "chart title, null for none",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "xAxis": {
      "additionalProperties": true,
      "description": "{min?, max?, major?, numberFormat?, hidden?}",
      "properties": {
        "hidden": {
          "type": "boolean"
        },
        "major": {},
        "max": {},
        "min": {},
        "numberFormat": {}
      },
      "type": "object"
    },
    "xTitle": {
      "description": "x axis title",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "yAxis": {
      "additionalProperties": true,
      "description": "{min?, max?, major?, numberFormat?, hidden?}",
      "properties": {
        "hidden": {
          "type": "boolean"
        },
        "major": {},
        "max": {},
        "min": {},
        "numberFormat": {}
      },
      "type": "object"
    },
    "yTitle": {
      "description": "y axis title",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "x-khp-position": "independent"
}
```

Generated from the command list of @kition/slide-darwin-arm64@0.1.0 and the kit itself (slide_commands through @kition/cli@0.1.1, built from KitionAI/kition-slide@7ef3d11).
