Refactored code to use Google Charts.