Sha256: c38f279765bd50573dcee4ccf02f22bfd0caa29484020ed9d16a089fb98dcb2e
Contents?: true
Size: 693 Bytes
Versions: 1
Compression:
Stored size: 693 Bytes
Contents
module PiCharts class Doughnut < Pie def create!(args={}) @config.data[:type] = 'doughnut' @config.data[:data][:datasets] = [] label = args[:label] || "" data = args[:data] || [] color = args[:color] || [] data = { data: data, backgroundColor: color, label: label } @config.data[:data][:datasets] << data @config.data[:options][:cutoutpercentage] = 50 @config.data[:data][:labels] = [] true end def cutout(percentage=false) if percentage @config.data[:options][:cutoutpercentage] = percentage true else @config.data[:options][:cutoutPercentage] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pi_charts-1.0.0 | lib/pi_charts/doughnut_chart.rb |