def expand_canvas_for_vertical_legend
return if @hide_mini_legend
@legend_labels = @data.collect {|item| item[Gruff::Base::DATA_LABEL_INDEX] }
legend_height = scale_fontsize(
@data.length * calculate_line_height +
@top_margin + @bottom_margin)
@original_rows = @raw_rows
@original_columns = @raw_columns
case @legend_position
when :right then
@rows = [@rows, legend_height].max
@columns += calculate_legend_width + @left_margin
else
@rows += @data.length * calculate_caps_height(scale_fontsize(@legend_font_size)) * 1.7
end
render_background
end