draw_data (SVG::Graph::Bar)

    # File temp/Graph/Bar.rb, line 160
          def draw_data
            fieldwidth = field_width
            fieldheight = field_height
            bargap = bar_gap ? (fieldwidth < 10 ? fieldwidth / 2 : 10) : 0

            subbar_width = fieldwidth - bargap
            subbar_width /= @data.length if stack == :side
            x_mod = (@graph_width-bargap)/2 - (stack==:side ? subbar_width/2 : 0)
            # Y1
            p2 = @graph_height
            # to X2
            field_count = 0
            @config[:fields].each_index { |i|
              dataset_count = 0
              for dataset in @data
                # X1
                p1 = (fieldwidth * field_count)
                # to Y2
                p3 = @graph_height - (dataset[:data][i] * fieldheight)
                p1 += subbar_width * dataset_count if stack == :side
                @graph.add_element( "path", {
                  "class" => "fill#{dataset_count+1}",
                  "d" => "M#{p1} #{p2} V#{p3} h#{subbar_width} V#{p2} Z"
                })
                if show_data_values
                  @graph.add_element( "text", {
                    "x" => p1 + subbar_width/2,
                    "y" => p3 - 6,
                    "class" => "dataPointLabel"
                  } ).text = dataset[:data][i].to_s
                end
                dataset_count += 1
              end
              field_count += 1
            }
          end