Monday 17 Mar 2008

Easy diagrams on your website

I keep this link in my bookmarks for a long time without needed it. But then, I need it so I try, and it's very useful. :-)

graphic example

PHP/SWF charts (or XML/SWF charts) is a couple Flash + PHP (or +XML) which allow to generate easily graphics from tables in PHP (or XML). In short you get your data from a database for example, you stock it in a table that you send in parameter. The table can be very simple, SWF Charts will find how to use them in the graphic.

If the 1st element is a text, it becomes the legend of this drawing.

For example, here are some numbers for 2 places for diffrent years:

$chart[ 'chart_data' ] = array (
   array ( "", "2004", "2005", "2006", "2007" ),
   array ( "Place 1", 48, 55, 80, 100 ),
   array ( "Place 2", -12, 10, 55, 65 ) );

It's simple: we put in a table an axis for years, and 2 other tables for the 2 places.

There are a lot of optionnal parameters to choose colors, legends, size, fonts... and the most funny: how graphics will appear. There are several transition effects like progressive coming, falling, growing, turning... :-o

I invite you to have a look in the galery to see some effects (and there are more).

graphic-1 graphic-2

Visual options seem a bit complicated on fisrt look, but start from an existing example and make some trys to see the goal of each option.

The documentation is easy to understand, but I think it's better to start from a existing graphic from the galery close to what you want, and modify it.

Everything is on Maani.us...


cafĂ© Did this article help you? 
Buy me a coffee!

2 answers at “Easy diagrams on your website”

  1. Backlink from graphics
  2. Backlink from xml

Leave a comment (all comments are moderated, don't waste time with spam)

Azure Dev