1.2.6 • Published 5 years ago

node-echarts-canvas v1.2.6

Weekly downloads
142
License
ISC
Repository
github
Last release
5 years ago

node-echarts-canvas

Echarts server side render by node canvas, generate chart image by Echarts. 使用NodeJs服务器端渲染echarts图表,生成图片格式。

forked from https://github.com/hellosean1025/node-echarts , 2 changes: 1. update echarts version 2. change canvas-prebuilt to canvas, canvas-prebuilt was officially deprecated

Install

OSCommand
OS Xbrew install pkg-config cairo pango libpng jpeg giflib
Ubuntusudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
Fedorasudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel
Solarispkgin install cairo pango pkg-config xproto renderproto kbproto xextproto
WindowsInstructions on our wiki
npm install node-echarts-canvas

Usage

var echarts = require('node-echarts-canvas');
var config = {
    width: 500, // Image width, type is number.
    height: 500, // Image height, type is number.
    option: {}, // Echarts configuration, type is Object.
    //If the path  is not set, return the Buffer of image.
    path:  '', // Path is filepath of the image which will be created.
    enableAutoDispose: true  //Enable auto-dispose echarts after the image is created.
}

echarts(config)

Config

nametypedefaultdescription
widthNumber500Image width
heightNumber500Image height
optionObject{}Echarts Options
pathString-Path is filepath of the image which will be created. If the path is empty, return buffer.
enableAutoDisposeBooleantrueEnable auto-dispose echarts after the image is created.
1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago