Data Visualization
生成美丽的南丁格尔玫瑰图(鸡冠花图)来通过角度和面积可视化数据,非常适合比较分析和历史数据展示
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/rose-chart' \
-H 'Content-Type: application/json' \
-d '{"chartData":"JSON format:\n[{"label": "January", "value": 65, "description": "Winter month"},\n{"label": "February", "value": 59, "description": "Winter month"},\n{"label": "March", "value": 80, "description": "Spring month"},\n{"label": "April", "value": 81, "description": "Spring month"}]","chartTitle":"输入图表标题...","colorScheme":"nightingale","customColors":"["#FF6B6B", "#4ECDC4", "#45B7D1", "#96CEB4"]","valueFormat":"number","chartSize":"500","startAngle":"0","innerRadius":"30","segmentSpacing":"2","backgroundColor":"#ffffff","showValues":true,"showLabels":true,"showGrid":true,"showAnimation":true,"showPercentage":false,"showTotal":true,"enableTooltip":true}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/rose-chart| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartData | textarea | 是 | 玫瑰图的JSON格式数据,包含标签、数值和可选的描述字段 |
| chartTitle | text | 否 | 显示在图表上方的标题 |
| colorScheme | select | 否 | — |
| customColors | textarea | 否 | 十六进制颜色JSON数组(需要选择自定义颜色) |
| valueFormat | select | 否 | — |
| chartSize | number | 否 | 图表的像素尺寸(最小:300,最大:700) |
| startAngle | number | 否 | 起始角度(0-360度) |
| innerRadius | number | 否 | 玫瑰图的内半径(0-100) |
| segmentSpacing | number | 否 | 玫瑰扇区之间的间距(0-5) |
| backgroundColor | color | 否 | 图表容器的背景颜色 |
| showValues | checkbox | 否 | 在玫瑰花瓣内显示数值 |
| showLabels | checkbox | 否 | 在图表周围显示类别标签 |
| showGrid | checkbox | 否 | 显示背景网格圆圈 |
| showAnimation | checkbox | 否 | 加载时动画显示玫瑰花瓣 |
| showPercentage | checkbox | 否 | 显示百分比而不是数值 |
| showTotal | checkbox | 否 | 在标题下方显示总计数值 |
| enableTooltip | 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-rose-chart": {
"name": "rose-chart",
"description": "生成美丽的南丁格尔玫瑰图(鸡冠花图)来通过角度和面积可视化数据,非常适合比较分析和历史数据展示",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=rose-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": "rose-chart",
"arguments": {
"chartData": "JSON format:\n[{"label": "January", "value": 65, "description": "Winter month"},\n{"label": "February", "value": 59, "description": "Winter month"},\n{"label": "March", "value": 80, "description": "Spring month"},\n{"label": "April", "value": 81, "description": "Spring month"}]",
"chartTitle": "输入图表标题...",
"colorScheme": "nightingale",
"customColors": "["#FF6B6B", "#4ECDC4", "#45B7D1", "#96CEB4"]",
"valueFormat": "number",
"chartSize": "500",
"startAngle": "0",
"innerRadius": "30",
"segmentSpacing": "2",
"backgroundColor": "#ffffff",
"showValues": true,
"showLabels": true,
"showGrid": true,
"showAnimation": true,
"showPercentage": false,
"showTotal": true,
"enableTooltip": true
}
}
}有问题或反馈?请联系 [email protected]