This morning I have been searching around for a free graphing solution for a program I am going to be writing today. I am basically creating a simple analytics package that analyzes the number of hits and conversions per day to an online application.

During my searching through pre-built PHP solutions I came across the Google charting API. Until today, I was not aware Google had a charting API but it doesn’t really surprise me since they have an API for just about anything you need to do online. I am already using Google to geocode addresses in this application so I might as well use them for charting as well.

In the past, I have created a number of different charts and graphs. At one point I even developed a custom program to create a meter. (Of course Google has a solution for this) The Google charting API offers most of the regular charting options. They have added some additional, useful charts like a map of the United States or a QR barcode creator.

The charts can be called within the image tag. For example:

<img src=http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World alt=”chart” />

Will create:

”chart”

And

<img src="http://chart.apis.google.com/chart?chco=f5f5f5,edf0d4,6c9642,365e24,13390a&chd=s:fSGBDQBQBBAGABCBDAKLCDGFCLBBEBBEPASDKJBDD9BHHEAACAC&chf=bg,s,eaf7fe&chtm=usa&chld=NYPATNWVNVNJNHVAHIVTNMNCNDNELASDDCDEFLWAKSWIORKYMEOHIAIDCTWYUTINILAKTXCOMDMAALMOMNCAOKMIGAAZMTMSSCRIAR&chs=440x220&cht=t" alt="Map of USA" />

Will create:

Map of USA

I will play with it more today and maybe add more detail at that time. For now check it out: http://code.google.com/apis/chart/