Turning data into pretty pictures with Flex and PHP

One of the reasons I love PHP is that all I have to deal with is back-end code. I am absolutely horrible at anything resembling design, this includes information design. I am always in awe of USA today because they have the ability to take numbers and make pretty pictures from it.

Recently, I have started playing with and building code using Flex/ActionScript to build some things. The power that Flex gives me is incredible and it allows me to build some things that I always wanted to but never could figure out how to program in a Flash time-line.

One of the things Flex is great for is building Flash charts to include in your web pages that can interact with back end PHP scripts. To that end, my friend Ryan Stewart – Ryan work at Adobe – has written an article talking about exactly how to do this. “Flex and PHP charting

One of the main issues that you’ll encounter when using PHP and Flex together is how to best structure the data on the PHP side in order to bring it into the Flex application. Normally, you retrieve a set of data in a pseudo-random order, potentially ordered by id, and then plot that data. In a lot of cases, that works just fine. But for complex data types or for charts where you want to make it easy to interactively drill down into data, you have to use some tricks of the Flex framework to plot the data correctly.

This is a no-nonsense blog post. It assumes you understand Flex and Zend Framework. It doesn’t not walk you through setting either of those up. However, if you know those tools already, this is a great article with code ready for you to cut/paste and play with.

About Cal Evans

Many moons ago, at the tender age of 14, Cal touched his first computer. (We're using the term "computer" loosely here, it was a TRS-80 Model 1) Since then his life has never been the same. He graduated from TRS-80s to Commodores and eventually to IBM PCs.   For the past 10 years, Cal has worked with PHP and MySQL on Linux OSX, and when necessary, Windows. He has built on a variety of projects ranging in size from simple web pages to multi-million dollar web applications. When not banging his head on his monitor, attempting a blood sacrifice to get a particular piece of code working, he enjoys building and managing development teams using his widely imitated but never patented management style of "management by wandering around". Cal is happily married to wife 1.33, the lovely and talented Kathy. Together they have 2 kids who were both bright enough not to pursue a career in IT. Cal blogs at http://blog.calevans.com and is the founder and host of Nomad PHP