# cw-circle

> 用于统计学生做题情况，分析正确率，错误率

Latest version **1.2.0** (published 2018-07-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install cw-circle
pnpm add cw-circle
yarn add cw-circle
bun add cw-circle
```

## 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.2.0 |
| Published | 2018-07-12 |
| First published | 2018-02-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 42.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | jinges |
| Maintainers | jinges |

## Links

- npm: https://www.npmjs.com/package/cw-circle
- Repository: https://github.com/jinges/cw-chart
- Homepage: https://github.com/jinges/cw-chart#readme
- Issues: https://github.com/jinges/cw-chart/issues
- npm.io page: https://npm.io/package/cw-circle

## Dependencies (1)

- [babel-cli](https://npm.io/package/babel-cli.md) ^6.26.0

## Recent versions

- 1.2.0 (latest) — 2018-07-12
- 1.1.7 — 2018-03-13
- 1.1.6 — 2018-03-06
- 1.1.5 — 2018-03-06
- 1.1.4 — 2018-03-06
- 1.1.3 — 2018-03-02
- 1.1.2 — 2018-03-01
- 1.1.1 — 2018-02-09
- 1.1.0 — 2018-02-07
- 1.0.9 — 2018-02-07
- 1.0.8 — 2018-02-07
- 1.0.7 — 2018-02-06
- 1.0.6 — 2018-02-06
- 1.0.5 — 2018-02-02
- 1.0.4 — 2018-02-02
- … 4 more at https://npm.io/package/cw-circle/versions

## README

# cw-circle



用于统计学生做题情况，分析正确率，错误率

现在网页中写入一个  ``
 <canvas id="canvas"></canvas>`` 然后再按照下面的步骤操作

![示例图](example.png '示例图')


安装
---

```

 npm install cw-circle

```

参数
---
构造函数 ``DrawCircle`` 有四个参数，前三个``id`` ``data``  ``accuracy``是必填参数，第四个``option``是可选的，可以不传。

```javascript

  //"id", 根据此id来查找dom中的canvas对象， 必填
  id: '#canvas'

  // "data", 要显示的数据集合，每个份额的数量， 必填
  data: [15, 0, 43, 40, 15, 29, 23, 50, 34, 45, 56]

  // "accuracy", 某一个份额所占的比例系数， 必填
  accuracy: '45%'
  // "options" 是可选填的参数，包括 外圈颜色， 右边文字列表， 中间显示文字
  options: {
      //饼状图外圈的颜色列表
      outer_colors: ['#52cc8f', '#5499cc', '#ff6969', '#ffc869'],

      //右边的文字列表
      list: ['正   确', '半   对', '错   误', '待批改'],

      //饼状图中间显示的文字提示语
      center_text: '正确率',

      //默认文字颜色
      def_color: '#2c333d',
      // 右边列表文字颜色
      text_color: '#b3b3b3'
  }

```



示例
---

```javascript
 const data = [15, 0, 43, 40, 15, 29, 23, 50, 34, 45, 56]
  const list = ['正确', '半对', '错误', '待批改', '异常']
  
  new DrawCircle('#canvas', data, '49%', {
    list: list
  })
```

浏览器
---

在浏览器里可以直接引入js库


```javascript
  <script src="./../dist/cw_circle.js"></script>
  <script>
    const data = [15, 0, 43, 40, 15, 29, 23, 50, 34, 45, 56]
    const list = ['正确', '半对', '错误', '待批改', '异常']
    new DrawCircle.default('#canvas', data, '49%', {
      list: list
    })
  </script>
```

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