From 45d48f668c0159ebae18fecb76b3b94f79f87d24 Mon Sep 17 00:00:00 2001 From: Date: Mon, 3 Sep 2007 02:32:34 -0400 Subject: [PATCH 1/1] The legend is now hidden when there is only one color to display on a graph. --- app/controllers/graph_controller.rb | 3 +++ 1 file changed, 3 insertions(+) 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, -- 2.39.5