Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-chart-exec

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-chart-exec

An executable binary for creating charts in Node.js

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.1K
increased by2.75%
Maintainers
1
Weekly downloads
 
Created
Source

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

OptionDescriptionTypeExampleRequired
--typeChart type supported by Chart.js. Types line, barString--type='line'true
--optionsChoose 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
--heightHeight of the canvas.Integer--height=400true
--widthWidth of the canvas.Integer--width=400true
--labelsLabels of the chart.JSON--labels='["Label 1", "Label 2", "Label 3", "Label 4", "Label 5", "Label 6"]'true
--datasetDataset of the chart.JSON--dataset='[{"label":"Label of Chart", "data":[10, 20, 30, 40, 50, 40], "backgroundColor":"#7ACFFF", "borderColor":"#00A3FF"}}]'true
--outputfileOutput file in PNG file type.String--outputfile='directory/file.png'true

Output

1. Line chart --type='line'

With options --options=true
Command Line
npx node-chart-exec@2.0.0 --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 node-chart-exec@2.0.0 --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.pngoutput/lines-chart-without-options.png
Line Chart With OptionsLine Chart Without Options

2. Bar chart --type='bar'

With options --options=true
Command Line
npx node-chart-exec@2.0.0 --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 node-chart-exec@2.0.0 --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.pngoutput/bar-chart-without-options.png
Bar Chart With OptionsBar Chart Without Options

Author

Written by Gayan Kuruppu.

📄 License

Keywords

FAQs

Package last updated on 28 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc