Data Visualization
生成美观的主题河流图,支持时间序列数据、流动动画和基线变化
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/stream-graph-generator' \
-H 'Content-Type: application/json' \
-d '{"chartData":"JSON format:\n[\n {"name": "Product A", "values": [30, 45, 35, 50, 40, 35, 45, 55]},\n {"name": "Product B", "values": [20, 25, 30, 25, 35, 30, 25, 30]},\n {"name": "Product C", "values": [15, 20, 25, 20, 15, 25, 20, 15]}\n]\n\nor text format:\nProduct A:30,45,35,50,40,35,45,55\nProduct B:20,25,30,25,35,30,25,30\nProduct C:15,20,25,20,15,25,20,15","chartTitle":"Stream Graph","timeLabels":"1月,2月,3月,4月,5月,6月,7月,8月","colorScheme":"default","baselineType":"zero","chartWidth":"800","chartHeight":"400","showGrid":false,"showLabels":true,"backgroundColor":"#ffffff"}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/stream-graph-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartData | textarea | 是 | 主题河流图的时间序列数据。支持JSON数组或简单的名称:值列表格式 |
| chartTitle | text | 否 | 显示在图表上方的标题 |
| timeLabels | text | 否 | 时间段的时间标签,逗号分隔(可选) |
| colorScheme | select | 否 | — |
| baselineType | select | 否 | 计算基线的算法 |
| chartWidth | number | 否 | 图表宽度(像素) |
| chartHeight | number | 否 | 图表高度(像素) |
| showGrid | checkbox | 否 | 显示背景网格线 |
| showLabels | checkbox | 否 | 在图表上显示系列名称 |
| backgroundColor | text | 否 | 图表容器的背景颜色 |
HTML 结果
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-stream-graph-generator": {
"name": "stream-graph-generator",
"description": "生成美观的主题河流图,支持时间序列数据、流动动画和基线变化",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=stream-graph-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "stream-graph-generator",
"arguments": {
"chartData": "JSON format:\n[\n {"name": "Product A", "values": [30, 45, 35, 50, 40, 35, 45, 55]},\n {"name": "Product B", "values": [20, 25, 30, 25, 35, 30, 25, 30]},\n {"name": "Product C", "values": [15, 20, 25, 20, 15, 25, 20, 15]}\n]\n\nor text format:\nProduct A:30,45,35,50,40,35,45,55\nProduct B:20,25,30,25,35,30,25,30\nProduct C:15,20,25,20,15,25,20,15",
"chartTitle": "Stream Graph",
"timeLabels": "1月,2月,3月,4月,5月,6月,7月,8月",
"colorScheme": "default",
"baselineType": "zero",
"chartWidth": "800",
"chartHeight": "400",
"showGrid": false,
"showLabels": true,
"backgroundColor": "#ffffff"
}
}
}有问题或反馈?请联系 [email protected]