This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
spark_pr /
| name | age | message | |
|---|---|---|---|
| |
README | Sun Oct 04 14:58:09 -0700 2009 | |
| |
spark_pr.rb | Sun Oct 04 14:58:09 -0700 2009 |
README
spark_pr is a Ruby class to generate sparkline graphs with PNG or ASCII output. It only depends on zlib and generates PNGs with pure Ruby code. The line-graph outputs antialised lines. Example for PNG output: File.open( 'test.png', 'wb' ) do |png| png << Spark.plot( [47, 43, 24, 47, 16, 28, 38, 57, 50, 76, 42, 20, 98, 34, 53, 1, 55, 74, 63, 38, 31, 98, 89], :has_min => true, :has_max => true, 'has_last' => 'true', 'height' => '40', :step => 10, :normalize => 'logarithmic' ) end Example ASCII output: puts Spark.smooth( [47, 43, 24, 47, 16, 28, 38, 57, 50, 76, 42, 1, 98, 34, 53, 97, 55, 74, 63, 38, 31, 98, 89], :has_min => true, :has_max => true, :height => 14, :step => 4 ).to_ascii The SparkCanvas class can also be used for other drawing operations, it provides drawing canvas with alpha blending and some primitive graphics operations and PNG output in just about 100 lines of Ruby code.







