Google Sheets

GOOGLESHEETS_CREATE_CHART

Create a chart in a Google Sheets spreadsheet using the specified data range and chart type. Conditional requirements: - Provide either a simple chart via chart_type + data_range (basicChart), OR supply a full chart_spec supporting all chart types. Exactly one approach should be used. - When using chart_spec, set exactly one of the union fields (basicChart | pieChart | bubbleChart | candlestickChart | histogramChart | waterfallChart | treemapChart | orgChart | scorecardChart).

Remote googlesheets

Other tools also called GOOGLESHEETS_CREATE_CHART? See providers with this name

Input Schema


            {
  "type": "object",
  "properties": {
    "title": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Optional title for the chart.\nExamples:\n  \"Sales Data\"\n  \"Monthly Revenue\""
    },
    "sheet_id": {
      "type": "integer",
      "description": "The sheetId of the worksheet where the chart will be created. This is a unique non-zero integer identifier. Use 'Get Sheet Names' or 'Get Spreadsheet Info' actions to retrieve the sheetId for your target worksheet.\nExamples:\n  123456789\n  987654321"
    },
    "subtitle": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Optional subtitle for the chart.\nExamples:\n  \"Q1 2024\"\n  \"Year over Year\""
    },
    "chart_spec": {
      "anyOf": [
        {
          "type": "object",
          "properties": {},
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional full ChartSpec object to send to the Google Sheets API. Use this to support ALL chart types and advanced options. Must set exactly one of: basicChart, pieChart, bubbleChart, candlestickChart, histogramChart, treemapChart, waterfallChart, orgChart, scorecardChart. See https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/charts#ChartSpec.\nExample: {\"pieChart\":{\"domain\":{\"sourceRange\":{\"sources\":[{\"endColumnIndex\":1,\"endRowIndex\":5,\"sheetId\":0,\"startColumnIndex\":0,\"startRowIndex\":0}]}},\"legendPosition\":\"RIGHT_LEGEND\",\"series\":{\"sourceRange\":{\"sources\":[{\"endColumnIndex\":2,\"endRowIndex\":5,\"sheetId\":0,\"startColumnIndex\":1,\"startRowIndex\":0}]}}}}"
    },
    "chart_type": {
      "type": "string",
      "description": "The type of chart to create. Supported types: BAR, LINE, AREA, COLUMN, SCATTER, COMBO, STEPPED_AREA (basic charts), PIE, BUBBLE, CANDLESTICK, HISTOGRAM, TREEMAP, WATERFALL, ORG, SCORECARD. If you need full control over the chart specification (including fields not covered by simple inputs), provide chart_spec instead.\nExamples:\n  \"COLUMN\"\n  \"LINE\"\n  \"BAR\"\n  \"AREA\"\n  \"PIE\"\n  \"HISTOGRAM\"\n  \"WATERFALL\""
    },
    "data_range": {
      "type": "string",
      "description": "A single contiguous range of data for the chart in A1 notation (e.g., 'A1:C10' or 'Sheet1!B2:D20'). Must be a single continuous range - comma-separated multi-ranges (e.g., 'A1:A10,C1:C10') are not supported. When chart_spec is not provided, the first column is used as the domain/labels and the remaining columns as series.\nExamples:\n  \"A1:C10\"\n  \"Sheet1!B2:D20\"\n  \"Data!A1:E50\""
    },
    "x_axis_title": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Optional title for the X-axis.\nExamples:\n  \"Time Period\"\n  \"Categories\""
    },
    "y_axis_title": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "Optional title for the Y-axis.\nExamples:\n  \"Revenue ($)\"\n  \"Count\""
    },
    "background_red": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "Red component of chart background color (0.0-1.0). If not specified, uses default.\nExamples:\n  0\n  0.5\n  1"
    },
    "spreadsheet_id": {
      "type": "string",
      "description": "The unique identifier of the Google Sheets spreadsheet where the chart will be created.\nExample: \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\""
    },
    "background_blue": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "Blue component of chart background color (0.0-1.0). If not specified, uses default.\nExamples:\n  0\n  0.5\n  1"
    },
    "legend_position": {
      "type": "string",
      "default": "BOTTOM_LEGEND",
      "description": "Position of the chart legend. Options: BOTTOM_LEGEND, TOP_LEGEND, LEFT_LEGEND, RIGHT_LEGEND, NO_LEGEND.\nExamples:\n  \"BOTTOM_LEGEND\"\n  \"RIGHT_LEGEND\"\n  \"NO_LEGEND\""
    },
    "background_green": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "Green component of chart background color (0.0-1.0). If not specified, uses default.\nExamples:\n  0\n  0.5\n  1"
    }
  }
}