mi-pie-chart
v1.0.8
Published
An SVG pie chart built with Typescript and D3
Readme
Installation
npm install mi-pie-chartUsage
To use first import PieChart class from mi-pie-chart.
import { PieChart } from 'mi-pie-chart';Next instantiate the pie chart.
const pieChart = new PieChart('#figure-1', someData, someConfig, someStyles);The PieChart class accepts four arguments:
| Argument | Required | Description |
| :------------ | :------- | :------------------------------------------------------------------ |
| elementId | Yes | The id of the html element you would like to contain the pie chart |
| data | Yes | The data you wish to display |
| config | No | Config options |
| styles | No | Override the default styles |
Data
Data must conform to the PieData interface. This can be imported:
import { PieChart, PieData } from 'mi-pie-chart';Config
Data must conform to the PieConfig interface. This can be imported:
import { PieChart, PieConfig } from 'mi-pie-chart';Styles
Data must conform to the PieStyles interface. This can be imported:
import { PieChart, PieStyles } from 'mi-pie-chart';