Sha256: a7d8c6cb68575e9f7051aad3a65f392c01e86629a7911d2cbfbb0e7d3d5a6487

Contents?: true

Size: 536 Bytes

Versions: 1

Compression:

Stored size: 536 Bytes

Contents

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

# create a new doughnut chart
chart = PiCharts::Doughnut.new

# add datasets
chart.add_dataset(label: "cats", data: 80)
chart.add_dataset(label: "dogs", data: 20)

# make cats 90
chart.add_dataset(label: "cats", data: 10, add: true)

# make dogs 10, not adding
chart.add_dataset(label: "dogs", data: 10)

# make the cutout 70 percent
chart.cutout(70)

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