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 🙏

© 2026 – Pkg Stats / Ryan Hefner

restcharts

v0.4.1

Published

Generate charts easily through a simple REST API.

Downloads

34

Readme

RESTCharts

Generate PNG images of charts easily through a simple REST-like API.

Charts generated by Highcharts

Red Area Chart

Example: https://api.restcharts.com/chart/area?data=1,2,6,4,10,7,4,5,2,9,8&color=f00

API

$ curl -X GET https://api.restcharts.com/chart/:type[?parameter1=val1&parameter2=val2]

or

$ curl -X POST https://api.restcharts.com/chart/:type -d '{"parameter1": "val1", "parameter2": "val2", ...}'

Parameters

Simple Params

URL parameters

  • type: The type of the chart you want to generate. See all types here.

Body/query string parameters

  • data: Comma-delimited list of your data that needs to be charted. This is a required parameter if the raw config option (see Advanced below) is not provided or it is but a series array within the raw config is not provided.
  • color: The color of the line/bar/column/etc. of the chart.
  • bg: The background color of the area surrounding the chart (default: transparent, i.e. rgba(0, 0, 0, 0))
  • height: The height of the generated chart.
  • width: The width of the generated chart.
  • opacity: If an area chart (or variation), will be the opacity of the area.
  • linewidth: If a line or spline chart, the line width of the lines.

Advanced Params

If you want to generate a chart using any Highcharts options (the relevant options are the ones in the Highcharts.chart() method), you can provide a raw config object with any available options you'd like to provide for the chart type desired. Any configuration you have in the raw parameter will override the default options. Examples can be seen here.

  • raw: The JSON serialized config object. If the data parameter is not provided, a series array of data needs to be included here.

Default Configuration

The default Highcharts configuration object that is used if only simple parameters above are provided is as follows. We perform a deep Object.assign() with this object as the target and the raw object overwriting anything in this object if it's provided in a request:

{
  chart: {
    type: `type`,
    backgroundColor: `bg`,
    margin: [ 0, 0, 0, 0 ],
    height: `height`,
    width: `width`
  },
  plotOptions: {
    area: {
      fillOpacity: `opacity`
    }
  },
  credits: {
    enabled: false
  },
  xAxis: {
    visible: false
  },
  yAxis: {
    visible: false
  },
  legend: {
    enabled: false
  },
  exporting: {
    enabled: false
  },
  title: {
    text: '',
  },
  series: [{
    lineWidth: `linewidth`,
    color: `color`,
    data: `data`.map(d => ({ y: parseVal(d, 'integer'), marker: { enabled: false }}))
  }]
}

Development

Environment Variables

The following environment variables is required for the app to be deployed and Highcharts installed correctly without problems. Please make sure you have a Highcharts license per their licensing requirements :)

  1. ACCEPT_HIGHCHARTS_LICENSE=YES

Build

$ # To build the distribution files for the server
$ gulp build
$ # To run the dev server via nodemon
$ npm run dev
$ # To run tests
$ npm test

AWS Lambda

As of 2020-01-26, AWS Lambda's Runtime image lacks a dependency for PhantomJS to work which is what highcharts-export-server uses under the hood (see the error). To work around this issue follow these instructions before deploying to AWS Lambda.

Don't forget about setting the FONTCONFIG_PATH environment to /var/task/lib in your Lambda environment variables.

https://github.com/tarkal/highchart-lambda-export-server#building-from-scratch