drawing “good” graphs in php


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!


Well, maybe you could use the <a href="http://pear.php.net/manual/en/package.images.image-graphviz.about.php" rel="nofollow">PEAR Image_GraphViz</a> class?


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

A good Javascript graphing library such as <a href="http://g.raphaeljs.com/" rel="nofollow">gRaphael</a> 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.


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.


Use google! <a href="http://code.google.com/apis/visualization/documentation/using_overview.html#load_your_libraries" rel="nofollow">http://code.google.com/apis/visualization/documentation/using_overview.html#load_your_libraries</a>

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


  • Python tkinter wont display diagonal lines
  • Chinese and Japanese character encoding issues when exporting HTML to PDF
  • How to link a work load item with a commited change?
  • Is Lambda code repeated with dynamically created controls?
  • How would you model data variables variance on common scheme? SQL
  • Pandas plotting two graphs on one scale
  • Fluent Nhibernate: Trying to create entity with composite key that is also the keys for two referenc
  • Need advice in designing tables in SQL-Server
  • JFreeChart BarChart - Category Markers
  • Reduce Mono runtime size
  • Regex: Match everything except backreference
  • PostgreSQL 9.1 timezones
  • ResponseBuilder is not working when used with entity object
  • Escaping single quotes in JDBC with MySql
  • How to plot large time series (thousands of administration times/doses of a medication)?
  • what makes a request a new request in asp.net C#
  • How to make R's read_csv2() recognise the text characters properly
  • Android Activity.onWindowFocusChanged doesn't get called from within TabHost
  • Zoom in and out of jPanel
  • Graphics.CopyFromScreen [Web application] + The handle is invalid
  • Loading .coffee files via a view in Rails
  • System.InvalidCastException: Specified cast is not valid
  • C: Incompatible pointer type initializing
  • Debug.DrawLine not showing in the GameView
  • Create DicomImage from scratch using Dcmtk
  • Read a local file using javascript
  • HTML download movie download link
  • Apache 2.4 and php-fpm does not trigger apache http basic auth for php pages
  • Updating server-side rendering client-side
  • R: gsub and capture
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • Compare two NSDates in iPhone
  • Comma separated Values
  • How to set the response of a form post action to a iframe source?
  • Java static initializers and reflection
  • Setting background image for body element in xhtml (for different monitors and resolutions)
  • unknown Exception android
  • Observable and ngFor in Angular 2
  • Unable to use reactive element in my shiny app
  • How to load view controller without button in storyboard?