def legend_item(label, x, color, options)
      size, symbol_padding, entry_padding = 5, 3, 12
      x -= @pdf.width_of(label, size: 7).ceil
      @pdf.text_box label, options.merge(at: [x, @pdf.bounds.height])
      x -= (symbol_padding + size)
      with fill_color: color do
        @pdf.fill_rectangle [x, @pdf.bounds.height - size], size, size
      end
      x - entry_padding
    end
def legend_item(label, x, color, options)
      size, symbol_padding, entry_padding = 5, 3, 12
      x -= @pdf.width_of(label, size: 7).ceil
      @pdf.text_box label, options.merge(at: [x, @pdf.bounds.height])
      x -= (symbol_padding + size)
      with fill_color: color do
        @pdf.fill_rectangle [x, @pdf.bounds.height - size], size, size
      end
      x - entry_padding
    end
Draws a single item of the legend, which includes the label and the
 symbol with the matching color. Labels are written from right to left.
 @param