Data Visualization
使用图标/符号创建象形图来表示数量,支持自定义图标、颜色和布局
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/pictograph-generator' \
-H 'Content-Type: application/json' \
-d '{"chartTitle":"输入图表标题...","dataItems":"JSON format example:\n[{"label": "Product A Sales", "value": 25, "color": "#3b82f6"},\n{"label": "Product B Sales", "value": 40, "color": "#ef4444"},\n{"label": "Product C Sales", "value": 15, "color": "#10b981"}]","iconType":"person","customIcon":"🎯","iconValue":"1","iconSize":"30","iconSpacing":"5","maxIconsPerRow":"10","layout":"flex","orientation":"left","customColor":"#3b82f6","backgroundColor":"#ffffff","borderColor":"#transparent","borderWidth":"0","fontSize":"14","titleSize":"24","fontWeight":"normal","titleWeight":"bold","titleColor":"#333333","showValues":true,"showLabels":true,"showLegend":true,"animationEnabled":true,"roundedCorners":false}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/pictograph-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartTitle | text | 否 | 显示在象形图上方的标题 |
| dataItems | textarea | 是 | JSON数组格式的数据项,包含标签、数值和可选颜色属性 |
| iconType | select | 是 | — |
| customIcon | text | 否 | 选择"自定义图标"时使用的表情符号 |
| iconValue | number | 是 | 每个图标表示的数值 |
| iconSize | number | 否 | 每个图标的像素大小 |
| iconSpacing | number | 否 | 图标之间的像素间距 |
| maxIconsPerRow | number | 否 | 每行最大图标数量(0=无限制) |
| layout | select | 否 | — |
| orientation | select | 否 | — |
| customColor | color | 否 | 图标的默认颜色(可被单个项目的颜色覆盖) |
| backgroundColor | color | 否 | 图表的背景颜色 |
| borderColor | color | 否 | 图标的边框颜色 |
| borderWidth | number | 否 | 边框宽度(像素) |
| fontSize | number | 否 | 标签和数值的字体大小 |
| titleSize | number | 否 | 图表标题的字体大小 |
| fontWeight | select | 否 | — |
| titleWeight | select | 否 | — |
| titleColor | color | 否 | 图表标题的颜色 |
| showValues | checkbox | 否 | 在标签旁边显示数值 |
| showLabels | checkbox | 否 | 显示分类标签 |
| showLegend | checkbox | 否 | 显示图标值的图例 |
| animationEnabled | checkbox | 否 | 加载时动画图标 |
| roundedCorners | 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-pictograph-generator": {
"name": "pictograph-generator",
"description": "使用图标/符号创建象形图来表示数量,支持自定义图标、颜色和布局",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pictograph-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": "pictograph-generator",
"arguments": {
"chartTitle": "输入图表标题...",
"dataItems": "JSON format example:\n[{"label": "Product A Sales", "value": 25, "color": "#3b82f6"},\n{"label": "Product B Sales", "value": 40, "color": "#ef4444"},\n{"label": "Product C Sales", "value": 15, "color": "#10b981"}]",
"iconType": "person",
"customIcon": "🎯",
"iconValue": "1",
"iconSize": "30",
"iconSpacing": "5",
"maxIconsPerRow": "10",
"layout": "flex",
"orientation": "left",
"customColor": "#3b82f6",
"backgroundColor": "#ffffff",
"borderColor": "#transparent",
"borderWidth": "0",
"fontSize": "14",
"titleSize": "24",
"fontWeight": "normal",
"titleWeight": "bold",
"titleColor": "#333333",
"showValues": true,
"showLabels": true,
"showLegend": true,
"animationEnabled": true,
"roundedCorners": false
}
}
}有问题或反馈?请联系 [email protected]