1.0.3 • Published 3 years ago

simple-react-d3-guage-chart v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

simple-react-d3-guage-chart

simple guage chart for react made using d3

NPM JavaScript Style Guide

Install

npm install --save simple-react-d3-guage-chart

Usage

import React, { Component } from 'react'

import SimpleGuageChart from 'simple-react-d3-guage-chart'
import 'simple-react-d3-guage-chart/dist/index.css'

class Example extends Component {
  render() {
    return <SimpleGuageChart id={"guage-01"} value={40}/>
  }
}

Examples

simple-react-d3-guage-chart

Properties

NamePropTypeDescriptionDefault value
valuePropTypes.string.isRequiredUsed to Display the value below the pointer
idPropTypes.string.isRequiredUnique ID for graph
sizePropTypes.numberSize of The chart, Min Value is 200px300
minValuePropTypes.numberMinimum value on the scale0
maxValuePropTypes.numberMaximum value on the scale100
minAnglePropTypes.numberMinimum angle at which the pointer starts. You need to provide both min and max angle. Min angle should always be less than max angle.-120
maxAnglePropTypes.numberMaximum angle at which the pointer ends120
majorTicksPropTypes.numberNumber of Expected Ticks, This will not be same as ticks appearing in graph, This varies based on d3 scale for min and max value.7
pointerWidthPropTypes.numberWidth of pointer. Diameter at the starting of pointer. Should be in between 2 to 106
pointerLengthPropTypes.numberPointer length Percentage, Should be in between 0.3 and 10.7
mainRingWidthPropTypes.numberThickness of ring.should be minimum 13
ticksRingWidthPropTypes.numberHeight of Ticks. Should be in between 0 and 3015
tickColorsPropTypes.arrayColor of ticks. Should be an array of length 2."#d92121", "#12af5a"
pointerColorPropTypes.stringColor of Pointer"#ff0500"
arcColorPropTypes.stringColor of Main Arc"#b3b3b3"
tickFontColorPropTypes.stringColor of Text on scale"#666"
fontColorPropTypes.stringColor of Value presented on scale"#666"

License

MIT © bhanupradeep7