# File temp/Graph/BarHorizontal.rb, line 176 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}" }) if show_data_values @graph.add_element( "text", { "x" => x + 5, "y" => y + y_mod, "class" => "dataPointLabel", "style" => "text-anchor: start;" }).text = dataset[:data][i] end dataset_count += 1 end field_count += 1 } end