Data Visualization
生成四象限分析图表,用于战略分析、优先级排序和决策制定
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/quadrant-chart' \
-H 'Content-Type: application/json' \
-d '{"chartData":"JSON format:\n[{"label": "Product A", "x": 75, "y": 80, "size": 12, "category": "High Priority"},\n{"label": "Product B", "x": 25, "y": 60, "size": 10, "category": "Medium Priority"}]\n\nor text format:\nProduct A,75,80,12,High Priority\nProduct B,25,60,10,Medium Priority","chartTitle":"输入图表标题...","xAxisLabel":"Importance","yAxisLabel":"Urgency","quadrantLabels":"High Priority, High Impact, Low Impact, Low Priority","quadrantColors":"#e8f5e8,#fef3e8,#fef3e8,#e8f5e8","pointSize":"8","xAxisMin":0,"xAxisMax":0,"yAxisMin":0,"yAxisMax":0,"chartSize":"600","opacity":"0.8","backgroundColor":"#ffffff","gridColor":"#e0e0e0","showGrid":true,"showLabels":true,"showAxes":true,"showLegend":true,"groupByCategory":false}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/quadrant-chart| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartData | textarea | 是 | 象限图的数据点。每个点需要x、y坐标,可选的大小和分类。 |
| chartTitle | text | 否 | 显示在图表上方的标题 |
| xAxisLabel | text | 否 | X轴的标签 |
| yAxisLabel | text | 否 | Y轴的标签 |
| quadrantLabels | text | 否 | 四个象限的标签(右上、左上、左下、右下)。用逗号分隔或使用JSON数组。 |
| quadrantColors | text | 否 | 四个象限的背景颜色(右上、左上、左下、右下)。用逗号分隔或使用JSON数组。 |
| pointSize | number | 否 | 数据点的默认像素大小 |
| xAxisMin | number | 否 | X轴最小值(留空自动缩放) |
| xAxisMax | number | 否 | X轴最大值(留空自动缩放) |
| yAxisMin | number | 否 | Y轴最小值(留空自动缩放) |
| yAxisMax | number | 否 | Y轴最大值(留空自动缩放) |
| chartSize | number | 否 | 方形图表的像素大小 |
| opacity | number | 否 | 数据点的透明度(0.1到1.0) |
| backgroundColor | color | 否 | 图表容器的背景颜色 |
| gridColor | color | 否 | 网格线的颜色 |
| showGrid | checkbox | 否 | 显示网格线以便更好阅读 |
| showLabels | checkbox | 否 | 在每个象限中显示标签 |
| showAxes | checkbox | 否 | 显示X和Y坐标轴线 |
| showLegend | checkbox | 否 | 按分类分组时显示图例 |
| groupByCategory | 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-quadrant-chart": {
"name": "quadrant-chart",
"description": "生成四象限分析图表,用于战略分析、优先级排序和决策制定",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=quadrant-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": "quadrant-chart",
"arguments": {
"chartData": "JSON format:\n[{"label": "Product A", "x": 75, "y": 80, "size": 12, "category": "High Priority"},\n{"label": "Product B", "x": 25, "y": 60, "size": 10, "category": "Medium Priority"}]\n\nor text format:\nProduct A,75,80,12,High Priority\nProduct B,25,60,10,Medium Priority",
"chartTitle": "输入图表标题...",
"xAxisLabel": "Importance",
"yAxisLabel": "Urgency",
"quadrantLabels": "High Priority, High Impact, Low Impact, Low Priority",
"quadrantColors": "#e8f5e8,#fef3e8,#fef3e8,#e8f5e8",
"pointSize": "8",
"xAxisMin": 0,
"xAxisMax": 0,
"yAxisMin": 0,
"yAxisMax": 0,
"chartSize": "600",
"opacity": "0.8",
"backgroundColor": "#ffffff",
"gridColor": "#e0e0e0",
"showGrid": true,
"showLabels": true,
"showAxes": true,
"showLegend": true,
"groupByCategory": false
}
}
}有问题或反馈?请联系 [email protected]