Sha256: 28b2c06c72c0f37a06783820bc16daea06ae8ffd7d8b122e7d8ee56aaaa1fc63

Contents?: true

Size: 764 Bytes

Versions: 26

Compression:

Stored size: 764 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

26 entries across 26 versions & 1 rubygems

Version Path
fxruby-1.6.28-x86-mingw32 examples/charts.rb
fxruby-1.6.28-x64-mingw32 examples/charts.rb
fxruby-1.6.28 examples/charts.rb
fxruby-1.6.27-x86-mingw32 examples/charts.rb
fxruby-1.6.27-x64-mingw32 examples/charts.rb
fxruby-1.6.27 examples/charts.rb
fxruby-1.6.26-x86-mingw32 examples/charts.rb
fxruby-1.6.26 examples/charts.rb
fxruby-1.6.26.pre1-x86-mingw32 examples/charts.rb
fxruby-1.6.26.pre1 examples/charts.rb
fxruby-1.6.25-x86-mingw32 examples/charts.rb
fxruby-1.6.25 examples/charts.rb
fxruby-1.6.25.pre2-x86-mingw32 examples/charts.rb
fxruby-1.6.25.pre2 examples/charts.rb
fxruby-1.6.25.pre1-x86-mingw32 examples/charts.rb
fxruby-1.6.25.pre1 examples/charts.rb
fxruby-1.6.24-x86-mingw32 examples/charts.rb
fxruby-1.6.24 examples/charts.rb
fxruby-1.6.23-x86-mingw32 examples/charts.rb
fxruby-1.6.23 examples/charts.rb