topfunky / gruff

Gruff graphing library for Ruby
http://gruff.rubyforge.org
MIT License
1.37k stars 239 forks source link

Bar chart transparent background #630

Closed HarlemSquirrel closed 8 months ago

HarlemSquirrel commented 8 months ago

Description

Is there a way to make the bar chart background transparent? It does not appear that the alpha value in rbga is working for the theme background colors and g.transparent_background = true is not available for StackedBar or Bar

Steps to Reproduce

Try to set a background color with some transparency using a theme'

g = Gruff::StackedBar.new(800)
g.theme = {
  background_colors: ["rgba(75, 192, 192, 0.2)", "rgba(75, 192, 192, 0.2)"]
}

Image is not transparent.

Try to set transparent_background and get an error

g = Gruff::StackedBar.new(800)
g.transparent_background = true
# => NoMethodError: undefined method `transparent_background=' for #<Gruff::Bar:0x00007bb548bafc88

System Configuration

Watson1978 commented 8 months ago

Just released gruff 0.24.0. Please use it. Thanks.