Created
February 19, 2017 14:13
-
-
Save picatz/8ee9cb9f1e2f15220600d80edf355fc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'pi_charts' | |
def bake_pie | |
chart = PiCharts::Pie.new | |
chart.add_dataset(label: "cats", data: 80) | |
chart.add_dataset(label: "dogs", data: 50) | |
chart.hover | |
chart.responsive | |
"<head>" + chart.cdn + "</head>" + "<body>" + chart.html(width: 60) + "</body>" | |
end | |
get('/serve_pie') { bake_pie } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment