Tools for building charting server that creates /

2019-09-02 03:12发布

问题:

I have a set of apps being built on different platforms, which need charts. Rather than pull the data into the app and render the charts natively, I wanted to instead pull in the charts as images, which are processed server side.

I searched online to see if others have done this, but I can't find anything. Is anyone aware of any libraries or tools that will:

  1. Generate an chart
  2. Has some sort of static file serving of the charts
  3. Does some sort of caching / expiration of charts so they are not rendered each time a call is made?

Ideally this is something that would scale on S3 or so.

I've found something like Highcharts-server-render, but it only does #1 from the list above, and would still require work to do #2 and 3.

回答1:

Interesting problem here. Do you know all permutations of the types of charts that would be requested? Is the data static that the charts are based on? Do you control the updating of the charts? If you can answer yes to those 3 then you can try it.

  • The HighCharts export server is definitely the way to go.
  • Send in all your chart permutations as individual json calls to the renderer.
  • After each rendering of the chart, copy the image with some uniquely identifying name to a web-accessible folder.
  • Serve up the images as static links from that web-accessible folder.

Parts 2-3 you could write in various flavors of code. Seems a bit over the top to me, but possible.

Or...

Have highcharts render the chart like it normally would and you still have the export server to serve them up. I honestly cant see why you would want to use a dynamic charting library to not create dynamic and interactive charts.