# File lib/gruff/mini/legend.rb, line 44
      def draw_vertical_legend
        return if @hide_mini_legend

        legend_square_width = 40.0 # small square with color of this item
        legend_square_margin = 10.0
        @legend_left_margin = 100.0
        legend_top_margin = 40.0

        # May fix legend drawing problem at small sizes
        @d.font = @font if @font
        @d.pointsize = @legend_font_size

        case @legend_position
        when :right then
          current_x_offset = @original_columns + @left_margin
          current_y_offset = @top_margin + legend_top_margin
        else
          current_x_offset = @legend_left_margin
          current_y_offset = @original_rows + legend_top_margin
        end

        debug { @d.line 0.0, current_y_offset, @raw_columns, current_y_offset }

        @legend_labels.each_with_index do |legend_label, index|

          # Draw label
          @d.fill = @font_color
          @d.font = @font if @font
          @d.pointsize = scale_fontsize(@legend_font_size)
          @d.stroke = 'transparent'
          @d.font_weight = Magick::NormalWeight
          @d.gravity = Magick::WestGravity
          @d = @d.annotate_scaled( @base_image,
                                   @raw_columns, 1.0,
                                   current_x_offset + (legend_square_width * 1.7), current_y_offset,
                                   truncate_legend_label(legend_label), @scale)

          # Now draw box with color of this dataset
          @d = @d.stroke 'transparent'
          @d = @d.fill @data[index][Gruff::Base::DATA_COLOR_INDEX]
          @d = @d.rectangle(current_x_offset,
                            current_y_offset - legend_square_width / 2.0,
                            current_x_offset + legend_square_width,
                            current_y_offset + legend_square_width / 2.0)

          current_y_offset += calculate_line_height
        end
        @color_index = 0
      end