def add_data data
@data = [] unless @data
raise "No data provided by #{conf.inspect}" unless data[:data] and
data[:data].kind_of? Array
raise "Data supplied must be title,from,to tripples! "+
"The data provided contained an odd set of "+
"data points" unless data[:data].length % 3 == 0
return if data[:data].length == 0
y = []
x_start = []
x_end = []
data[:data].each_index {|i|
im3 = i%3
if im3 == 0
y << data[:data][i]
else
arr = ParseDate.parsedate( data[:data][i] )
t = Time.local( *arr[0,6].compact )
(im3 == 1 ? x_start : x_end) << t.to_i
end
}
sort( x_start, x_end, y )
@data = [x_start, x_end, y ]
end