python处理svg,使用python的svg图

I am looking for a library to generate svg diagrams in python (I fetch data from a sql database). I have found python-gd, but it has not much documentation and last update was in 2005 so I wonder if there are any other libraries that are good for this purpose.

I am mostly thinking about simple line graphs, something like this:

解决方案

As youre looking for simple line graphics, probably, CairoPlot will fit your needs as it can generate svg output files out of the box. Take a look at this.

This example image shows only a few of its capabilities. Using the trunk version available at launchpad youll be able to add a legend box and add axis titles.

Besides that, using the trunk version, its possible to generate:

DotLine charts (the ones I believe you need)

Scatter charts

Pie/Donut charts

Horizontal/Vertical Bar charts

Gantt charts

I am looking for a library to generate svg diagrams in python (I fetch data from a sql database). I have found python-gd, but it has not much documentation and last update was in 2005 so I wonder if there are any other libraries that are good for this purpose. I am mostly thinking about simple line graphs, something like this: 解决方案 As youre looking for simple line graphics, probably, CairoPlot will fit your needs as it can generate svg output files out of the box. Take a look at this. This example image shows only a few of its capabilities. Using the trunk version available at launchpad youll be able to add a legend box and add axis titles. Besides that, using the trunk version, its possible to generate: DotLine charts (the ones I believe you need) Scatter charts Pie/Donut charts Horizontal/Vertical Bar charts Gantt charts
经验分享 程序员 微信小程序 职场和发展