New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

TeeChart

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

TeeChart

Charting and graphing node.js module

latest
Source
npmnpm
Version
3.0.2
Version published
Weekly downloads
10
-37.5%
Maintainers
3
Weekly downloads
 
Created
Source

TeeChart Javascript charting, module for Node.js and jQuery plugin.

Steema Software https://www.steema.com

Charting module using TeeChart for JavaScript. Free for non-commercial use. See license.txt.

For TeeChart Javascript demos, documentation, support:

https://www.steema.com/product/html5

Node.js Dependencies

To create and render a chart picture at server-side, an HTML5 <canvas> node library is required.

TeeChart has been tested on Linux using node.js and node-canvas module.

Installation

Or:

npm install teechart

Running included example

node main.js

This small javascript code will accept requests via web to return an image/png sample chart:

http://127.0.0.1:4242

Notes

The important bits of code are:

  • Using TeeChart and node-canvas modules:
 var tee = require('./lib/teechart.js'),

 Canvas = require('./node-canvas/lib/canvas.js');
  • Creating a Tee.Chart, passing the canvas:
var canvas = new Canvas(500,300),

chart = new tee.Tee.Chart(canvas);
  • Manually specifying chart size (this step should not be mandatory in future releases) :
chart.bounds.set(0,0,500,300);
  • Add chart series, data, change formatting, etc, and DRAW:
chart.title.text="Node.js and TeeChart";

chart.addSeries(new tee.Tee.Bar([5,3,7,1,2]));

chart.draw();
  • Return the chart as image, or save it to a file, etc (Check node-canvas documentation for more options)
res.writeHead(200, {'Content-Type': 'text/html'});

res.end("<html><body><img src='"+canvas.toDataURL()+"'/></body></html>");

Keywords

canvas

FAQs

Package last updated on 12 May 2023

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