Class: MetricFu::ReekGchartGrapher

Inherits:
ReekGrapher show all
Defined in:
lib/graphs/engines/gchart.rb

Constant Summary

Constants inherited from Grapher

Grapher::BLUFF_DEFAULT_OPTIONS, Grapher::BLUFF_GRAPH_SIZE

Constants included from GchartGrapher

GchartGrapher::COLORS, GchartGrapher::GCHART_GRAPH_SIZE, GchartGrapher::NUMBER_OF_TICKS

Instance Attribute Summary

Attributes inherited from ReekGrapher

#labels, #reek_count

Instance Method Summary collapse

Methods inherited from ReekGrapher

#get_metrics, #initialize

Methods inherited from Grapher

#initialize, require_graphing_gem

Methods included from GchartGrapher

#determine_y_axis_scale

Constructor Details

This class inherits a constructor from MetricFu::ReekGrapher

Instance Method Details

#graph!Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/graphs/engines/gchart.rb', line 84

def graph!
  determine_y_axis_scale(@reek_count.values.flatten.uniq)
  values = []
  legend = @reek_count.keys.sort
  legend.collect {|k| values << @reek_count[k]}

  url = Gchart.line(
    :size => GCHART_GRAPH_SIZE,
    :title => URI.escape("Reek: code smells"),
    :data => values,
    :stacked => false,
    :bar_colors => COLORS,
    :legend => legend,
    :custom => "chdlp=t",
    :max_value => @max_value,
    :axis_with_labels => 'x,y',
    :axis_labels => [@labels.values, @yaxis],
    :format => 'file',
    :filename => File.join(MetricFu.output_directory, 'reek.png'))
end