✨ Canvas Based Pie Chart Generator
- An easy-to-use canvas based pie chart generator 👀
- specify labels and size, and leave the rest to the system. 🦄
🔥 Installation
- Download package with command
npm install canvas-pie-chart
or yarn add canvas-pie-chart
💡 CommonJS Example
const { PieChart } = require("canvas-pie-chart");
const chart = new PieChart({
labels: [
{
text: "Option one",
size: 4
},
{
text: "Option two",
size: 7
},
{
text: "Option three",
size: 15
}
],
blackOrWhiteInvert: true,
size: 1024
});
const buffer = chart.draw();
💡 ES6 Example
import { PieChart } from "canvas-pie-chart";
const chart = new PieChart({
labels: [
{
text: "Option one",
size: 4
},
{
text: "Option two",
size: 7
},
{
text: "Option three",
size: 15
}
],
blackOrWhiteInvert: true,
size: 1024
});
const buffer = chart.draw();