lib/gruff/base.rb
# Draws a title on the graph.
Draws a title on the graph.
Draws a title on the graph .
def draw_title
      return if hide_title?
      metrics = Gruff::Renderer::Text.new(renderer, @title, font: @title_font).metrics
      if metrics.width > @raw_columns
        @title_font.size = @title_font.size * (@raw_columns / metrics.width) * 0.95
      end
      text_renderer = Gruff::Renderer::Text.new(renderer, @title, font: @title_font)
      text_renderer.add_to_render_queue(@raw_columns, 1.0, 0, @top_margin)
    end
def draw_title return if hide_title? metrics = Gruff :: Renderer :: Text . new ( renderer , @title , font : @title_font ) . metrics if metrics . width > @raw_columns @title_font . size = @title_font . size * ( @raw_columns / metrics . width ) * 0.95 end text_renderer = Gruff :: Renderer :: Text . new ( renderer , @title , font : @title_font ) text_renderer . add_to_render_queue ( @raw_columns , 1.0 , 0 , @top_margin ) end
Draws a title on the graph.
Draws a title on the graph .