Convert charts from javascript or json to image through phantomjs