# mithril-node-piechart

> Pie chart component for Mithril NodeJS

Latest version **1.0.0** (published 2016-05-04) · 0 weekly downloads

## Install

```sh
npm install mithril-node-piechart
pnpm add mithril-node-piechart
yarn add mithril-node-piechart
bun add mithril-node-piechart
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-05-04 |
| First published | 2016-05-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | hamed_ab |
| Keywords | mithril, pie, char, nodejs |

## Links

- npm: https://www.npmjs.com/package/mithril-node-piechart
- Repository: https://github.com/mithril-components/mithril_node_piechart
- Homepage: https://github.com/mithril-components/mithril_node_piechart#readme
- Issues: https://github.com/mithril-components/mithril_node_piechart/issues
- npm.io page: https://npm.io/package/mithril-node-piechart

## Dependencies (1)

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

- 1.0.0 (latest) — 2016-05-04

## README

mithril_node_piechart
=====================

A simple SVG pie chart component for Mithril JS and NodeJS.

![Pie chart screenshot](screenshot.png)

Usage
-----

```
// JSON containing data to create a basic SVG pie chart.
const data = {
	width: 	100,
	height: 100,
	parts:
	[
        { title: "Part A",    value : 180,  color: "#02B3E7" },
        { title: "Part B",    value:  60,   color: "#CFD3D6" },
        { title: "Part C",    value : 50,   color: "#736D79" },
        { title: "Part D",    value:  30,   color: "#776068" },
        { title: "Part E",    value : 20,   color: "#EB0D42" },
        { title: "Part F",    value : 20,   color: "#FFEC62" },
        { title: "Part G",    value : 7,    color: "#04374E" }
    ]
};

const ctrl = piechart.controller(data);
const view = piechart.view(ctrl);
```

Run the following command:

```
node test/test.js
````

It will generate a HTML file containing a SVG pie chart : [index.html](./public/index.html).


Options
--------

The controller takes a JSON containing data to create a pie chart.<br>
You should specify options like in usage example above.

| Option  | Description |
| ---- | ---- | ---- |
| **width** | Define the width viewport of the pie chart SVG. <br> Default: `0` |
| **height** | Define the height viewport of the pie chart SVG. <br> Default: `100` |
| **parts** | JSON defining each parts of the pie chart. <br> Example: <br> `{ title: "Part 1", value : 180, color: "#02B3E7" }` |
| edgeWidth | Pie chart edge width. <br> Default: `15` |
| delimiterColor | Pie chart parts delimiter color. <br> Default: `#fff` |
| delimiterOpacity | Pie chart parts delimiter opacity. <br> Default: `0.3` |
| delimiterWidth | Pie chart parts delimiter width. <br> Default: `1` |

---
_Source: https://npm.io/package/mithril-node-piechart · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
