1.3.0 • Published 5 months ago

@vueware/cli-charts v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Vueware

@vueware/cli-charts

@vueware/cli-charts is a simple TypeScript library that generates simple charts in the command line interface.

Installation

Install via npm:

npm install @vueware/cli-charts

Usage

Import and use the BarChart and BarData function to generate a Bar Chart:

import { BarChart, BarData } from "@vueware/cli-charts";

const data: BarData[] = [
  {
    label: "Salary",
    value: 10,
    color: "red",
    valueFormatter: (v) => `€ ${v.toFixed(2)}`,
  },
  {
    label: "Bonus",
    value: 2.5,
    color: "yellow",
    valueFormatter: (v) => `€ ${v.toFixed(2)}`,
  },
  {
    label: "Investment",
    value: 3,
    color: "blue",
    valueFormatter: (v) => `€ ${v.toFixed(2)}`,
  },
];

const chart = new BarChart(data, "Income");
console.log(chart.generate());

Result

+--------------------------------------------------------------------------------+
 INCOME
+--------------------------------------------------------------------------------+
 Salary          ████████████████████████████████████████ € 10.00
 Bonus           ██████████ € 2.50
 Investment      ████████████ € 3.00
+--------------------------------------------------------------------------------+
1.3.0

5 months ago

1.2.1

5 months ago

1.2.0

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.0

5 months ago