Data Visualization
创建垂直温度计样式图表,完美适用于筹款目标、项目进度和目标达成可视化
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/thermometer-chart' \
-H 'Content-Type: application/json' \
-d '{"thermometerData":"JSON format:\n[{"label": "Fundraising Goal", "current": 75000, "target": 100000},\n{"label": "Project Progress", "current": 85, "target": 100}]\n\nor text format:\nFundraising Goal:75000:100000\nProject Progress:85:100\n\nor just current values:\n75000\n85\n1200","chartTitle":"输入图表标题...","thermometerWidth":"60","thermometerHeight":"300","mercuryColor":"#ef4444","tubeColor":"#e5e7eb","animationDuration":"1500","scaleStyle":"none","backgroundColor":"#ffffff","showPercentage":true,"showTarget":true,"showCurrentValue":true,"showScale":true,"animated":true}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/thermometer-chart| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| thermometerData | textarea | 是 | 温度计数据,包含当前值和目标值。支持带标签/当前值/目标值的JSON,简单的标签:当前值:目标值格式,或仅当前值 |
| chartTitle | text | 否 | 显示在图表上方的标题 |
| thermometerWidth | number | 否 | 温度计管的像素宽度 |
| thermometerHeight | number | 否 | 温度计的像素高度 |
| mercuryColor | color | 否 | 水银/进度填充的颜色 |
| tubeColor | color | 否 | 温度计管背景的颜色 |
| animationDuration | number | 否 | 水银动画的毫秒时长 |
| scaleStyle | select | 否 | — |
| backgroundColor | color | 否 | 图表容器的背景颜色 |
| showPercentage | checkbox | 否 | 显示每个温度计的百分比值 |
| showTarget | checkbox | 否 | 显示目标值线和标签 |
| showCurrentValue | checkbox | 否 | 在每个温度计上显示当前值 |
| showScale | checkbox | 否 | 在温度计上显示测量刻度 |
| animated | checkbox | 否 | 加载时动画显示水银 |
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-thermometer-chart": {
"name": "thermometer-chart",
"description": "创建垂直温度计样式图表,完美适用于筹款目标、项目进度和目标达成可视化",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=thermometer-chart",
"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": "thermometer-chart",
"arguments": {
"thermometerData": "JSON format:\n[{"label": "Fundraising Goal", "current": 75000, "target": 100000},\n{"label": "Project Progress", "current": 85, "target": 100}]\n\nor text format:\nFundraising Goal:75000:100000\nProject Progress:85:100\n\nor just current values:\n75000\n85\n1200",
"chartTitle": "输入图表标题...",
"thermometerWidth": "60",
"thermometerHeight": "300",
"mercuryColor": "#ef4444",
"tubeColor": "#e5e7eb",
"animationDuration": "1500",
"scaleStyle": "none",
"backgroundColor": "#ffffff",
"showPercentage": true,
"showTarget": true,
"showCurrentValue": true,
"showScale": true,
"animated": true
}
}
}有问题或反馈?请联系 [email protected]