### Home Classes Methods

### In Files

- lib/SVG/Graph/DataPoint.rb

### Parent

Object

### Methods

- ::configure_shape_criteria
- ::new
- ::reset_shape_criteria
- #shape

### Class/Module Index

Quicksearch

- SVG
- SVG::Graph
- SVG::Graph::Bar
- SVG::Graph::BarBase
- SVG::Graph::BarHorizontal
- SVG::Graph::Graph
- SVG::Graph::Line
- SVG::Graph::Pie
- SVG::Graph::Plot
- SVG::Graph::Schedule
- SVG::Graph::TimeSeries
- DataPoint
- Object

No matching classes.

# DataPoint

### Constants

CRITERIA
DEFAULT_SHAPE
OVERLAY

### Public Class Methods

configure_shape_criteria(*matchers) click to toggle source

    # File lib/SVG/Graph/DataPoint.rb, line 11
    def DataPoint.configure_shape_criteria(*matchers)
      CRITERIA.push(*matchers)
    end

new(x, y, line) click to toggle source

    # File lib/SVG/Graph/DataPoint.rb, line 18
    def initialize(x, y, line)
      @x = x
      @y = y
      @line = line
    end

reset_shape_criteria() click to toggle source

    # File lib/SVG/Graph/DataPoint.rb, line 14
    def DataPoint.reset_shape_criteria
      CRITERIA.clear
    end

### Public Instance Methods

shape(description=nil) click to toggle source

    # File lib/SVG/Graph/DataPoint.rb, line 23
    def shape(description=nil)
      shapes = CRITERIA.select {|criteria|
        criteria.size == 2
      }.collect {|regexp, proc|
        proc.call(@x, @y, @line) if description =~ regexp
      }.compact
      shapes = [DEFAULT_SHAPE.call(@x, @y, @line)] if shapes.empty?

      overlays = CRITERIA.select { |criteria|
        criteria.last == OVERLAY
      }.collect { |regexp, proc|
        proc.call(@x, @y, @line) if description =~ regexp
      }.compact

      return shapes + overlays
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.