drawing "good" graphs in php - 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 PEAR Image_GraphViz class?

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.

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!
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.

Related

Graph/Chart suggestions. Using PHP, jQuery - silverlight?

I'm programming a site using PHP, mysql and jQuery. I would really appreciate and hoping for some suggestions as to what I can use to create pie, bar and line charts, where I have the ability to change the actual graphic thats being shown. For example, if I wanted to have the bar graph use an army camouflage graphic and another one with flower pixels. I've done some looking around, but always found it helpful asking others for what they use or have seen.
Also any recommendations to using silverlight for this over any existing PHP and jQuery extensions?
Thanks in advance.
It would do you good to check out FusionCharts XT. It renders charts in JavaScript, which means your charts will work very well on iOS devices too.
With Silverlight, iOS devices are out.
FusionCharts XT can be used with jQuery too, with jQuery's syntax : http://docs.fusioncharts.com/charts/contents/?jQuery/Overview.html
As you're working with jQuery right now I think these must be good libraries for your use. Besides, the jQuery would extend your page's size up to 77kbs so try to use all benefits of it.
http://www.1stwebdesigner.com/css/top-jquery-chart-libraries-interactive-charts/
http://www.jqplot.com/

Can anyone recommend a good way to display stats on a web page?

I want to display statistics on my site - we have the figures, but would like to display them in some way that looks prettier than just displaying the numbers.
Has anyone done this before, and do you have any recommendations for software we could use? Obviously open source would be ideal, although we might be willing to pay a small sum - they're not complicated stats though, so something simple would be best.
The mockup done by our designer is based on Google Analytics, but I think that may be a bit more than we need.
Essentially, there are 4 numbers, which change over time, so we would like to plot graphs showing each of them.
Thanks!
If the mockup is based on Google Analytics, than I would reccomend the Google Chart API. Another advantage could be that integrating this API is really easy (you have to load an url where Google makes the plot for you, so no need to install any library on server/homepage).
You could make static, image based plots, and interactive ones also.
I'd start using http://code.google.com/p/flot/ or possibly with http://www.highcharts.com/
I would recommend using jpgraph http://jpgraph.net/ or graphpite http://graphpite.sourceforge.net/

How to visualizate simple dependency graphs using php?

Is there any libraries to visualizate simple dependency graphs?
I suppose that SVG is good solution.
GraphViz does a nice job for tiny graphs, but not for huge ones. If your graph is reasonlably large, try aiSee or have a look at the alternatives on this list.
I'm not sure about PHP libraries, but there's the tool called Graphviz which can be invoked from your PHP code and produce .SVG visialization of your graph.
I really like Google Chart API: http://code.google.com/intl/fr/apis/chart/
Really simple to implement and there are quite a lot of graph styles.
Checkout http://thejit.org/
I used http://www.aditus.nu/jpgraph/ for drawing simple graphs.
ChartDirector is the best, and it has a lot of flavors thus has versions for PHP/ASP/COM/VB/.NET/JSP/Java/ColdFusion/Perl/Python/Ruby/C++.
By learning one, you then be able to use in many programming languages.
The if you mean graphs like in "dependency graph", then Graphviz should be mentioned.

How to implement google-maps-like zoom-and-pan system in web?

I'm writing a ticket-shop-system atm for reserving tickets for various concerts.
What I have is a php-backend and a webpage that shows a .swf with some actionsscript-3 code in it, to draw in flash some sort of map and make available seats clickable for the end-user.
The problem with this solution is, that there are quite large halls and just making the seats smaller isn't the right solution.
My next idea was to make a google-maps-like interface, so that users can pan and zoom and things like that. But I can't find any information about doing something like this, whether it'll be flash or javascript or something else...
I would appreciate any information regarding this topic!
Thanks in advance!
Google maps allows you to use their system and provide your own custom map too, so you can overlay your seating chart and nothing else. You can read the documentation here.
There's a sample pan-zoom flex application you might find helpful:
Source Code for Pan-Zoom Flex Map.
Hope that's helpful.
Take a look at Seadragon (http://seadragon.com). Might be an interesting way to expose the functionality.

draw binary tree with php

I'm looking for a good library / API to draw a binary tree using PHP.
I've tried using Image_GraphViz, but it doesn't seem to work. I've also looked at phpsyntaxtree, but its not documented.
Alternatively, I'm also looking for a jQuery plugin that does this. (just not this one because it has no documentation).
Thanks
My suggestion is to go with js, because vector graphs are nicer and you can add interactivity anytime.
Try raphael, a good (and perfectly documented) js graph library
homepage | tree graph demo
I still believe GraphViz is what you need. If you had a problem in using it, just post a question about the problem. It will be better than finding an alternative tool.

Categories