]> projects.mako.cc - selectricity-live/commitdiff
The legend is now hidden when there is only one color to display on a graph.
author<jlsharps@mit.edu> <>
Mon, 3 Sep 2007 06:32:34 +0000 (02:32 -0400)
committer<jlsharps@mit.edu> <>
Mon, 3 Sep 2007 06:32:34 +0000 (02:32 -0400)
app/controllers/graph_controller.rb

index f956c0bf665890e9962c549739fd1bbe28d99b4c..0ef4e71a3ae145c78a19bcb1b1c7c88484c82e2b 100644 (file)
@@ -46,6 +46,7 @@ class GraphController < ApplicationController
         end
       else #one dimensional array, just pass it in
       @graph.data( options.fetch(:data_name, "Data"), options[:data] )
+      @graph.hide_legend = true
       end
       
       # set the labels or create an empty hash
@@ -88,6 +89,8 @@ class GraphController < ApplicationController
     @election = Election.find(params[:id])
     data, labels, scale = get_votes_per_interval_data(@election)
     
+    hide_legend = true
+    
     graph = GruffGraff.new( :graph_type => Gruff::Line,
                             :data_name => @election.name,
                             :data => data,

Benjamin Mako Hill || Want to submit a patch?