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-red-contrib-chartjs

v0.5.2

Published

Node-RED Chart.js node

Downloads

392

Readme

node-red-contrib-chartjs

A Node-RED node to provide charts for plotting things on. Implemented by Chart.js

Charts RED Dashboards

Description

This nodes package permit to use Chart.js charts from Node-RED. The objective is create a new url path for each chart created, this url path could be configured and updated at runtime.

For the latest updates see the CHANGELOG.md

Installation

npm install node-red-contrib-chartjs --save

Charts implemented

  • Line Chart

linea_chart

  • Multi Line Chart MultiLinearChart

  • Vertical Bar Chart

vertical_chart

  • Horizontal Bar Chart

horizontal_chart

  • Pie Chart

pie_chart

  • Doughnut Chart

dought_chart

  • Polar Area Chart

polar_chart

  • Bubble Chart

bubble_chart

  • Radar Chart

radar_chart

Chart configuration

The Chart attributes are:

  • Path: The Chart Url to be access. An example where path is TP01 could be:
http://localhost:1880/TP01
  • Tittle: The chart title
  • X Axis: The X axis label
  • Y Axis: The Y axis label
  • Payload: The chart dataset object

The chart payload attributes are:

  • channel: The channel legend
  • color: The chart color line
  • dataset: The chart dataset

The payload dataset attributes are:

  • x: x axis dataset value
  • y: y axis dataset value

Read node help to check the dataset structure for each chart. The Line Charts dataset could be multi serial graphs like this:

[{"channel": "Population",
  "color": "Blue",
  "dataset": [{
      "x": "Europe",
      "y": 741
  },
  {
      "x": "Australia",
      "y": 24
  },
  {
      "x": "Africa",
      "y": 1.2
  },
  {
      "x": "America",
      "y": 325
  },
  {
      "x": "Asia",
      "y": 4.4
  }]},
  {"channel": "Economy",
    "color": "Green",
    "dataset": [{
        "x": "Europe",
        "y": 12
    },
    {
        "x": "Australia",
        "y": 13
    },
    {
        "x": "Africa",
        "y": 3
    },
    {
        "x": "America",
        "y": 22
    },
    {
        "x": "Asia",
        "y": 18
    }]}
]                

NOTE: The new multiserial linear chart implementation is compatible with the previous one versions

The rest of the charts dataset are not multiserial graphs. An example could be like this:

{
    "channel": "Population",
    "color": "Green",
    "dataset": [
        {
            "x": "Europe",
            "y": 741
        },
        {
            "x": "Australia",
            "y": 24
        },
        {
            "x": "Africa",
            "y": 1.2
        },
        {
            "x": "America",
            "y": 325
        },
        {
            "x": "Asia",
            "y": 4.4
        }
    ]
}               

Dependencies

Server side

Client side

  • socker.io-client: Socket.io client side
  • jquery: Multipurpose javascript library
  • bootstrap4: Build responsive, mobile-first projects on the web
  • popper.js: A kickass library used to manage poppers in the web applications
  • Chart.js: Simple yet flexible JavaScript charting for designers & developers
  • jsPDF: The leading HTML5 client solution for generating PDFs

Example

Under example folder you have a json flow to be imported in your node-red instance to test the nodes.