Class: MetricFu::RailsBestPracticesGchartGrapher

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

#labels, #rails_best_practices_count

Instance Method Summary collapse

Methods inherited from RailsBestPracticesGrapher

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

Instance Method Details

#graph!Object



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/graphs/engines/gchart.rb', line 140

def graph!
  determine_y_axis_scale(@rails_best_practices_count)
  url = Gchart.line(
    :size => GCHART_GRAPH_SIZE,
    :title => URI.escape("Rails Best Practices: design problems"),
    :data => self.rails_best_practices_count,
    :bar_colors => COLORS[0..1],
    :legend => ['Problems'],
    :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, 'rails_best_practices.png')
  )
end