Sha256: 5aa3c2d18f9706ae02c8a2b79a250de1b87d0227f9219936a75fece80cd2d33f

Contents?: true

Size: 700 Bytes

Versions: 3

Compression:

Stored size: 700 Bytes

Contents

$:.unshift(File.dirname(__FILE__) + "/../../lib/")
require 'erlectricity'
require 'rubygems'
require 'gruff'

receive do |f|
  
  
    
  f.when(:plot, String, Symbol, String) do |name, style, font|
    graph = Gruff.const_get(style).new
    graph.title = name
    graph.font = font
    graph.legend_font_size = 10
    
    
    f.receive do |g|
      g.when(:data, Symbol, Array) do |name, points|
        graph.data name, points
        g.receive_loop
      end
  
      g.when(:labels, Erl.hash) do |label_data|
        graph.labels = label_data
        g.receive_loop
      end
  
      g.when(:end){ :ok }
    end
    
    
    f.send! :result, graph.to_blob
    f.receive_loop
  end
    
end


Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
mojombo-erlectricity-0.2.1 examples/gruff/gruff_provider.rb
erlectricity-0.2.0 examples/gruff/gruff_provider.rb
erlectricity-0.2.1 examples/gruff/gruff_provider.rb