From f694a575013fef53ef27a1e4415c4039531fbfbe Mon Sep 17 00:00:00 2001 From: mguetlein Date: Wed, 25 May 2011 14:08:58 +0200 Subject: fix: bar-plot format changed from svg to png --- report/plot_factory.rb | 9 ++++++--- report/report_content.rb | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/report/plot_factory.rb b/report/plot_factory.rb index d09e506..78d2e05 100644 --- a/report/plot_factory.rb +++ b/report/plot_factory.rb @@ -163,9 +163,10 @@ module Reports end - def self.create_bar_plot( out_file, validation_set, title_attribute, value_attributes ) + def self.create_bar_plot( out_files, validation_set, title_attribute, value_attributes ) - LOGGER.debug "creating bar plot, out-file:"+out_file.to_s + out_files = [out_files] unless out_files.is_a?(Array) + LOGGER.debug "creating bar plot, out-files:"+out_files.inspect data = [] titles = [] @@ -214,7 +215,9 @@ module Reports LOGGER.debug "bar plot labels: "+labels.inspect LOGGER.debug "bar plot data: "+data.inspect - RubyPlot::plot_bars('Bar plot', labels, data, out_file) + out_files.each do |out_file| + RubyPlot::plot_bars('Bar plot', labels, data, out_file) + end end diff --git a/report/report_content.rb b/report/report_content.rb index 755147d..a554881 100755 --- a/report/report_content.rb +++ b/report/report_content.rb @@ -287,9 +287,10 @@ class Reports::ReportContent section_bar = @xml_report.add_section(@current_section, section_title) @xml_report.add_paragraph(section_bar, section_text) if section_text - plot_bar = add_tmp_file("bar_plot", "svg") - Reports::PlotFactory.create_bar_plot(plot_bar[:path], validation_set, title_attribute, value_attributes ) - @xml_report.add_imagefigure(section_bar, image_title, plot_bar[:name], "PNG", 100, image_caption) + plot_png = add_tmp_file("bar_plot", "png") + plot_svg = add_tmp_file("bar_plot", "svg") + Reports::PlotFactory.create_bar_plot([plot_png[:path], plot_svg[:path]], validation_set, title_attribute, value_attributes ) + @xml_report.add_imagefigure(section_bar, image_title, plot_png[:name], "PNG", 100, plot_svg[:name]) end private -- cgit v1.2.3