Data Visualization
创建范围图来可视化最小值-最大值范围,支持中位数标记和异常值检测
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/range-chart-generator' \
-H 'Content-Type: application/json' \
-d '{"chartTitle":"输入图表标题...","dataRanges":"JSON format example:\n[{"label": "Product A", "min": 80, "max": 120, "median": 95, "mean": 98, "outliers": [65, 135]},\n{"label": "Product B", "min": 90, "max": 140, "median": 110, "mean": 115, "outliers": [75, 155]},\n{"label": "Product C", "min": 70, "max": 110, "median": 85, "mean": 88, "outliers": [60, 125]}]","xAxisLabel":"Categories","yAxisLabel":"Values","rangeStyle":"line","rangeColor":"#3b82f6","medianColor":"#ff6b6b","pointColor":"#4ecdc4","outlierColor":"#ff4444","lineColor":"#333333","lineWidth":"2","pointSize":"4","outlierSize":"6","opacity":"0.3","showMedian":true,"showMean":false,"showOutliers":true,"showDataPoints":true,"showGrid":true,"gridColor":"#e0e0e0","backgroundColor":"#ffffff","chartWidth":"800","chartHeight":"500","valueFormat":"decimal","fontSize":"12","titleSize":"18","fontFamily":"Arial","animationEnabled":true,"animationDuration":"1000"}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/range-chart-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartTitle | text | 否 | 显示在范围图上方的标题 |
| dataRanges | textarea | 是 | JSON数组格式的数据范围,包含最小值、最大值和可选的中位数、平均值、异常值 |
| xAxisLabel | text | 否 | X轴的标签 |
| yAxisLabel | text | 否 | Y轴的标签 |
| rangeStyle | select | 是 | — |
| rangeColor | color | 否 | 范围可视化的主色调 |
| medianColor | color | 否 | 中位数标记的颜色 |
| pointColor | color | 否 | 平均数点标记的颜色 |
| outlierColor | color | 否 | 异常值点的颜色 |
| lineColor | color | 否 | 范围线条的颜色(如适用) |
| lineWidth | number | 否 | 范围线的像素宽度 |
| pointSize | number | 否 | 最小/最大数据点的像素大小 |
| outlierSize | number | 否 | 异常值点的像素大小 |
| opacity | number | 否 | 范围填充的透明度级别(0.0-1.0) |
| showMedian | checkbox | 否 | 在范围上显示中位数标记 |
| showMean | checkbox | 否 | 显示平均数点标记 |
| showOutliers | checkbox | 否 | 显示异常值数据点 |
| showDataPoints | checkbox | 否 | 显示最小和最大数据点 |
| showGrid | checkbox | 否 | 显示背景网格线 |
| gridColor | color | 否 | 网格线的颜色 |
| backgroundColor | color | 否 | 图表的背景颜色 |
| chartWidth | number | 否 | 图表的像素宽度 |
| chartHeight | number | 否 | 图表的像素高度 |
| valueFormat | select | 否 | — |
| fontSize | number | 否 | 标签和文本的字体大小 |
| titleSize | number | 否 | 图表标题的字体大小 |
| fontFamily | text | 否 | 文本元素的字体族 |
| animationEnabled | checkbox | 否 | 加载时动画显示图表 |
| animationDuration | number | 否 | 动画持续时间(毫秒) |
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-range-chart-generator": {
"name": "range-chart-generator",
"description": "创建范围图来可视化最小值-最大值范围,支持中位数标记和异常值检测",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=range-chart-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": "range-chart-generator",
"arguments": {
"chartTitle": "输入图表标题...",
"dataRanges": "JSON format example:\n[{"label": "Product A", "min": 80, "max": 120, "median": 95, "mean": 98, "outliers": [65, 135]},\n{"label": "Product B", "min": 90, "max": 140, "median": 110, "mean": 115, "outliers": [75, 155]},\n{"label": "Product C", "min": 70, "max": 110, "median": 85, "mean": 88, "outliers": [60, 125]}]",
"xAxisLabel": "Categories",
"yAxisLabel": "Values",
"rangeStyle": "line",
"rangeColor": "#3b82f6",
"medianColor": "#ff6b6b",
"pointColor": "#4ecdc4",
"outlierColor": "#ff4444",
"lineColor": "#333333",
"lineWidth": "2",
"pointSize": "4",
"outlierSize": "6",
"opacity": "0.3",
"showMedian": true,
"showMean": false,
"showOutliers": true,
"showDataPoints": true,
"showGrid": true,
"gridColor": "#e0e0e0",
"backgroundColor": "#ffffff",
"chartWidth": "800",
"chartHeight": "500",
"valueFormat": "decimal",
"fontSize": "12",
"titleSize": "18",
"fontFamily": "Arial",
"animationEnabled": true,
"animationDuration": "1000"
}
}
}有问题或反馈?请联系 [email protected]