# chartjs-plugin-doughnut-innertext

> A ChartJS doughnut plugin. It add inner text to the center of doughnut chart.

Latest version **3.1.0** (published 2021-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install chartjs-plugin-doughnut-innertext
pnpm add chartjs-plugin-doughnut-innertext
yarn add chartjs-plugin-doughnut-innertext
bun add chartjs-plugin-doughnut-innertext
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2021-05-03 |
| First published | 2021-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Steven Wu |
| Maintainers | tbpackage |
| Keywords | chartjs, chartjs-plugin, doughnut chart inner text plugin, react-chartjs-2, react-chartjs |

## Links

- npm: https://www.npmjs.com/package/chartjs-plugin-doughnut-innertext
- Repository: https://github.com/yingchangwu/chartjs-plugin-doughnut-innertext
- Homepage: https://www.chartjs.org/
- Issues: https://github.com/yingchangwu/chartjs-plugin-doughnut-innertext/issues
- npm.io page: https://npm.io/package/chartjs-plugin-doughnut-innertext

## Dependencies (1)

- [chart.js](https://npm.io/package/chart.js.md) ^3.2.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

- 3.1.0 (latest) — 2021-05-03
- 3.0.0 — 2021-05-03
- 2.5.1 — 2021-04-29
- 2.5.0 — 2021-04-29
- 2.4.2 — 2021-04-29
- 2.4.1 — 2021-04-29
- 2.4.0 — 2021-04-29
- 2.3.0 — 2021-04-29
- 2.2.0 — 2021-04-29
- 2.0.0 — 2021-04-29

## README

# Chart JS Line Height Annotation Plugin
### PRs Welcome
A small, lightweight and reliable ChartJS plugin for Doughnut charts specifically. This plugin was made to be compatible with the `react-chartjs-2` library, but it is available as a commonjs and umd module, as well.


## Usage

```sh
npm i chartjs-plugin-doughnut-innertext
```

For React components:

```js
import React, { Component } from "react";
import { Doughnut } from "react-chartjs-2";
import "chartjs-plugin-doughnut-innertext";

class App extends Component {
  render() {
    let data = api.get("doughnut-data");
    return (
      <Doughnut
        options={{
          // see all defaults / options below!
          centerText: {
            color: "#000",
            value: 340,
            fontSizeAdjust: 0.2 // increase font size 20% based on default font size
          }
        }}
        data={data}
      />
    );
  }
}
```

### Options

```js
/// default values
doughnutInnerText: {
  // color of the text
  color: "#000",
  // text to be display in the doughnut chart center
  value: 340,
  //manually adjust the font size on top of the default font size
  fontSizeAdjust: 0.2 // 20% larger of the default size
}
```

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