From: Date: Mon, 3 Sep 2007 06:32:34 +0000 (-0400) Subject: The legend is now hidden when there is only one color to display on a graph. X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/45d48f668c0159ebae18fecb76b3b94f79f87d24 The legend is now hidden when there is only one color to display on a graph. --- diff --git a/app/controllers/graph_controller.rb b/app/controllers/graph_controller.rb index f956c0b..0ef4e71 100644 --- a/app/controllers/graph_controller.rb +++ b/app/controllers/graph_controller.rb @@ -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,