Merged r10439 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.1-stable@10520 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-09-29 16:26:08 +00:00
parent aac3e1e51c
commit 89ecbe9cdc
1 changed files with 2 additions and 5 deletions

View File

@ -1,5 +1,4 @@
require 'SVG/Graph/Plot' require 'SVG/Graph/Plot'
require 'parsedate'
module SVG module SVG
module Graph module Graph
@ -157,8 +156,7 @@ module SVG
y = [] y = []
data[:data].each_index {|i| data[:data].each_index {|i|
if i%2 == 0 if i%2 == 0
arr = ParseDate.parsedate( data[:data][i] ) t = DateTime.parse( data[:data][i] ).to_time
t = Time.local( *arr[0,6].compact )
x << t.to_i x << t.to_i
else else
y << data[:data][i] y << data[:data][i]
@ -173,8 +171,7 @@ module SVG
protected protected
def min_x_value=(value) def min_x_value=(value)
arr = ParseDate.parsedate( value ) @min_x_value = DateTime.parse( data[:data][i] ).to_time
@min_x_value = Time.local( *arr[0,6].compact ).to_i
end end