GithubHelp home page GithubHelp logo

sirithink / node-highcharts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidpadbury/node-highcharts

0.0 2.0 0.0 60 KB

A sample of generating client side charts on the server using node

Home Page: http://blog.davidpadbury.com/2010/10/03/using-nodejs-to-render-js-charts-on-server/

node-highcharts's Introduction

node-highcharts

An example library demonstrating how a browser based JavaScript graphing library (Highcharts) can be used from Node.

Usage

var fs = require('fs'),
	highcharts = require('node-highcharts'),
	options = {
		chart: {
			width: 300,
			height: 300,
			defaultSeriesType: 'bar'
		},
		legend: {
			enabled: false
		},
		title: {
			text: 'Highcharts rendered by Node!'
		},
		series: [{
			data: [ 1, 2, 3, 4, 5, 6 ]
		}]
	};

highcharts.render(options, function(err, data) {
	if (err) {
		console.log('Error: ' + err);
	} else {
		fs.writeFile('chart.png', data, function() {
			console.log('Written to chart.png');
		});
	}
});

Bar Chart

Todo

There's a few bits to do before the library will be ready for use.

  1. Cleanup jsdom window instance correctly.
  2. Cache window so we don't load jQuery+highcharts for every render.
  3. Use a local jQuery.
  4. Update to latest Highcharts version.
  5. Investigate using CanVG and node-canvas to render with no dependencies on the environment.

node-highcharts's People

Contributors

davidpadbury avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.