Sha256: 739a121069195b2f1150bad134e0b02ba2a40997d43ae833fef6bf3895dfa738

Contents?: true

Size: 485 Bytes

Versions: 1

Compression:

Stored size: 485 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
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: [ 3, 1, 3, 3 ])
chart.add_dataset(label: "dogs", data: [ 7, 3, 3, 1 ])

# stack'em up
chart.stack

# neat 'lil configurations
chart.hover
chart.responsive

# generate html / js for chart
puts chart.html

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pi_charts-1.0.0 examples/bar_chart_stacked.rb