Created
February 19, 2017 15:02
-
-
Save picatz/e93879c98617e6a69ecef49393cf9622 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 "pi_charts" | |
# create a new line chart | |
chart = PiCharts::Bar.new | |
# add labels ( x values ) | |
chart.add_labels(["January", "February", "March", "April", "May"]) | |
# add datasets | |
chart.add_dataset(label: "cats", data: [ 2, 0, 4, 7, 3 ]) | |
chart.add_dataset(label: "dogs", data: [ 4, 6, 3, 9, 2 ]) | |
# stack'em up | |
chart.stack | |
# neat 'lil configurations | |
chart.hover | |
chart.responsive | |
# generate html / js for chart | |
puts chart.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment