Skip to content

swanide/echarts-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

echarts-svg

Output echarts svg image on node enviroment.

Required:

Node >= v12.16.1

Usage:

const chart = require('echarts-svg').create({
    // svg font size
    fontSize: '12px',
    // render mode
    // default: use global document to init echarts
    // thread: use workthread to isolate echarts global context
    mode: 'default'
});
chart.render({
    color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'],
    title: {
        text: 'chart title'
    },
    //... echartOption
}, {
    width: 800,
    height: 600
})
    .then(svgText => {
        console.log(svgText)
    });