drawing “good” graphs in php

2019-09-08 22:12发布

I'm intrested in the best way to draw a graph: i have a network and i'd like to draw a map of it. I know how to use gd, but i don't know how to make this graph good for viewing: i mean no line crossing etc. So, i guess there must be some tools or even php classes for doing this (maybe for graphviz dot?). Any help will be great for me!

标签: php graph
4条回答
对你真心纯属浪费
2楼-- · 2019-09-08 22:35

Well, maybe you could use the PEAR Image_GraphViz class?

查看更多
▲ chillily
3楼-- · 2019-09-08 22:41

Personally, I'd off-load the work of drawing the graph to the browser.

A good Javascript graphing library such as gRaphael can draw the graph using vector graphics (ie SVG), and can look much better than most static images generated by PHP, and can have features which static images can't, such as popups when you roll-over data points.

If you do it this way, all your PHP code has to supply is the graph data.

Hope that helps.

查看更多
叼着烟拽天下
4楼-- · 2019-09-08 22:45

As you've laready hinted at, the quickest and simplest approach is to use graphviz. Given the abstraction provided by the dot language, there's little point in providing a PHP abstraction layer on top of it.

查看更多
趁早两清
5楼-- · 2019-09-08 22:55

Use google! http://code.google.com/apis/visualization/documentation/using_overview.html#load_your_libraries

They have great graphs. You just need to present the information in the right matter for google to understand. It's pretty simple.

查看更多
登录 后发表回答