# File temp/Graph/BarHorizontal.rb, line 178 def draw_data fieldheight = field_height fieldwidth = field_width bargap = bar_gap ? (fieldheight < 10 ? fieldheight / 2 : 10) : 0 subbar_height = fieldheight - bargap subbar_height /= @data.length if stack == :side field_count = 1 y_mod = (subbar_height / 2) + (font_size / 2) @config[:fields].each_index { |i| dataset_count = 0 for dataset in @data y = @graph_height - (fieldheight * field_count) y += (subbar_height * dataset_count) if stack == :side x = dataset[:data][i] * fieldwidth @graph.add_element( "path", { "d" => "M0 #{y} H#{x} v#{subbar_height} H0 Z", "class" => "fill#{dataset_count+1}" }) make_datapoint_text( x+5, y+y_mod, dataset[:data][i], "text-anchor: start; " ) dataset_count += 1 end field_count += 1 } end