In my not so humble opinion generating a graph like this from a database shouldn't require a 70 line ruby script!
The cult of real-time metrics (in addition to big data) in Silicon Valley-style (Silicon Valley is now a state of mind and no longer just a place) startups now. Graph crucial and key metrics all the time and all in real-time ! I jest but it is valuable! Heretofore real-time metrics graphing has just been too hard unless you have the talent and experience of firms like Etsy to put the necessary infrastructure (graphing software, metrics collecting software, etc) in place.
However that difficulty is an opportunity that will be rapidly addressed (because real-time graphing is an itch that can be rapidly scratched by developers and it's helpful to companies' bottom line) and you can start to see this being addressed in projects like Simulchart.
In 1 hour I was able to get SimulChart graphing every 10 minutes the number of new Get Satisfaction Thunderbird topics using some node.js code (this is not a business critical real-time metric; i have plans for other real-time Thunderbird metrics, stay tuned :-) !). That's the future! 1 hour to get a business critical metric graphed in real time without having to stand up home grown infrastructure like Etsy and flickr did.
If anybody knows of any other real time open source and/or free graphing toolkits or services, let me know!