8000 GitHub - cnxzq/node-canvas-echarts: node-canvas echarts
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cnxzq/node-canvas-echarts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-canvas-echarts

use node-canvas and echarts create chart image

install

npm install canvas-echarts -S

test

const {createEChartsImage} = require("node-canvas-echarts");
const path = require("path");
createEChartsImage({
    width:800,
    height:300,
    path:path.join(__dirname,"bar.png"),
    option:{
 
5746
       title: {
            text: '世界人口总量',
            subtext: '数据来自网络'
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {
            data: ['2011年', '2012年']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            type: 'category',
            data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)']
        },
        series: [
            {
                name: '2011年',
                type: 'bar',
                data: [18203, 23489, 29034, 104970, 131744, 630230]
            },
            {
                name: '2012年',
                type: 'bar',
                data: [19325, 23438, 31000, 121594, 134141, 681807]
            }
        ]
    }
})

About

node-canvas echarts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0