molten-trunk/molten5_withgrid/app/helpers/solutions_helper.rb
def horizontal_bar_graph(*data)
    html = <<-"HTML"
      <style>
      /* Basic Bar Graph */
      .graph { 
        position: relative; /* IE is dumb */
        width: 200px; 
        #border: 1px solid #B1D632; 
        padding: 2px; 
        margin-bottom: .5em;					
      }
      .graph .bar { 
        display: block;	
        position: relative;
        background: #E8112D;
        text-align: center; 
        color: #333; 
        height: 2em; 
        line-height: 2em;									
      }
      .graph .bar span { position: relative; left: 10em; } /* This extra markup is necessary because IE does not want to follow the rules for overflow: visible */	 
      </style>
    HTML
    
    data.each do |d|
      html += <<-"HTML"
        <div class="graph">#{d[0]}
<strong class="bar" style="width: #{d[1]}%;" title="#{d[0].to_s.humanize}"><span>#{d[1]}%</span> </strong>
        </div>
      HTML
    end
    return html
  end
# Make a horizontal graph that only shows percentages.
#
# The label will be set as the title of the bar element.
#
#  horizontal_bar_graph ["Stout", 10], ["IPA", 80], ["Pale Ale", 50], ["Milkshake", 30]
# 
Make a horizontal graph that only shows percentages.
The label will be set as the title of the bar element.


Make a horizontal graph that only shows percentages . The label will be set as the title of the bar element .
def horizontal_bar_graph(*data)
    html = <<-"HTML"
      <style>
      /* Basic Bar Graph */
      .graph { 
        position: relative; /* IE is dumb */
        width: 200px; 
        #border: 1px solid #B1D632; 
        padding: 2px; 
        margin-bottom: .5em;					
      }
      .graph .bar { 
        display: block;	
        position: relative;
        background: #E8112D;
        text-align: center; 
        color: #333; 
        height: 2em; 
        line-height: 2em;									
      }
      .graph .bar span { position: relative; left: 10em; } /* This extra markup is necessary because IE does not want to follow the rules for overflow: visible */	 
      </style>
    HTML
    data.each do |d|
      html += <<-"HTML"
        <div class="graph">#{d[0]}
<strong class="bar" style="width: #{d[1]}%;" title="#{d[0].to_s.humanize}"><span>#{d[1]}%</span> </strong>
        </div>
      HTML
    end
    return html
  end
def horizontal_bar_graph ( * data ) html = <<-"HTML" 
      <style>
      /* Basic Bar Graph */
      .graph { 
        position: relative; /* IE is dumb */
        width: 200px; 
        #border: 1px solid #B1D632; 
        padding: 2px; 
        margin-bottom: .5em;					
      }
      .graph .bar { 
        display: block;	
        position: relative;
        background: #E8112D;
        text-align: center; 
        color: #333; 
        height: 2em; 
        line-height: 2em;									
      }
      .graph .bar span { position: relative; left: 10em; } /* This extra markup is necessary because IE does not want to follow the rules for overflow: visible */	 
      </style>
     HTML data . each do | d | html += <<-"HTML" 
        <div class="graph"> #{ d [ 0 ] } 
<strong class="bar" style="width:  #{ d [ 1 ] } %;" title=" #{ d [ 0 ] . to_s . humanize } "><span> #{ d [ 1 ] } %</span> </strong>
        </div>
       HTML end return html end
Make a horizontal graph that only shows percentages.
Make a horizontal graph that only shows percentages .
data