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