This generates AntV G2 v5 chart code using the modern Spec API pattern, handling everything from basic bar and line charts to treemaps and force graphs. The skill enforces strict v5 conventions like mandatory container IDs, single `chart.options()` calls, and using `type: 'view'` with children arrays for multi-mark compositions. It's built around a comprehensive constraint system that catches common mistakes like mixing v4 chain syntax, using hallucinated mark types from other libraries, or setting illegal palette names that throw runtime errors. Worth using if you're working with G2 and need clean, runnable code that follows current best practices without the trial and error of API migration.

skills.sh installs
1.4K
GitHub stars
530
last updated
Aug 21, 2026

Install

$ npx -y skills add antvis/chart-visualization-skills --skill antv-g2-chart --agent claude-code

Installs into .claude/skills of the current project.

Files

G2 v5 Chart Visualization

Overview

G2 v5 is AntV's grammar-of-graphics charting library. It uses Spec Mode — a declarative, JSON-like configuration style. Generated examples should start from a complete spec; runtime code may later merge a local update through chart.options().

import { Chart } from '@antv/g2';

const chart = new Chart({ container: 'container', autoFit: true });
chart.options({
  type: 'interval',
  data: [{ genre: 'Sports', sold: 275 }],
  encode: { x: 'genre', y: 'sold' },
});
chart.render();

CDN Usage

<script src="https://unpkg.com/@antv/g2@5/dist/g2.min.js"></script>
<script>
  const chart = new G2.Chart({ container: 'container', autoFit: true });
  chart.options({
    type: 'interval',
    data: [{ genre: 'Sports', sold: 275 }],
    encode: { x: 'genre', y: 'sold' },
  });
  chart.render();
</script>

Content Retrieval Service

When using AntV G2 for data visualization, if you need to understand the concepts, usage, API, examples, and other aspects of G2 v5, you can use the provided context retrieval service. When using the skill, content is retrieved via an antv HTTP API server using GET requests.

Sponsors

Details

Repository
github.com/antvis/chart-visualization-skills
Categories
Data Science & ML, Debugging
First seen
Jun 3, 2026

More from antvis/chart-visualization-skills

All 8
1lignertys avatarreddit-leadslignertys/reddit-research-skillreddit leads1.3Kskills.sh installs
2antvis avatarantv-skills-maintainerantvis/chart-visualization-skillsAutomatically sync documentation and configuration after any skill is added or updated. Triggers on every AI code execution to keep README Available Skills and 1.2Kskills.sh installs
3antvis avatarantv-g6-graphantvis/chart-visualization-skillsUse this skill whenever the user wants to create, customize, or troubleshoot G6 v5 graph/network visualizations. Triggers include: any mention of 'G6', 'antv g61.2Kskills.sh installs
4antvis avatarantv-s2-expertantvis/chart-visualization-skillsS2 multi-dimensional cross-analysis table development assistant (Expert Skill). MUST act as priority when users mention the following keywords: 交叉表, 透视表, 明细表, 多1.2Kskills.sh installs
5orchestra-research avatarserving-llms-vllmorchestra-research/ai-research-skillsServes LLMs with high throughput using vLLM's PagedAttention and continuous batching. Use when deploying production LLM APIs, optimizing inference latency/throu1.1Kskills.sh installs
6orchestra-research avatarfaissorchestra-research/ai-research-skillsFacebook's library for efficient similarity search and clustering of dense vectors. Supports billions of vectors, GPU acceleration, and various index types (Fla1.1Kskills.sh installs