Class: MetricFu::FlogGchartGrapher

Inherits:
FlogGrapher 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 FlogGrapher

#flog_average, #labels, #top_five_percent_average

Instance Method Summary collapse

Methods inherited from FlogGrapher

#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::FlogGrapher

Instance Method Details

#graph!Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/graphs/engines/gchart.rb', line 50

def graph!
  determine_y_axis_scale(@top_five_percent_average + @flog_average)
  url = Gchart.line(
    :size => GCHART_GRAPH_SIZE,
    :title => URI.escape("Flog: code complexity"),
    :data => [@flog_average, @top_five_percent_average],
    :stacked => false,
    :bar_colors => COLORS[0..1],
    :legend => ['average', 'top 5% average'],
    :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, 'flog.png'))
end