MCPcopy Index your code
hub / github.com/ant-design/ant-design-charts

github.com/ant-design/ant-design-charts @3.1.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.1.6 ↗ · + Follow
895 symbols 2,917 edges 544 files 1 documented · 0% updated 3mo ago2.6.7 · 2025-12-23★ 2,228270 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

@ant-design/charts

A React chart library, based on G2Plot, G6, X6, L7Plot.

build npm npm GitHub stars npm License

WebsiteQuick StartGalleryFAQBlog

Case

Statistical charts

Flowchart

Maps

Relation Graphs

✨ Features

  • Easy to use
  • TypeScript
  • Pretty & Lightweight
  • Responsive
  • Storytelling

📦 Installation

```bash | pure $ npm install @ant-design/charts



## 🔨 Usage

```tsx | pure
import React from 'react';
import { Line } from '@ant-design/charts';

const Page: React.FC = () => {
  const data = [
    { year: '1991', value: 3 },
    { year: '1992', value: 4 },
    { year: '1993', value: 3.5 },
    { year: '1994', value: 5 },
    { year: '1995', value: 4.9 },
    { year: '1996', value: 6 },
    { year: '1997', value: 7 },
    { year: '1998', value: 9 },
    { year: '1999', value: 13 },
  ];

  const config = {
    data,
    width: 800,
    height: 400,
    autoFit: false,
    xField: 'year',
    yField: 'value',
    point: {
      size: 5,
      shape: 'diamond',
    },
    label: {
      style: {
        fill: '#aaa',
      },
    },
  };

  let chart;

  // Export Image
  const downloadImage = () => {
    chart?.downloadImage();
  };

  // Get chart base64 string
  const toDataURL = () => {
    console.log(chart?.toDataURL());
  };

  return (



      <button type="button" onClick={downloadImage} style={{ marginRight: 24 }}>
        Export Image
      </button>
      <button type="button" onClick={toDataURL}>
        Get base64
      </button>
      <Line {...config} onReady={(chartInstance) => (chart = chartInstance)} />



  );
};
export default Page;

Preview

📜 Document & API

See chart API for details. Common props:

Property Description Type defaultValue
onReady chart loaded callback (chart)=> void -
onEvent chart events (chart, event)=> void -
loading loading status boolean -
loadingTemplate loading template React.ReactElement -
errorTemplate custom error template (e: Error) => React.ReactNode -
className container class string -
style container style React.CSSProperties -

🤝 How to Contribute

Your contributions are always welcome! Please Do have a look at the issues first.

📧 Contact us

DingTalk group number: 35686967.

License

MIT

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 762
Interface 107
Method 16
Class 10

Languages

TypeScript100%

Modules by API surface

packages/graphs/src/utils/index.ts40 symbols
packages/graphs/src/interface.ts18 symbols
scripts/ast/parse.js17 symbols
packages/flowchart/src/interface.ts13 symbols
packages/graphs/src/obsolescent/graphs/utils.tsx12 symbols
packages/graphs/src/hooks/useGraphs.ts12 symbols
packages/graphs/src/obsolescent/graphs/types.ts10 symbols
packages/plots/src/hooks/useChart.ts9 symbols
packages/graphs/src/components/toolbar/index.tsx9 symbols
packages/site/examples/line/basic/demo/custom-marker.js8 symbols
packages/graphs/src/obsolescent/hooks/useGraph.ts8 symbols
packages/graphs/src/components/fundFlowGraph/customItem.ts8 symbols

For agents

$ claude mcp add ant-design-charts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page