Elysia Tools Docs
ZH
语言
ZHESPTRUFRDEEN
返回主站
浏览工具

Data Visualization

瀑布图生成器

创建瀑布图来可视化累积变化,支持正负值区分和汇总显示

html· HTML 结果打开工具

快速开始

用三种语言从你的代码中调用此工具。

cURL
curl -X POST 'https://api.elysiatools.com/zh/api/tools/waterfall-chart-generator' \
  -H 'Content-Type: application/json' \
  -d '{"chartTitle":"输入图表标题...","dataItems":"JSON format example:\n[{"label": "Starting Value", "value": 1000, "isSubtotal": true},\n{"label": "Revenue", "value": 500},\n{"label": "Costs", "value": -200},\n{"label": "Expenses", "value": -150},\n{"label": "Net Profit", "value": 150, "isSubtotal": true}]","xAxisLabel":"Categories","yAxisLabel":"Values","positiveColor":"#2196F3","negativeColor":"#F44336","totalColor":"#4CAF50","connectingLineColor":"#666666","barWidth":"60","showValues":true,"showTotal":true,"showConnectingLines":true,"valueFormat":"integer","fontSize":"12","titleSize":"18","fontFamily":"Arial","chartWidth":"800","chartHeight":"500","backgroundColor":"#ffffff","gridColor":"#e0e0e0","animationEnabled":true,"animationDuration":"1000"}'

© 2026 Elysia Tools. 开发者文档。

返回主站浏览工具

API 参考

以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。

请求端点

HTTP
POST https://api.elysiatools.com/zh/api/tools/waterfall-chart-generator

请求参数

参数名类型必填说明
chartTitletext否显示在瀑布图上方的标题
dataItemstextarea是JSON数组格式的数据项,包含标签、数值和可选的小计标记
xAxisLabeltext否X轴的标签
yAxisLabeltext否Y轴的标签
positiveColorcolor否正值柱状图的颜色
negativeColorcolor否负值柱状图的颜色
totalColorcolor否小计和总计柱状图的颜色
connectingLineColorcolor否柱状图间连接线的颜色
barWidthnumber否每个柱状图的像素宽度
showValuescheckbox否在柱状图顶部显示数值
showTotalcheckbox否自动添加最终总计柱状图
showConnectingLinescheckbox否显示柱状图间的连接线
valueFormatselect否—
fontSizenumber否标签和数值的字体大小
titleSizenumber否图表标题的字体大小
fontFamilytext否文本元素的字体族
chartWidthnumber否图表的像素宽度
chartHeightnumber否图表的像素高度
backgroundColorcolor否图表的背景颜色
gridColorcolor否网格线的颜色
animationEnabledcheckbox否加载时动画显示图表
animationDurationnumber否动画持续时间(毫秒)

响应格式

HTML 结果

JSON
{
  "result": "<div>Processed HTML content</div>",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}

MCP 集成

将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。

服务配置

将以下内容加入你的 MCP 客户端配置:

mcp.json
{
  "mcpServers": {
    "elysiatools-waterfall-chart-generator": {
      "name": "waterfall-chart-generator",
      "description": "创建瀑布图来可视化累积变化,支持正负值区分和汇总显示",
      "baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=waterfall-chart-generator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

列出可用工具

连接到 SSE 端点后,列出已开放的工具:

tools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

调用此工具

通过工具 id 调用,参数由其参数表构建:

tools/call
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "waterfall-chart-generator",
    "arguments": {
  "chartTitle": "输入图表标题...",
  "dataItems": "JSON format example:\n[{&quot;label&quot;: &quot;Starting Value&quot;, &quot;value&quot;: 1000, &quot;isSubtotal&quot;: true},\n{&quot;label&quot;: &quot;Revenue&quot;, &quot;value&quot;: 500},\n{&quot;label&quot;: &quot;Costs&quot;, &quot;value&quot;: -200},\n{&quot;label&quot;: &quot;Expenses&quot;, &quot;value&quot;: -150},\n{&quot;label&quot;: &quot;Net Profit&quot;, &quot;value&quot;: 150, &quot;isSubtotal&quot;: true}]",
  "xAxisLabel": "Categories",
  "yAxisLabel": "Values",
  "positiveColor": "#2196F3",
  "negativeColor": "#F44336",
  "totalColor": "#4CAF50",
  "connectingLineColor": "#666666",
  "barWidth": "60",
  "showValues": true,
  "showTotal": true,
  "showConnectingLines": true,
  "valueFormat": "integer",
  "fontSize": "12",
  "titleSize": "18",
  "fontFamily": "Arial",
  "chartWidth": "800",
  "chartHeight": "500",
  "backgroundColor": "#ffffff",
  "gridColor": "#e0e0e0",
  "animationEnabled": true,
  "animationDuration": "1000"
}
  }
}
可用逗号分隔的 toolId 在一个会话中串联多个工具,例如 /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp(最多 20 个)。

有问题或反馈?请联系 [email protected]

浏览工具
打开工具