Sha256: 1a49cfddfe2c78e4e85e698e0227a79187e4220a617efc813d465e38b9e5157f

Contents?: true

Size: 669 Bytes

Versions: 6

Compression:

Stored size: 669 Bytes

Contents

# = First example (RBP API)
# This is the RBP API version of "Getting Started" example of Protovis introduction.
# On this example we  build a bar chart using panel and bar marks.
# A mark represents a set of graphical elements that share data and visual encodings. Although marks are simple by themselves, you can combine them in interesting ways to make rich, interactive visualizations
$:.unshift(File.dirname(__FILE__)+"/../lib")
require 'rubyvis'
    
vis = Rubyvis::Panel.new do 
  width 150
  height 150
  bar do
    data [1, 1.2, 1.7, 1.5, 0.7, 0.3]
    width 20
    height {|d| d * 80}
    bottom(0)
    left {index * 25}
  end
end

vis.render
puts vis.to_svg

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubyvis-0.3.3 examples/first_rbp_api.rb
rubyvis-0.3.2 examples/first_rbp_api.rb
rubyvis-0.3.1 examples/first_rbp_api.rb
rubyvis-0.3.0 examples/first_rbp_api.rb
rubyvis-0.2.2 examples/first_rbp_api.rb
rubyvis-0.2.1 examples/first_rbp_api.rb