使用 PHP 创建图形并导出为 PDF

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5581738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 21:52:31  来源:igfitidea点击:

Create graphs with PHP and export to PDF

phppdfgraph

提问by jim

I'm looking for suggestions on creating graphs with PHP. I would also like to be able to export these graphs to a PDF document.

我正在寻找有关使用 PHP 创建图形的建议。我还希望能够将这些图形导出为 PDF 文档。

I am currently using google graphs but I don't like the idea of sending all my information to Google. I'd prefer my own in hosted solution.

我目前正在使用谷歌图表,但我不喜欢将所有信息发送给谷歌的想法。我更喜欢我自己的托管解决方案。

I have seen a lot of Flash solutions but i'm not aware of any way to export the SWF's to PDF.

我看过很多 Flash 解决方案,但我不知道有什么方法可以将 SWF 导出为 PDF。

Any pointers greatly appreciated.

任何指针都非常感谢。

Thanks.

谢谢。

采纳答案by Svish

Could something like SVGGraphplus SVG to PDFwork?

SVGGraphplus SVG to PDF这样的东西可以工作吗?

回答by MiPnamic

Lot of tools like PHPGraphLib, JPGraphthis both produce images that you can embedd into pdfs

许多工具,如PHPGraphLibJPGraph这两者都可以生成可以嵌入到 pdf 中的图像

回答by PeblCode

We make pdf reports on the fly. These documents have both text and pictures. The pdf is made with TCPDF and the pictures with php GD library. Both library's are free.

我们即时制作 pdf 报告。这些文件有文字和图片。pdf是用TCPDF制作的,图片是用php GD库制作的。两个图书馆都是免费的。

回答by streak

one of the best graph api library is Rgraph.

最好的图形 API 库之一是Rgraph

回答by Cogicero

You can use Javascript, Highcharts is free for non-commercial usage. And it has PDF export options too.

您可以使用 Javascript,Highcharts 可免费用于非商业用途。它也有 PDF 导出选项。

Highcharts is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. Highcharts currently supports line, spline, area, areaspline, column, bar, pie and scatter chart types http://www.highcharts.com/

Highcharts 是一个用纯 JavaScript 编写的图表库,提供了一种向您的网站或 Web 应用程序添加交互式图表的简单方法。Highcharts 目前支持线、样条、面积、区域样条、柱形、条形、饼图和散点图类型 http://www.highcharts.com/

回答by Sam

If you wanted to explore the flash avenue, you could check out http://alivepdf.bytearray.org/an open pdf library for AS3.

如果您想探索闪存大道,您可以查看http://alivepdf.bytearray.org/一个用于 AS3 的开放 pdf 库。

回答by Josh

I've used the Google Charts APIbefore and inserted them into pdfs using FPDF.

我之前使用过Google Charts API,并使用FPDF将它们插入到 pdf 中。