lib/gruff/base.rb
# Draw the optional labels for the x axis and y axis.
Draw the optional labels for the x axis and y axis.
Draw the optional labels for the x axis and y axis .
def draw_axis_labels
      if @x_axis_label
        x_axis_label_y_coordinate = @graph_bottom + LABEL_MARGIN + @marker_caps_height
        text_renderer = Gruff::Renderer::Text.new(renderer, @x_axis_label, font: @marker_font)
        text_renderer.add_to_render_queue(@raw_columns, 1.0, 0.0, x_axis_label_y_coordinate)
      end
      if @y_axis_label
        text_renderer = Gruff::Renderer::Text.new(renderer, @y_axis_label, font: @marker_font, rotation: -90)
        text_renderer.add_to_render_queue(1.0, @raw_rows, @left_margin + @marker_caps_height / 2.0, 0.0, Magick::CenterGravity)
      end
    end
def draw_axis_labels if @x_axis_label x_axis_label_y_coordinate = @graph_bottom + LABEL_MARGIN + @marker_caps_height text_renderer = Gruff :: Renderer :: Text . new ( renderer , @x_axis_label , font : @marker_font ) text_renderer . add_to_render_queue ( @raw_columns , 1.0 , 0.0 , x_axis_label_y_coordinate ) end if @y_axis_label text_renderer = Gruff :: Renderer :: Text . new ( renderer , @y_axis_label , font : @marker_font , rotation : - 90 ) text_renderer . add_to_render_queue ( 1.0 , @raw_rows , @left_margin + @marker_caps_height / 2.0 , 0.0 , Magick :: CenterGravity ) end end
Draw the optional labels for the x axis and y axis.
Draw the optional labels for the x axis and y axis .
# X Axis # Centered vertically and horizontally by setting the # height to 1.0 and the width to the width of the graph. # TODO: Center between graph area # Y Axis, rotated vertically