Files
terminal-chart-server/skills/picoclaw-chart/SKILL.md

72 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: picoclaw-chart
description: 生成多种格式的图表ANSI/SVG/PNG/Markdown。支持折线图、柱状图、饼图、散点图、气泡图、圆环图、混合图、极区图、雷达图。用于 (1) 终端彩色显示, (2) Web 内嵌矢量图, (3) 位图下载, (4) Markdown 文档嵌入
---
# Chart Skill
## 快速开始
```json
POST https://aipi.gaomia.site/api/v1/chart
{
"type": "bar",
"title": "月度销售额",
"data": {
"labels": ["一月", "二月", "三月"],
"datasets": [
{ "name": "销售额", "values": [100, 150, 120], "color": "#4CAF50" }
]
}
}
```
响应:
```json
{
"chart_id": "string",
"text": "纯文本描述",
"ansi": "ANSI 彩色文本",
"svg": "SVG 矢量图",
"png_url": "https://aipi.gaomia.site/chart/{id}.png",
"markdown": "![标题](url)"
}
```
## 图表类型
| type | 说明 |
|------|------|
| `line` | 折线图 |
| `bar` | 柱状图 |
| `pie` | 饼图 |
| `scatter` | 散点图 |
| `bubble` | 气泡图 |
| `donut` | 圆环图 |
| `mixed` | 混合图(柱状+折线) |
| `polar` | 极区图 |
| `radar` | 雷达图 |
## 输出格式选择
| 场景 | 使用字段 |
|------|----------|
| 终端显示 | `ansi` |
| Web 内嵌 | `svg` |
| Web 展示 | `markdown` |
| 文件下载 | `png_url` |
## 参数参考
| 字段 | 类型 | 必填 | 默认值 |
|------|------|------|--------|
| `type` | string | 否 | `line` |
| `title` | string | 否 | - |
| `data.labels` | array | 是 | - |
| `data.datasets[].name` | string | 否 | - |
| `data.datasets[].values` | array | **是** | - |
| `data.datasets[].color` | string | 否 | `#4CAF50` |
| `data.options.width` | int | 否 | 600 |
| `data.options.height` | int | 否 | 400 |
详细 API 文档:见 [CHART_API.md](references/CHART_API.md)