Data Visualization
创建专业甘特图,支持任务时间线、依赖关系、进度跟踪和里程碑标记
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/gantt-chart-generator' \
-H 'Content-Type: application/json' \
-d '{"chartTitle":"输入图表标题...","tasks":"JSON format example:\n[\n {\n "name": "Design Phase",\n "startDate": "2024-01-01",\n "endDate": "2024-01-15",\n "progress": 80,\n "dependencies": [],\n "isMilestone": false,\n "assignee": "John Doe"\n },\n {\n "name": "Development",\n "startDate": "2024-01-16",\n "endDate": "2024-02-28",\n "progress": 60,\n "dependencies": ["task-0"],\n "isMilestone": false,\n "assignee": "Jane Smith"\n },\n {\n "name": "Testing Phase",\n "startDate": "2024-03-01",\n "endDate": "2024-03-15",\n "progress": 100,\n "dependencies": ["task-1"],\n "isMilestone": true,\n "assignee": "Bob Johnson"\n }\n]","timeUnit":"days","dateFormat":"YYYY-MM-DD","currentDate":"YYYY-MM-DD(留空表示今天)","barHeight":"30","taskColor":"#e0e0e0","completedColor":"#22c55e","milestoneColor":"#f59e0b","dependencyColor":"#6b7280","todayLineColor":"#ef4444","gridColor":"#e0e0e0","backgroundColor":"#ffffff","chartWidth":"1000","chartHeight":"600","fontSize":"12","titleSize":"18","fontFamily":"Arial","showGrid":true,"showDependencies":true,"showMilestones":true,"showProgress":true,"showLabels":true,"todayLine":true,"animationEnabled":true,"animationDuration":"1000"}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/gantt-chart-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartTitle | text | 否 | 显示在甘特图上方的标题 |
| tasks | textarea | 是 | JSON数组格式的任务,包含名称、开始日期、结束日期、进度、依赖关系和可选的里程碑和负责人 |
| timeUnit | select | 否 | — |
| dateFormat | select | 否 | — |
| currentDate | text | 否 | 在图表上标记为"今天"的日期 |
| barHeight | number | 否 | 任务条的高度(像素) |
| taskColor | color | 否 | 任务条的背景颜色 |
| completedColor | color | 否 | 任务条完成部分的颜色 |
| milestoneColor | color | 否 | 里程碑标记的颜色 |
| dependencyColor | color | 否 | 依赖关系线的颜色 |
| todayLineColor | color | 否 | 今日指示线的颜色 |
| gridColor | color | 否 | 网格线的颜色 |
| backgroundColor | color | 否 | 图表的背景颜色 |
| chartWidth | number | 否 | 图表的像素宽度 |
| chartHeight | number | 否 | 图表的像素高度 |
| fontSize | number | 否 | 标签和文本的字体大小 |
| titleSize | number | 否 | 图表标题的字体大小 |
| fontFamily | text | 否 | 文本元素的字体族 |
| showGrid | checkbox | 否 | 显示背景网格线 |
| showDependencies | checkbox | 否 | 显示任务间的依赖关系箭头 |
| showMilestones | checkbox | 否 | 显示里程碑标记 |
| showProgress | checkbox | 否 | 在任务条上显示进度条 |
| showLabels | checkbox | 否 | 显示任务名称和信息 |
| todayLine | checkbox | 否 | 显示指示当前日期的线 |
| 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-gantt-chart-generator": {
"name": "gantt-chart-generator",
"description": "创建专业甘特图,支持任务时间线、依赖关系、进度跟踪和里程碑标记",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=gantt-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": "gantt-chart-generator",
"arguments": {
"chartTitle": "输入图表标题...",
"tasks": "JSON format example:\n[\n {\n "name": "Design Phase",\n "startDate": "2024-01-01",\n "endDate": "2024-01-15",\n "progress": 80,\n "dependencies": [],\n "isMilestone": false,\n "assignee": "John Doe"\n },\n {\n "name": "Development",\n "startDate": "2024-01-16",\n "endDate": "2024-02-28",\n "progress": 60,\n "dependencies": ["task-0"],\n "isMilestone": false,\n "assignee": "Jane Smith"\n },\n {\n "name": "Testing Phase",\n "startDate": "2024-03-01",\n "endDate": "2024-03-15",\n "progress": 100,\n "dependencies": ["task-1"],\n "isMilestone": true,\n "assignee": "Bob Johnson"\n }\n]",
"timeUnit": "days",
"dateFormat": "YYYY-MM-DD",
"currentDate": "YYYY-MM-DD(留空表示今天)",
"barHeight": "30",
"taskColor": "#e0e0e0",
"completedColor": "#22c55e",
"milestoneColor": "#f59e0b",
"dependencyColor": "#6b7280",
"todayLineColor": "#ef4444",
"gridColor": "#e0e0e0",
"backgroundColor": "#ffffff",
"chartWidth": "1000",
"chartHeight": "600",
"fontSize": "12",
"titleSize": "18",
"fontFamily": "Arial",
"showGrid": true,
"showDependencies": true,
"showMilestones": true,
"showProgress": true,
"showLabels": true,
"todayLine": true,
"animationEnabled": true,
"animationDuration": "1000"
}
}
}有问题或反馈?请联系 [email protected]