Class: ReportEngine::Pdf::QuestionStats

Inherits:
QuestionStats show all
Defined in:
lib/report_engine/pdf/question_stats.rb

Instance Method Summary collapse

Constructor Details

#initialize(canvas, options) ⇒ QuestionStats

TODO: Remove initializer



6
7
8
# File 'lib/report_engine/pdf/question_stats.rb', line 6

def initialize(canvas, options)
  super
end

Instance Method Details

#renderObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/report_engine/pdf/question_stats.rb', line 10

def render
  @canvas.add_block do |pdf|
    pdf.bounding_box([0, pdf.cursor], :width => pdf.bounds.width) do
      pdf.text @text, :size => 10
    end
    pdf.move_down(10)
    pdf.bounding_box([10, pdf.cursor], :width => pdf.bounds.width - 10) do
      pdf.image open(@canvas.paint(@chart[:type], @chart)), :scale => 0.6
    end
    pdf.bounding_box([20, pdf.cursor], :width => pdf.bounds.width - 20) do
      @canvas.paint(@details[:type], @details)
    end
    pdf.move_down(10)
  end
end