分类

XLSX 图表嵌入器

从工作簿数据区域生成柱状图/饼图图片并嵌入 Excel 工作表

当前实现为 Canvas 生成图表图片并嵌入工作簿,适合稳定导出型报表。

示例结果

1 个示例

嵌入柱状图和饼图图片

从工作表范围读取数据生成两类图表并嵌入到 Excel 中

xlsx-chart-embedder-example1.xlsx 查看文件
查看输入参数
{ "workbookFile": "/public/samples/xlsx/xlsx-chart-embedder-example1.xlsx", "chartsJson": "[\n {\n \"sheetName\": \"Charts\",\n \"chartType\": \"bar\",\n \"title\": \"Monthly Revenue\",\n \"categoriesRange\": \"Data!A2:A7\",\n \"valuesRange\": \"Data!B2:B7\",\n \"anchorCell\": \"B2\",\n \"widthPx\": 520,\n \"heightPx\": 320\n },\n {\n \"sheetName\": \"Charts\",\n \"chartType\": \"pie\",\n \"title\": \"Orders Share\",\n \"categoriesRange\": \"Data!A2:A7\",\n \"valuesRange\": \"Data!C2:C7\",\n \"anchorCell\": \"B22\",\n \"widthPx\": 520,\n \"heightPx\": 320\n }\n]" }

Click to upload file or drag and drop file here

Maximum file size: 20MB Supported formats: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel

API 文档

请求端点

POST /zh/api/tools/xlsx-chart-embedder

请求参数

参数名 类型 必填 描述
workbookFile file (需要先上传) -
chartsJson textarea -

文件类型参数需要先通过 POST /upload/xlsx-chart-embedder 上传获取 filePath,然后将 filePath 传递给对应的文件字段。

响应格式

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
文件: 文件

AI MCP 文档

将此工具添加到您的 MCP 服务器配置中:

{
  "mcpServers": {
    "elysiatools-xlsx-chart-embedder": {
      "name": "xlsx-chart-embedder",
      "description": "从工作簿数据区域生成柱状图/饼图图片并嵌入 Excel 工作表",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=xlsx-chart-embedder",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。

支持 URL 文件链接或 Base64 编码作为文件参数。

如果遇见问题,请联系我们:[email protected]