Class: PDF::Charts::StdDev::Scale

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/charts/stddev.rb

Overview

The scale of the dataset.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = { }) {|_self| ... } ⇒ Scale

Returns a new instance of Scale.

Yields:

  • (_self)

Yield Parameters:

Raises:

  • (TypeError)


52
53
54
55
56
57
58
59
60
61
62
# File 'lib/pdf/charts/stddev.rb', line 52

def initialize(args = { })
  @range        = args[:range]
  @step         = args[:step]
  @style        = args[:style]
  @show_labels  = false

  yield self if block_given?

  raise TypeError, PDF::Lange[:charts_stddev_scale_norange] if @range.nil?
  raise TypeError, PDF::Lange[:charts_stddev_scale_nostep] if @step.nil?
end

Instance Attribute Details

#firstObject

:nodoc:



68
69
70
# File 'lib/pdf/charts/stddev.rb', line 68

def first
  @first
end

#labelObject

Defines the label options.



94
95
96
# File 'lib/pdf/charts/stddev.rb', line 94

def label
  @label
end

#lastObject

:nodoc:



77
78
79
# File 'lib/pdf/charts/stddev.rb', line 77

def last
  @last
end

#rangeObject

Range of the scale. This should be a Range object.



65
66
67
# File 'lib/pdf/charts/stddev.rb', line 65

def range
  @range
end

#show_labelsObject

Shows the scale labels if true.



92
93
94
# File 'lib/pdf/charts/stddev.rb', line 92

def show_labels
  @show_labels
end

#stepObject

Defines the step of the scale. Each step represents a vertical position on the chart.



86
87
88
# File 'lib/pdf/charts/stddev.rb', line 86

def step
  @step
end

#styleObject

Defines the line style for the scale on the chart. If this is unset (nil), there will be no horizontal marks across the chart for the steps of the scale.



90
91
92
# File 'lib/pdf/charts/stddev.rb', line 90

def style
  @style
end