def draw_data
fieldheight = field_height
fieldwidth = field_width
bargap = bar_gap ? (fieldheight < 10 ? fieldheight / 2 : 10) : 0
subbar_height = fieldheight - bargap
field_count = 1
y_mod = (subbar_height / 2) + (font_size / 2)
min,max,div = x_range
scale = (@graph_width.to_f - font_size*2) / (max-min)
@data[0].each_index { |i|
x_start = @data[0][i]
x_end = @data[1][i]
y = @graph_height - (fieldheight * field_count)
bar_width = (x_end-x_start) * scale
bar_start = x_start * scale - (min * scale)
@graph.add_element( "rect", {
"x" => bar_start.to_s,
"y" => y.to_s,
"width" => bar_width.to_s,
"height" => subbar_height.to_s,
"class" => "fill#{field_count+1}"
})
field_count += 1
}
end