Sha256: a3b2c0dd3b8a935e5a5d2167f72bae7f6b0d0673434a3217dab307ecb7d9c519

Contents?: true

Size: 461 Bytes

Versions: 1

Compression:

Stored size: 461 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require "pi_charts"

# create a new line chart
chart = PiCharts::Line.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, 7])
chart.add_dataset(label: "dogs", data: [7, 3, 3, 1, 3])

# 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/line_chart.rb