Skip to content

Commit

Permalink
readme fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
korvin89 committed Aug 3, 2022
1 parent f379720 commit 8dd1f3d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# @yandex-cloud/ChartKit
# @yandex-cloud/chartkit · [![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) [![npm package](https://img.shields.io/npm/v/@yandex-cloud/chartkit)](https://www.npmjs.com/package/@yandex-cloud/chartkit)

Library for rendering Yandex Charts scripts
React component used to render charts based on any sources you need

## Install

```bash
npm i @yandex-cloud/chartkit
```shell
npm i --save-dev @yandex-cloud/chartkit @yandex-cloud/uikit @yandex-cloud/i18n
```

## Mock data

`./mocks/line10.js`

## Usage

```jsx
import ChartKit, {ThemeProvider} from '@yandex-cloud/chartkit';
import {ThemeProvider} from '@yandex-cloud/uikit';
import ChartKit, {settings} from '@yandex-cloud/chartkit';
import {YagrPlugin} from '@yandex-cloud/chartkit/build/plugins';
import {data} from './data';

settings.set({plugins: [YagrPlugin]});

<ThemeProvider>
<ChartKit id="1" type="yagr" data={data} lang="ru" />
<div className="app" style={{height: 500}}>
<ChartKit type="yagr" data={data} />
</div>
</ThemeProvider>;
```

Note: [here](https://github.com/yandex-cloud/chartkit/blob/main/src/plugins/yagr/__stories__/mocks/line10.ts) you can get mocked data for this example

0 comments on commit 8dd1f3d

Please sign in to comment.