by antvis ★ 506

AntV G2 Chart Skill.

Create charts with AntV G2 v5 using its marks, encodings, scales and interactions.

Data VisualizationChartsJavaScript
Upstream Source File
https://github.com/antvis/chart-visualization-skills/blob/a105fa12a9fa41fccccc2eba7f4b34973628f5d3/skills/antv-g2-chart/SKILL.md
Task
Data Visualization
License
Repository Stars
506Repository-wide, not skill installs
Source Reviewed
2026-10-07
01 What It Does

Write Charts in G2 v5 Spec Mode

A G2 v5 implementation guide combining declarative spec rules, targeted reference retrieval, common error prevention, and data-aware visual choices.

AntV G2 Chart focuses on chart implementation with @antv/g2 v5. It starts generated examples from a complete declarative specification and covers common failure points such as missing containers, incorrect mark names, singular label properties, and misplaced transforms. It also provides a documentation-retrieval endpoint for targeted G2 concepts and examples.

The source is especially clear about multi-mark composition: a line and points belong inside a view's children rather than repeated root-type changes. Its visual guidance separates the engine's defaults from the Skill's chosen overrides, and asks that units, source labels, and titles only be added when their meaning is known. It is not a general AntV tool for graphs, diagram editors, or pivot tables.

Expected Deliverables

  • A complete G2 v5 chart specification with container and render setup.
  • Corrected mark, encoding, transform, and composition choices.
  • A chart-specific review of labels, color semantics, tooltips, and data meaning.

From Brief to Review

  • Read the Data and Intent
    Identify fields, units, comparison needs, and the chart question without inventing missing semantics.
  • Retrieve the Relevant Reference
    Use the documented G2 retrieval service when API or chart-type details need confirmation.
  • Build a Complete Spec
    Choose valid marks and channels, use transform arrays, and compose overlays within a view.
  • Render and Review
    Check actual marks, labels, legends, themes, and dense-data behavior in the target container.
02 When to Use It

When to Use It

Requires @antv/g2 v5 or the documented browser bundle. Optional reference retrieval uses the external AntV context service.

A Good Fit

  • G2 v5 Implementation
    Useful for creating charts with the library's declarative specification style.
  • Migration and Debugging
    Helps identify syntax copied from older G2 usage or other visualization grammars.
  • Multi-Mark Charts
    Clarifies how independent overlays should be composed.

Limits to Check

  • Not Every AntV Library
    G6 networks, X6 diagrams, and S2 pivot tables are outside the stated scope.
  • Rendering Is Not Data Validation
    Correct rendering does not establish that the data, aggregation, or interpretation is valid.
  • References Need Network Access
    The documented retrieval endpoint is an external service whose availability must be checked when used.

Bring These Inputs

  • Dataset and Field Meanings
    Provide actual values, types, units, and any permitted aggregation.
  • Visualization Question
    Explain what the chart should compare or reveal.
  • Runtime Context
    State G2 version, container, theme, and interaction requirements.
03 Decisions That Matter

Decisions That Matter

Complete Initial Specifications

A full spec makes a generated chart easier to reason about than a sequence of partial root changes.

Semantic Color

Color should encode a meaningful group or status, not add a rainbow to a single-series comparison.

Defaults and Overrides Are Distinct

The source distinguishes chosen radius, width, and opacity values from the engine behavior they override.

04 Try a Focused Brief

Try a Focused Brief

The example brief below has not been tested. Check the skill’s setup before using it.

1

Review the Setup

Install the Skill from the repository's supported route and add @antv/g2 to the target application as appropriate. The chart package and the agent Skill are separate dependencies.

Requires @antv/g2 v5 or the documented browser bundle. Optional reference retrieval uses the external AntV context service.
2

Start With One Deliverable

Adapt the scope, source material and constraints in this brief before running the skill.

3

Inspect the Result

Check the actual output against these observable criteria.

Example Brief
Use antv-g2-chart to build a G2 v5 chart from the supplied monthly revenue data. Overlay a line and points with view plus children, preserve the supplied currency units, and use a complete initial spec with an explicit container and render call. Avoid redundant color legends and check dense labels before adding them.

Review Checklist

  • The chart has an explicit container and render call.
  • Overlay marks are composed as independent children of a view.
  • Labels, units, and color encodings match the supplied data meaning.

OpenDesign provides a local design workspace for coding agents. This listing does not mean the skill is bundled or that its external tools, credentials and software dependencies are included.

05 Source and License

Source and License

This page describes the pinned source revision linked below. Upstream behavior and requirements can change.

Source Owner antvis
Repository antvis/chart-visualization-skills
Skill File skills/antv-g2-chart/SKILL.md
License MIT
Reviewed Snapshot 2026-10-07 · a105fa12a9fa

Original summary by OpenDesign, based on the linked source. Repository stars are a dated popularity signal, not skill usage or a quality score.

06 Questions Before You Start

Questions Before You Start

Can I overlay marks by changing the root type twice?
The source says no: that updates the root mark rather than creating independent overlays. Use a view with children.
Does it cover G6 network diagrams?
No. The source explicitly excludes G6, X6, and S2 tasks from this G2 chart Skill.
Are the suggested styling values G2 engine defaults?
Not all of them. The source distinguishes its recommended explicit overrides from the engine's own defaults.
OpenDesign

Make Room for the Next Design Iteration.

Keep your brief, source material and design work together in a local workspace. Check the skill’s own setup before adding it to your workflow.

AntV G2 Chart on OpenDesign