Sha256: 612872074930fb9c62c0f3178a29f107b66a323d4b4982057c776b55d2dae1ab

Contents?: true

Size: 514 Bytes

Versions: 5

Compression:

Stored size: 514 Bytes

Contents

# path setting magic for example directory only
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require "chart_js"
require "sinatra"

set :bind, "0.0.0.0"

get "/" do
  chart = ChartJS.line do
    data do
      labels ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
      dataset "Cats" do
        color :random
        data [12, 19, 3, 5, 2, 3]
      end 
      dataset "Dogs" do
        color :random
        data [10, 12, 3, 4, 5, 3]
      end 
    end
  end
  chart.to_html
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chart_js-1.1.1 examples/sinatra.rb
chart_js-1.1.0 examples/sinatra.rb
chart_js-1.0.0 examples/sinatra.rb
chart_js-1.0.1pre examples/sinatra.rb
chart_js-1.0.0pre examples/sinatra.rb