Skip to content

render server side charts using puppeteer and apache echarts library

Notifications You must be signed in to change notification settings

karanssh/chart-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chart-server

introduction

forked from https://github.com/crazyminy/chart-server

Server side graph rendering is done by this simple API server

What is supported:

  • echarts
  • more to come

How it works:

Puppeteer is used as a headless browser to render the picture, and the base64 code of the generated picture is returned.

echarts

request

{
   "width":700,
   "height":600,
   "options":{
      "title":{
         "text":"ECharts demo"
      },
      "tooltip":{
         
      },
      "legend":{
         "data":[
            "fruits"
         ]
      },
      "xAxis":{
         "data":[
            "apple",
            "orange",
            "banana",
            "mango",
            "guava",
            "lychee"
         ]
      },
      "yAxis":{
         
      },
      "series":[
         {
            "name":"amount",
            "type":"bar",
            "data":[
               5,
               20,
               36,
               10,
               10,
               20
            ]
         }
      ]
   }
}

Response

0 10 20 30 40 apple orange banana mango guava lychee ECharts demo ">
data:image/svg xml;charset=UTF-8,































































0

10

20

30

40

apple

orange

banana

mango

guava

lychee

































ECharts demo




Port

The service runs on port 13705 for now. Will add configurable port later on http://localhost:13705/echarts

Milestones

  • GRPC support? maybe

  • D3.js ? maybe

  • amcharts ? maybe

  • configurable http port

About

render server side charts using puppeteer and apache echarts library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published