JSPM

draw-corner-ring

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q8299F
  • License ISC

based on data draw corner ring

Package Exports

  • draw-corner-ring

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (draw-corner-ring) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Installation

npm install --save-dev @draw-corner-ring

Usage

  • id: String 绘制区域的id
  • arr: []; 数组类型,传入的原始数据
  • options:
    • radius: 内层圆的半径
    • lng: 最外层圆的半径
    • title: 中间显示标题
    • titleColor: 标题颜色
  • horizon: 水平横线的长度

example

    import drawCircle from './drawCircle.js';
    //id, arr, options, colors, labelColor
    const arr = [
      {
        "name": "学习",
        "value": 6
      },{
        "name": "吃饭",
        "value": 3
      },  {
        "name": "睡觉",
        "value": 8
      },
      {
        "name": "看手机",
        "value": 1
      }
    ];
    const options = {
      radius: 50,
      lng: 80,
      title: 'CPU',
      titleColor: '#73FBFD',
      horizon: 10
    };
    const colors = ["#FFC0CB", "#4B0082", "#40E0D0"]
    drawCircle("circle", arr, options)