At work we have a series of screens that monitor various different bits of analytical data about our web servers. When I started at the company I was tasked with rewriting the code that powers these information screens.
One of the key features on these screens is a series of graphs that each show different metrics (CPU load, page load times etc. etc.). Now we use an external service to gather and monitor the data from the servers. This third party company do supply a very basic system to embed graphs.
The graphs that they supply are ok they work but they don’t look very nice, also as they are loaded in an <iframe> and you have no way of changing the css or the styling of the graph at all.
So what to do???
After doing a bit of head scratching and playing around with code I found a way of accessing all the metric data that I want via the API that is supplied by the third party service, Hurrah but what to do with it now?
That is when we thought of using the Google Charts system.
Now all of your data has to be provided in the form of a json array which can either be really easy to sort out or in our case was very hard because of the way that the metric data was coming to us but after playing with many different foreach loops in PHP we got the data in the right layout for our set of charts.
Google charts is really well supported by the comprehensive and relatively easy to understand documentation.
Well I believe that the best way to go through this is to list the pros and cons of this service to help you decide weather to use it yourself, so here goes.
- Simple to use
- Great documentation
- Really nice looking selection of charts
- All processing done on the client so your data doesn’t get seen by the big G
- The price: FREE
- Can be a bit awkward/fiddly to format your data into the right layout for the chart system to read (But that really depends on where the source is coming from)
- No offline support (Kinda linked to the above con)
Should you use it???
In my opinion YES certainly, I mean who really wants to write their own chart system or have the time to write there own chart system, I know that I don’t. So save yourself time and effort and use Google charts.