# simple-react-d3-guage-chart

> simple guage chart for react made using d3

Latest version **1.0.3** (published 2021-03-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-react-d3-guage-chart
pnpm add simple-react-d3-guage-chart
yarn add simple-react-d3-guage-chart
bun add simple-react-d3-guage-chart
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-03-28 |
| First published | 2021-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 65.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Banu Pradeep |
| Maintainers | bhanupradeep7 |
| Keywords | react, d3, gauge, chart, meter, speedometer, odometer, SimpleGuageChart |

## Links

- npm: https://www.npmjs.com/package/simple-react-d3-guage-chart
- Repository: https://github.com/bhanupradeep7/simple-react-d3-guage-chart
- Issues: https://github.com/bhanupradeep7/simple-react-d3-guage-chart/issues
- npm.io page: https://npm.io/package/simple-react-d3-guage-chart

## Dependencies (1)

- [d3](https://npm.io/package/d3.md) ^6.6.0

## 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.0.3 (latest) — 2021-03-28
- 1.0.2 — 2021-03-26
- 1.0.1 — 2021-03-26

## README

# simple-react-d3-guage-chart

> simple guage chart for react made using d3

[![NPM](https://img.shields.io/npm/v/simple-react-d3-guage-chart.svg)](https://www.npmjs.com/package/simple-react-d3-guage-chart) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

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

## Usage

```jsx
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](guageChart.png)

## Properties

| Name            | PropType                    | Description                                                    | Default value          |
|-----------------|-----------------------------|----------------------------------------------------------------|------------------------|
| value           | PropTypes.string.isRequired | Used to Display the value below the pointer                    |                        |
| id              | PropTypes.string.isRequired | Unique ID for graph                                            |                        |
| size            | PropTypes.number            | Size of The chart, Min Value is 200px                          | 300                    |
| minValue        | PropTypes.number            | Minimum value on the scale                                     | 0                      |
| maxValue        | PropTypes.number            | Maximum value on the scale                                     | 100                    |
| minAngle        | PropTypes.number            | Minimum 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 |
| maxAngle        | PropTypes.number            | Maximum angle at which the pointer ends                        | 120                    |
| majorTicks      | PropTypes.number            | Number 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 |
| pointerWidth    | PropTypes.number            | Width of pointer. Diameter at the starting of pointer. Should be in between 2 to 10| 6  |
| pointerLength   | PropTypes.number            | Pointer length Percentage, Should be in between 0.3 and 1      | 0.7                    |
| mainRingWidth   | PropTypes.number            | Thickness of ring.should be minimum 1                          | 3                      |
| ticksRingWidth  | PropTypes.number            | Height of Ticks. Should be in between 0 and 30                 | 15                     |
| tickColors      | PropTypes.array             | Color of ticks. Should be an array of length 2.                | ["#d92121", "#12af5a"] |
| pointerColor    | PropTypes.string            | Color of Pointer                                               | "#ff0500"              |
| arcColor        | PropTypes.string            | Color of Main Arc                                              | "#b3b3b3"              |
| tickFontColor   | PropTypes.string            | Color of Text on scale                                         | "#666"                 |
| fontColor       | PropTypes.string            | Color of Value presented on scale                              | "#666"                 |

## License

MIT © [bhanupradeep7](https://github.com/bhanupradeep7)

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