Sha256: c296259581cdeb55a5be93ff35dc3657ea0daadbf28417204fb3d5e1cfc53429

Contents?: true

Size: 765 Bytes

Versions: 21

Compression:

Stored size: 765 Bytes

Contents

require 'fox16'
require 'google_chart'
require 'open-uri'

include Fox

class ChartsWindow < FXMainWindow
  def initialize(app)
    super(app, "Google Charts Demo", :width => 650, :height => 250)
    FXImageFrame.new(self, nil, :opts => LAYOUT_FILL) do |f|
      f.image = FXPNGImage.new(app, open(bar_chart.to_escaped_url, "rb").read)
    end
  end
  
  def bar_chart
    GoogleChart::BarChart.new('600x200', 'My Chart', :vertical) do |bc|
      bc.data 'Trend 1', [5,4,3,1,3,5], '0000ff'
      bc.data 'Trend 2', [1,2,3,4,5,6], 'ff0000'
      bc.data 'Trend 3', [6,5,4,4,5,6], '00ff00'
    end
  end

  def create
    super
    show(PLACEMENT_SCREEN)
  end
end

if __FILE__ == $0
  FXApp.new do |app|
    ChartsWindow.new(app)
    app.create
    app.run
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
fxruby-1.6.22.pre2-x86-mingw32 examples/charts.rb
fxruby-1.6.22.pre2 examples/charts.rb
fxrubi-1.6.22.pre1-x86-mingw32 examples/charts.rb
fxrubi-1.6.22.pre1 examples/charts.rb
fxruby-1.6.20-x86-mingw32 examples/charts.rb
fxruby-1.6.20-x86-linux examples/charts.rb
fxruby-1.6.20 examples/charts.rb
fxruby-1.6.20-universal-darwin-10 examples/charts.rb
fxruby-1.6.19-x86-mingw32 examples/charts.rb
fxruby-1.6.16-universal-darwin-9 examples/charts.rb
fxruby-1.6.16-x86-mswin32-60 examples/charts.rb
fxruby-1.6.17-universal-darwin-9 examples/charts.rb
fxruby-1.6.16 examples/charts.rb
fxruby-1.6.17-x86-mswin32-60 examples/charts.rb
fxruby-1.6.17 examples/charts.rb
fxruby-1.6.18-universal-darwin-9 examples/charts.rb
fxruby-1.6.18 examples/charts.rb
fxruby-1.6.18-x86-mswin32-60 examples/charts.rb
fxruby-1.6.19-universal-darwin-9 examples/charts.rb
fxruby-1.6.19-x86-mswin32-60 examples/charts.rb