Module Scruffy::Helpers::LayerContainer
In: lib/scruffy/helpers/layer_container.rb
Graph Pie Stacked Base ValueMarkers Legend Label Graphs Title Grid Background DataMarkers StyleInfo Viewport Base Empty Standard Cubed3d Cubed Split Pie Sparkline Reversed StandardError RenderError Base AllSmiles Area SparklineBar PieSlice Average Scatter Bar Line Base Number Percentage Currency Custom Base Tulips Vitamins CareBears Apples RubyBlog Mephisto Keynote GraphState BatikRasterizer RMagickRasterizer Components Rasterizers Renderers LayerContainer Hash Array PointContainer Canvas Helpers VERSION Layers Formatters Themes Scruffy dot/f_4.png

Scruffy::Helpers::LayerContainer

Author:Brasten Sager
Date:August 16th, 2006

Adds some common functionality to any object which needs to act as a container for graph layers. The best example of this is the Scruffy::Graph object itself, but this module is also used by Scruffy::Layer::Stacked.

Methods

<<   add   layers   layers=  

Public Instance methods

Adds a Layer to the Graph/Container. Accepts either a list of arguments used to build a new layer, or a Scruffy::Layers::Base-derived object. When passing a list of arguments, all arguments are optional, but the arguments specified must be provided in a particular order: type (Symbol), title (String), points (Array), options (Hash).

Both add and #<< can be used.

  graph.add(:line, [100, 200, 150])     # Create and add an untitled line graph

  graph << (:line, "John's Sales", [150, 100])    # Create and add a titled line graph

  graph << Scruffy::Layers::Bar.new({...})   # Adds Bar layer to graph
add(*args, &block)

Alias for #<<

Layer Reader

Layer Writer

[Validate]