lib/gruff/area.rb
# Specifies the filling opacity in area graph. Default is +0.85+.
Specifies the filling opacity in area graph.
Specifies the filling opacity in area graph .
def draw_graph
    x_increment = @graph_width / (column_count - 1).to_f
    store.norm_data.each do |data_row|
      poly_points = []
      data_row.points.each_with_index do |data_point, index|
        new_x = @graph_left + (x_increment * index)
        new_y = @graph_top + (@graph_height - data_point * @graph_height)
        poly_points << new_x
        poly_points << new_y
        draw_label(new_x, index)
      end
      poly_points << @graph_right
      poly_points << @graph_bottom - 1
      poly_points << @graph_left
      poly_points << @graph_bottom - 1
      Gruff::Renderer::Polygon.new(renderer, color: data_row.color, width: @stroke_width, opacity: @fill_opacity).render(poly_points)
    end
  end
def draw_graph x_increment = @graph_width / ( column_count - 1 ) . to_f store . norm_data . each do | data_row | poly_points = [ ] data_row . points . each_with_index do | data_point , index | new_x = @graph_left + ( x_increment * index ) new_y = @graph_top + ( @graph_height - data_point * @graph_height ) poly_points << new_x poly_points << new_y draw_label ( new_x , index ) end poly_points << @graph_right poly_points << @graph_bottom - 1 poly_points << @graph_left poly_points << @graph_bottom - 1 Gruff :: Renderer :: Polygon . new ( renderer , color : data_row . color , width : @stroke_width , opacity : @fill_opacity ) . render ( poly_points ) end end
Specifies the filling opacity in area graph.
Specifies the filling opacity in area graph .
# Use incremented x and scaled y # Add closing points, draw polygon