npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-chart-exec

v2.0.1

Published

An executable binary for creating charts in Node.js

Downloads

17,054

Readme

node-chart-exec

node-chart-exec is a configurable executable command program that generates charts in Node.js. It uses dependencies Chart.js, chartjs-node-canvas, fs-extra, and yargs. It uses npx command to generate charts. The program is written in JavaScript by gayanvoice.

Synopsis

npx node-chart-exec@[@version] --type --options --height --width --labels --dataset --outputfile

Description

| Option | Description | Type | Example | Required | | ------ | ----------- | ---- | ------- | -------- | | --type | Chart type supported by Chart.js. Types line, bar | String | --type='line' | true | | --options | Choose true for enable options or false for disable options. If you enter true it will remove all the values from the chart. | String | --options='true' | true | | --height | Height of the canvas.| Integer | --height=400 | true | | --width | Width of the canvas. | Integer | --width=400 | true | | --labels | Labels of the chart. |JSON | --labels='["Label 1", "Label 2", "Label 3", "Label 4", "Label 5", "Label 6"]' | true | | --dataset | Dataset of the chart. |JSON | --dataset='[{"label":"Label of Chart", "data":[10, 20, 30, 40, 50, 40], "backgroundColor":"#7ACFFF", "borderColor":"#00A3FF"}}]' | true | | --outputfile | Output file in PNG file type. |String | --outputfile='directory/file.png' | true |

Output

1. Line chart --type='line'

With options --options=true

Command Line
npx [email protected] --type='line' --options='true' --height=400 --width=400 --labels='["Label 1", "Label 2", "Label 3", "Label 4", "Label 5", "Label 6"]' --dataset='[{"label":"Label of Chart", "data":[10, 20, 30, 40, 50, 40], "backgroundColor":"#7ACFFF", "borderColor":"#00A3FF"}]' --outputfile='output/line-chart-with-options.png'
# Output
Node Chart Exec Started
All inputs are validated
Canvas width=400 height=400
Chart type='line' options='true' labels=["Label 1","Label 2","Label 3","Label 4","Label 5","Label 6"] output-file='output/line-chart-with-options.png'
Dataset [1/1] label='Label of Chart' data=[10,20,30,40,50,40] background-color='#7ACFFF' border-color='#00A3FF'
Image file created at 'output/line-chart-with-options.png'
Node Chart Exec Completed

Without options --options=false

Command Line
npx [email protected] --type='line' --options='false' --height=400 --width=400 --labels='["Label 1", "Label 2", "Label 3", "Label 4", "Label 5", "Label 6"]' --dataset='[{"label":"Label of Chart", "data":[10, 20, 30, 40, 50, 40], "backgroundColor":"#7ACFFF", "borderColor":"#00A3FF"}]' --outputfile='output/line-chart-with-no-options.png'
# Output
Node Chart Exec Started
All inputs are validated
Canvas width=400 height=400
Chart type='line' options='false' labels=["Label 1","Label 2","Label 3","Label 4","Label 5","Label 6"] output-file='output/line-chart-with-options.png'
Dataset [1/1] label='Label of Chart' data=[10,20,30,40,50,40] background-color='#7ACFFF' border-color='#00A3FF'
Image file created at 'output/line-chart-without-options.png'
Node Chart Exec Completed
Output

| output/lines-chart-with-options.png | output/lines-chart-without-options.png | | ------------------------------------- | ---------------------------------------- | | Line Chart With Options | Line Chart Without Options |

2. Bar chart --type='bar'

With options --options=true

Command Line
npx [email protected] --type='bar' --options='true' --height=400 --width=400 --labels='["Label 1", "Label 2", "Label 3", "Label 4", "Label 5", "Label 6"]' --dataset='[{"label":"Label of Chart", "data":[10, 20, 30, 40, 50, 40], "backgroundColor":"#7ACFFF", "borderColor":"#00A3FF"}]' --outputfile='output/bar-chart-with-options.png'
# Output
Node Chart Exec Started
All inputs are validated
Canvas width=400 height=400
Chart type='bar' options='true' labels=["Label 1","Label 2","Label 3","Label 4","Label 5","Label 6"] output-file='output/bar-chart-with-options.png'
Dataset [1/1] label='Label of Chart' data=[10,20,30,40,50,40] background-color='#7ACFFF' border-color='#00A3FF'
Image file created at 'output/bar-chart-with-options.png'
Node Chart Exec Completed

Without options --options=false

Command Line
npx [email protected] --type='bar' --options='false' --height=400 --width=400 --labels='["Label 1", "Label 2", "Label 3", "Label 4", "Label 5", "Label 6"]' --dataset='[{"label":"Label of Chart", "data":[10, 20, 30, 40, 50, 40], "backgroundColor":"#7ACFFF", "borderColor":"#00A3FF"}]' --outputfile='output/bar-chart-without-options.png'
# Output
Node Chart Exec Started
All inputs are validated
Canvas width=400 height=400
Chart type='bar' options='false' labels=["Label 1","Label 2","Label 3","Label 4","Label 5","Label 6"] output-file='output/bar-chart-without-options.png'
Dataset [1/1] label='Label of Chart' data=[10,20,30,40,50,40] background-color='#7ACFFF' border-color='#00A3FF'
Image file created at 'output/bar-chart-without-options.png'
Output

| output/bar-chart-with-options.png | output/bar-chart-without-options.png | | ------------------------------------- | ---------------------------------------- | | Bar Chart With Options | Bar Chart Without Options |

Author

Written by Gayan Kuruppu.

📄 License