# File lib/chart-candy/builder/donut.rb, line 14 def add_slice(name, value, options={}) options.reverse_merge! txt_vars: {} return if value.to_i <= 0 value = value.round(2) if money? valuef = money? ? format_money(value) : value options[:txt_vars][:value] = valuef label_str = t("slices.#{name}.label", options[:txt_vars]) tooltip = t("slices.#{name}.tooltip", options[:txt_vars]) @chart[:slices] << { label: label_str, percent: 0, tooltip: tooltip, value: value, valuef: valuef } end