# @univerjs-pro/sheets-chart

[![npm version](https://img.shields.io/npm/v/@univerjs-pro/sheets-chart?style=flat-square)](https://npmjs.com/package/@univerjs-pro/sheets-chart)
[![license](https://img.shields.io/npm/l/@univerjs-pro/sheets-chart?style=flat-square)](https://npmjs.com/package/@univerjs-pro/sheets-chart)
[![downloads](https://img.shields.io/npm/dm/@univerjs-pro/sheets-chart?style=flat-square)](https://npmjs.com/package/@univerjs-pro/sheets-chart)

`@univerjs-pro/sheets-chart` is part of Univer Pro. Chart model integration for Univer Sheets.

## Package Overview

| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
| --- | --- | :---: | :---: | :---: | :---: |
| `@univerjs-pro/sheets-chart` | `UniverProSheetsChart` | No | Yes | Yes | No |

## Installation

```sh
pnpm add @univerjs-pro/sheets-chart
# or
npm install @univerjs-pro/sheets-chart
```

## Usage

Start with the [integration setup](https://docs.univer.ai/) for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.

```ts
import EnUS from '@univerjs-pro/sheets-chart/locale/en-US';
import { UniverSheetsChartPlugin } from '@univerjs-pro/sheets-chart';

univer.registerPlugin(UniverSheetsChartPlugin);

// Merge EnUS into your Univer locale map when this package contributes UI text.
```

## Integration Notes

- Import locale files only for the languages your application enables.
- Use the facade entry when integrating through Univer Facade APIs.
- Register `UniverSheetsChartPlugin` before creating a workbook or replaying changesets. Chart Sheet model lifecycle, conversion commands, primary-chart policy, and compact sheet snapshots are built into this plugin.
- The model package supports browser and Node.js runtimes without registering a UI plugin. Browser applications can add `@univerjs-pro/sheets-chart-ui` for Chart Sheet presentation and Move Chart controls.

## Resources

- [Documentation](https://docs.univer.ai)
- [NPM package](https://npmjs.com/package/@univerjs-pro/sheets-chart)
- [GitHub repository](https://github.com/dream-num/univer-pro)
