summaryrefslogtreecommitdiff
path: root/report/plot_factory.rb
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-03-30 16:49:46 +0200
committerMartin Gütlein <martin.guetlein@gmail.com>2010-03-30 16:49:46 +0200
commit1a9419d158ede2535ae10b84d044da6a2cf89cfa (patch)
tree885b03c9018e78d61bf497bda8addc925d2857ae /report/plot_factory.rb
parentae0b071c42c37ea974aa234f30a3a8cb77aa7eb3 (diff)
mostly munich changes
Diffstat (limited to 'report/plot_factory.rb')
-rw-r--r--report/plot_factory.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/report/plot_factory.rb b/report/plot_factory.rb
index 4226b02..e248540 100644
--- a/report/plot_factory.rb
+++ b/report/plot_factory.rb
@@ -51,6 +51,8 @@ module Reports
LOGGER.debug "creating bar plot, out-file:"+out_file.to_s
data = []
+ titles = []
+
validation_set.validations.each do |v|
values = []
value_attributes.each do |a|
@@ -68,7 +70,13 @@ module Reports
values.push(value)
end
- data << [v.send(title_attribute).to_s] + values
+ titles << v.send(title_attribute).to_s
+ data << values
+ end
+
+ titles = titles.remove_common_prefix
+ (0..titles.size-1).each do |i|
+ data[i] = [titles[i]] + data[i]
end
labels = value_attributes.collect{|a| a.to_s.gsub("_","-")}
@@ -77,7 +85,6 @@ module Reports
LOGGER.debug "bar plot data: "+data.inspect
RubyPlot::plot_bars('Bar plot', labels, data, out_file)
-
end