项目作者: neilpipi1985

项目描述 :
react-canvas-gauge
高级语言: JavaScript
项目地址: git://github.com/neilpipi1985/react-canvas-gauge.git
创建时间: 2018-06-29T08:29:09Z
项目社区:https://github.com/neilpipi1985/react-canvas-gauge

开源协议:MIT License

下载


react-canvas-gauge

NPM version
npm download

image

Quick start

Installing via npm

  1. $ npm install --save-dev react-canvas-gauge

Example

  1. import React, { Component } from 'react';
  2. import Gauge from 'react-canvas-gauge';
  3. class MyGauge extends Component {
  4. render() {
  5. return (<Gauge ></Gauge>);
  6. }
  7. }
  8. export default MyGauge;

Props







































































name type default
style object {}
theme string: ‘light’ , ‘dark’ ‘light’
mode string: ‘gauge’, ‘progress’ ‘gauge’
size number 128
enableAnimation bool true
animationTimeout number 250
enableColorful bool true
title string ‘’
unit string ‘’
scaleList array [{scale:10,quantity:5,startColor:’#ff2a04’,endColor:’orange’},{scale:10,quantity:5,startColor:’orange’,endColor:’#32cd32’}]
minValue number 0
value number 0

See the examples for a more complete sample.

Running Local Example

  1. $ git clone https://github.com/neilpipi1985/react-canvas-gauge
  2. $ cd ./react-canvas-gauge
  3. $ npm install
  4. $ npm run test