Sha256: 6a338a7d9afc90ac2950271cf92ae5e97a6e8baef7f3bbca4449107455d284a0

Contents?: true

Size: 909 Bytes

Versions: 74

Compression:

Stored size: 909 Bytes

Contents

require 'fox16'

begin
  require 'google_chart'
  require 'open-uri'
rescue LoadError
  warn("LoadError: To execute this app you need to have 'google_chart' gem installed.")
  sleep(5)
  exit(false)
end

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

74 entries across 74 versions & 1 rubygems

Version Path
fxruby-1.6.48 examples/charts.rb
fxruby-1.6.48-x64-mingw32 examples/charts.rb
fxruby-1.6.48-x64-mingw-ucrt examples/charts.rb
fxruby-1.6.48-x86-mingw32 examples/charts.rb
fxruby-1.6.47 examples/charts.rb
fxruby-1.6.47-x64-mingw-ucrt examples/charts.rb
fxruby-1.6.47-x64-mingw32 examples/charts.rb
fxruby-1.6.47-x86-mingw32 examples/charts.rb
fxruby-1.6.46 examples/charts.rb
fxruby-1.6.46-x64-mingw32 examples/charts.rb
fxruby-1.6.46-x64-mingw-ucrt examples/charts.rb
fxruby-1.6.46-x86-mingw32 examples/charts.rb
fxruby-1.6.45 examples/charts.rb
fxruby-1.6.45-x64-mingw32 examples/charts.rb
fxruby-1.6.45-x64-mingw-ucrt examples/charts.rb
fxruby-1.6.45-x86-mingw32 examples/charts.rb
fxruby-1.6.44 examples/charts.rb
fxruby-1.6.44-x64-mingw32 examples/charts.rb
fxruby-1.6.44-x86-mingw32 examples/charts.rb
fxruby-1.6.43 examples/charts.rb