Bug 53622

Configurable font and font size for graphs


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@471 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2009-10-15 10:09:27 +00:00
parent ccf93bbb3e
commit f2bfceb72a
7 changed files with 48 additions and 1 deletions

View File

@ -67,6 +67,18 @@ sub get_param_list {
default => '5'
},
{
name => 'graph_font',
type => 't',
default => '',
},
{
name => 'graph_font_size',
type => 't',
default => '8',
},
);
return @param_list;
}

View File

@ -23,6 +23,7 @@
use strict;
use lib qw(. lib);
use GD::Text;
use Bugzilla;
use Bugzilla::Constants;

View File

@ -49,5 +49,7 @@
webtwopibase => "Alternative program or URL for plotting dependency graphs (for example /usr/bin/twopi). May be slow sometimes.",
graph_rankdir => "Default dependency graph orientation",
localdottimeout => "Timeout for locally executed Graphviz instances in seconds",
graph_font => "Font name or path to TrueType font file to use on graphs",
graph_font_size => "Font size in points to use on graphs",
}
%]

View File

@ -44,7 +44,15 @@
"lpurple", "lorange", "black", "green",
"blue", "dpink", "lbrown", "gray",
"red", "dpurple", "gold", "marine"]);
graph.set_legend_font(Param('graph_font'), Param('graph_font_size'));
graph.set_title_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_values_font(Param('graph_font'), Param('graph_font_size'));
# Workaround for the fact that set_legend won't take chart.labels directly,
# because chart.labels is an array reference rather than an array.
graph.set_legend(chart.labels.0, chart.labels.1, chart.labels.2,

View File

@ -68,6 +68,14 @@
graph.set(cumulate => "true",
show_values => 0) IF cumulate;
graph.set_legend_font(Param('graph_font'), Param('graph_font_size'));
graph.set_title_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_values_font(Param('graph_font'), Param('graph_font_size'));
# Workaround for the fact that set_legend won't take row_names directly,
# because row_names is an array reference rather than an array.
graph.set_legend(row_names.0, row_names.1, row_names.2, row_names.3,

View File

@ -70,6 +70,14 @@
"blue", "dpink", "lbrown", "gray",
"red", "dpurple", "gold", "marine"]);
graph.set_legend_font(Param('graph_font'), Param('graph_font_size'));
graph.set_title_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_values_font(Param('graph_font'), Param('graph_font_size'));
# Workaround for the fact that set_legend won't take row_names directly,
# because row_names is an array reference rather than an array.
graph.set_legend(row_names.0, row_names.1, row_names.2, row_names.3,

View File

@ -42,6 +42,14 @@
suppress_angle => 2,
start_angle => 180);
graph.set_legend_font(Param('graph_font'), Param('graph_font_size'));
graph.set_title_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_label_font(Param('graph_font'), Param('graph_font_size'));
graph.set_x_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_y_axis_font(Param('graph_font'), Param('graph_font_size'));
graph.set_values_font(Param('graph_font'), Param('graph_font_size'));
graph.plot(data.0).png | stdout(1);
END;
-%]