I am attempting to create a pie chart using the gruff gem, but my chart is a black abyss regardless of what I do. This is my code:
association_disposition_pie_chart = Gruff::Pie.new
association_disposition_pie_chart.title = "Visual Pie Graph Test"
association_disposition_pie_chart.data 'Solved', 10
association_disposition_pie_chart.data 'Action Required', 50
association_disposition_pie_chart.theme = {
:colors => ['#A5D8D8', '#EFAD1C'],
:font_color => 'black',
:background_colors => 'white'
}
association_disposition_pie_chart.write("association_disposition_pie_chart.jpg")
Why is this creating a black pie chart? The background is white, the font_color is black, but so is the entire chart. I want the chart pieces to be the colors specified in :colors.
EDIT
Screenshot:
This is mentioned in the documentation:
Although the source is more helpful:
I think maybe the problem is your
colorsattribute -:colors => ['#A5D8D8', '#EFAD1C']- as Shaun Frost Duke Jackson mentioned, it looks like you need to useadd_color('#c0e9d3')to do that, but the documentation isn't clear where you do that if you're defining the theme in line. It might be easier to add your own theme in theTHEMESmodule:which is then called with
g.theme = Gruff::Themes::LUIGIS_THEME