Skip to content

Instantly share code, notes, and snippets.

@qhoxie
Created September 17, 2009 22:37
Show Gist options
  • Save qhoxie/188768 to your computer and use it in GitHub Desktop.
Save qhoxie/188768 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'gchart'
data = <<HERE
Net::HTTPServerException: 14
ActiveRecord::StatementInvalid: 126
no_data: 27814
Errno::EPIPE: 4
ScalaNet::UnknownHostException: 100359
EOFError: 9498
NONE: 83697
RightAws::AwsError: 277198
Scraper::RobotsDenied: 26577
URI::InvalidURIError: 40
Errno::ECONNRESET: 325
NoDataInInputHandler: 19966
RealInternet::InternetException: 11283
RealInternet::RedirectException: 457
Timeout::Error: 16331
HERE
data = data.split("\n").collect {|s| s.split(": ")}
labels = data.collect &:first
counts = data.collect(&:last).collect(&:to_i)
puts Gchart.pie :data => counts, :legend => labels, :size => '750x400'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment