# bigo-chart

> 可用于股票,基金,加密货币的图表库,支持分时图,蜡烛图

Latest version **1.1.6** (published 2021-06-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install bigo-chart
pnpm add bigo-chart
yarn add bigo-chart
bun add bigo-chart
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2021-06-10 |
| First published | 2021-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 478.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | huangdi |
| Maintainers | huangdiaries, _htwoo |
| Keywords | chart, block chain, bitcoin, trade |

## Links

- npm: https://www.npmjs.com/package/bigo-chart
- npm.io page: https://npm.io/package/bigo-chart

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.1.6 (latest) — 2021-06-10
- 1.1.5 — 2021-06-03
- 1.1.4 — 2021-06-03
- 1.1.3 — 2021-06-03
- 1.1.2 — 2021-05-28
- 1.1.1 — 2021-05-28
- 1.1.0 — 2021-05-28
- 1.0.4 — 2021-05-27
- 1.0.3 — 2021-05-27
- 1.0.2 — 2021-05-25
- 1.0.1 — 2021-05-25
- 1.0.0 — 2021-05-25

## README

# bigo-chart

使用 canvas 绘制,可用于股票,基金,加密货币的轻量级交易图表库,支持分时图,蜡烛图

## 安装

```bash
npm install bigo-chart -S
```

## 快速使用

```javascript
import BigoChart from "bigo-chart"
import "bigo-chart/dist/chart.css"

const option = {
  el: "#chart",
  bars,
  symbol: "ETH",
  hasVolume: true,
  logo: "./logo.png",
  chartType: 1,
}
const chart = new BigoChart(option)
```

## 效果展示

- 支持蜡烛图、分时图、交易量图。
- 支持视图缩放、拖拽、分页

![effect](https://img-blog.csdnimg.cn/20210531101251775.gif#pic_center)

- 支持视图实时更新:

![effect](https://img-blog.csdnimg.cn/20210531101551325.gif#pic_center)

## 配置

| 配置名称          | 配置说明                          | 可选值                                                                     | 类型                       |
| ----------------- | --------------------------------- | -------------------------------------------------------------------------- | -------------------------- |
| el                | 图表容器 id,如:'#chart-container' | /                                                                          | number                     |
| bars              | 历史行情数据                      | { close: number; high: number; low: number; open: number; volume: number } | object                     |
| symbol            | 产品标识                          | /                                                                          | string                     |
| logo              | 公司 logo 路径                    | /                                                                          | string                     |
| chartType         | 图表类型                          | 1: 分时图; 2: 蜡烛图                                                       | number                     |
| priceDigitNumber  | 价格精度                          | /                                                                          | number                     |
| volumeDigitNumber | 交易量精度                        | /                                                                          | number                     |
| loadMore          | 分页回调,接受一个参数 endTime     | /                                                                          | (endTime: number) => :bars |

## API

### `subscribeBars(close, volume, time)`

订阅数据,接受 3 个参数(当前行情, 当前新增的交易量, 当前时间),每次收到新数据都需要执行一次.

### `chart.setOption(option)`

产生新的配置,bigo-chart 会将新配置项和老配置项进行合并取舍,由此产生新的图表样式.

## GitHub

[https://github.com/HDhuangdi/bigo-chart](https://github.com/HDhuangdi/bigo-chart)

## LICENSE

[MIT](https://en.wikipedia.org/wiki/MIT_License)

---
_Source: https://npm.io/package/bigo-chart · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
