Loading...
Loading...
Recommend and generate appropriate data visualization charts using the GPT-Vis library. Supports two output modes: (1) Syntax Mode - generates Syntax or JSON configurations; (2) Code Mode - generates complete runnable code. Supports 26 chart types.
npx skill4agent add antvis/chart-visualization-skills gpt-vis| Type Value | Applicable Scenario |
|---|---|
| line | Time series trends |
| area | Time series trends + total volume |
| column | Categorical data comparison |
| bar | Categorical comparison (long labels) |
| pie | Proportion of parts to the whole |
| scatter | Relationship between two variables |
| dual-axes | Comparison of data with different magnitudes |
| histogram | Frequency distribution of continuous values |
| boxplot | Data distribution and outliers |
| violin | Data distribution density |
| radar | Multi-dimensional comparison |
| funnel | Process conversion rate |
| waterfall | Cumulative increase/decrease changes |
| liquid | Percentage/progress display |
| word-cloud | Word frequency display |
| venn | Set intersection and union relationships |
| treemap | Proportion of hierarchical data |
| sankey | Flow direction visualization |
| flow-diagram | Process steps |
| mindmap | Hierarchical knowledge organization |
| indented-tree | Tree node hierarchy/directory |
| network-graph | Relationship between entities |
| organization-chart | Organizational hierarchy |
| fishbone-diagram | Root cause analysis |
| table | Tabular data display |
| summary | Content summarization |
GPTVis.render()GPTVis.render()GPTVisnew GPTVis(options: VisualizationOptions)| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| | Yes | — | CSS selector or DOM element |
| | No | — | Chart width (px) |
| | No | — | Chart height (px) |
| | No | | Theme |
| | No | | Whether to display outer UI container (including tabs, download, copy, etc.) |
| | No | | Language of text inside wrapper |
render(config: string | object): voidvis [type]typevis render()destroy(): voidGPTVis.render(){
"type": "column",
"data": [
{ "category": "Product A", "value": 30, "group": "Online" },
{ "category": "Product B", "value": 50, "group": "Online" }
],
"title": "Product Sales Comparison",
"axisXTitle": "Product",
"axisYTitle": "Sales (10,000 units)",
"stack": true,
"theme": "academy",
"style": {
"palette": ["#5B8FF9", "#61DDAA"]
}
}vis [type]key valuetitle Annual Trend
theme darkdata- { data: { time: string; value: number; }[]; }data
- time 2020
value 100
- time 2021
value 120- { data: number[] }data
- 10
- 20categories
- "North America"
- 'Southeast Asia'
- Europe{ style?: { backgroundColor?: string; palette?: string[] } }style
backgroundColor #f0f2f5
palette
- #5B8FF9
- #61DDAAchildren- type TreeData = { name: string; children?: TreeData[] };
{ data: TreeData; }data
name Root Node
children
- name Child Node A
children
- name Grandchild Node
- name Child Node Bvis column
data
- category Product A
value 30
group Online
- category Product B
value 50
group Online
title Product Sales Comparison
axisXTitle Product
axisYTitle Sales (10,000 units)
stack true
theme academy
style
palette
- #5B8FF9
- #61DDAAGPT-Vis```GPT-Vis
vis line
data
- time 2020
value 100
``````GPT-Vis
<Complete Syntax content, first line is vis <chart-type>>
```GPT-Visvis <chart-type>Note: In Markdown mode, the content area must include the first line, which is the same format as the pure Syntax mode.vis <type>
npm install @antv/gpt-visimport { GPTVis } from '@antv/gpt-vis';<script src="https://unpkg.com/@antv/gpt-vis/dist/umd/index.min.js"></script>GPTVis.GPTVis<html>
<head>
<script src="https://unpkg.com/@antv/gpt-vis/dist/umd/index.min.js"></script>
</head>
<body>
<div id="container"></div>
<script>
const gptVis = new GPTVis.GPTVis({
container: '#container',
width: 600,
height: 400,
});
gptVis.render(`
vis line
data
- time 2020
value 100
- time 2021
value 120
title Annual Trend
`);
</script>
</body>
</html>typelinecolumn{ type: string; title?: string; theme?: 'default' | 'light' | 'dark' | 'academy'; style?: { backgroundColor?: string; palette?: string[] } }{ data: { time: string | number; value: number; group?: string }[]; axisXTitle?: string; axisYTitle?: string; stack?: boolean; style?: { lineWidth?: number } }stack{ data: { category: string; value: number; group?: string }[]; axisXTitle?: string; axisYTitle?: string; stack?: boolean; group?: boolean }{ data: { category: string; value: number }[]; innerRadius?: number }innerRadius{ data: { x: number; y: number; group?: string }[]; axisXTitle?: string; axisYTitle?: string }{ categories: string[]; series: { type: 'line' | 'column'; data: number[]; axisYTitle?: string }[]; axisXTitle?: string; style?: { startAtZero?: boolean } }{ data: number[]; binNumber?: number; axisXTitle?: string; axisYTitle?: string }{ data: { category: string; value: number; group?: string }[]; axisXTitle?: string; axisYTitle?: string; style?: { startAtZero?: boolean } }{ data: { name: string; value: number; group?: string }[]; align?: boolean }align{ data: { category: string; value: number; }[]; }{ data: { category: string; value: number }[]; axisXTitle?: string; axisYTitle?: string; style?: { palette?: string[] } }percent{ percent: number; shape?: 'rect' | 'circle' | 'pin' | 'triangle' }{ data: { text: string; value: number; }[]; }sets: "A,B"label{ data: { sets: string | string[]; value: number; label?: string }[] }type TreeNode = { name: string; value: number; children?: TreeNode[] };
{ data: TreeNode[] }{ data: { source: string; target: string; value: number }[]; nodeAlign?: 'left' | 'center' | 'right' | 'justify' }sourcetargetnametype GraphData = { nodes: { name: string }[]; edges: { source: string; target: string; name?: string }[] };
// flow-diagram
{ data: GraphData }
// network-graph
{ data: GraphData; layout?: 'force' | 'circular' | 'grid' | 'radial' | 'concentric' | 'dagre' }type TreeData = { name: string; children?: TreeData[] };
// mindmap
{ data: TreeData; direction?: 'H' | 'LR' | 'RL' }
// indented-tree
{ data: TreeData; direction?: 'LR' | 'RL' | 'H' }
// organization-chart
type OrganizationChartData = {
name: string;
description?: string;
children?: OrganizationChartData[];
};
{ data: OrganizationChartData }'H''LR'type FishboneNode = { name: string; children?: FishboneNode[] };
{ data: FishboneNode; style?: { texture?: 'rough' | 'default' } }texture: 'rough'{ data: Record<string, string | number>[]; }timecategorygroup