diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2013-11-06 15:08:45 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2013-11-06 15:08:45 +0100 |
commit | 3e4bed239348cf5af0c70c3ab6315c0f24044959 (patch) | |
tree | 7592b7323eed03926695e472ab4bc5b9ccfa198e /template/en/default/reports | |
parent | d8d3c0edd90267e23e4910fe550df4604a5ad75b (diff) | |
download | bugs-3e4bed239348cf5af0c70c3ab6315c0f24044959.tar bugs-3e4bed239348cf5af0c70c3ab6315c0f24044959.tar.gz bugs-3e4bed239348cf5af0c70c3ab6315c0f24044959.tar.bz2 bugs-3e4bed239348cf5af0c70c3ab6315c0f24044959.tar.xz bugs-3e4bed239348cf5af0c70c3ab6315c0f24044959.zip |
Bug 287682: UTF-8 characters are incorrectly displayed in New Charts and graphical reports
r=wurblzap a=sgreen
Diffstat (limited to 'template/en/default/reports')
-rw-r--r-- | template/en/default/reports/chart.png.tmpl | 31 | ||||
-rw-r--r-- | template/en/default/reports/report-bar.png.tmpl | 28 | ||||
-rw-r--r-- | template/en/default/reports/report-line.png.tmpl | 28 | ||||
-rw-r--r-- | template/en/default/reports/report-pie.png.tmpl | 16 |
4 files changed, 53 insertions, 50 deletions
diff --git a/template/en/default/reports/chart.png.tmpl b/template/en/default/reports/chart.png.tmpl index a464accd4..91944fee5 100644 --- a/template/en/default/reports/chart.png.tmpl +++ b/template/en/default/reports/chart.png.tmpl @@ -6,9 +6,6 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% y_label = "$terms.Bugs" %] -[% x_label = "Time" %] - [% IF chart.cumulate %] [% USE graph = GD.Graph.area(width, height) %] [% graph.set(cumulate => "true") %] @@ -19,8 +16,8 @@ [% FILTER null; x_label_skip = (30 * chart.data.0.size / width); - graph.set(x_label => x_label, - y_label => y_label, + graph.set(x_label => "Time", + y_label => terms.Bugs, y_tick_number => 8, y_max_value => chart.y_max_value, x_label_position => 0.5, @@ -32,16 +29,18 @@ "lpurple", "lorange", "black", "green", "blue", "dpink", "lbrown", "gray", "red", "dpurple", "gold", "marine"]); - - # 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, - chart.labels.3, chart.labels.4, chart.labels.5, - chart.labels.6, chart.labels.7, chart.labels.8, - chart.labels.9, chart.labels.10, chart.labels.11, - chart.labels.12, chart.labels.13, chart.labels.14, - chart.labels.15); - - graph.plot(chart.data).png | stdout(1); + + graph.set_legend(chart.labels); END; -%] + +[% IF Param("font_file") %] + [% graph.set_x_axis_font(Param("font_file"), 9); + graph.set_x_label_font(Param("font_file"), 10); + graph.set_y_axis_font(Param("font_file"), 9); + graph.set_y_label_font(Param("font_file"), 10); + graph.set_legend_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(chart.data).png | stdout(1) %] diff --git a/template/en/default/reports/report-bar.png.tmpl b/template/en/default/reports/report-bar.png.tmpl index 70d482ec9..d879f6dd1 100644 --- a/template/en/default/reports/report-bar.png.tmpl +++ b/template/en/default/reports/report-bar.png.tmpl @@ -6,10 +6,6 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% y_label = "$terms.Bugs" %] - -[% col_field_disp = field_descs.$col_field || col_field %] - [% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %] [% END %] @@ -21,8 +17,8 @@ [% FILTER null; USE graph = GD.Graph.bars(width, height); - graph.set(x_label => col_field_disp, - y_label => y_label, + graph.set(x_label => field_descs.$col_field || col_field, + y_label => terms.Bugs, y_tick_number => 8, y_number_format => "%d", x_label_position => 0.5, @@ -36,13 +32,17 @@ graph.set(cumulate => "true", show_values => 0) IF cumulate; - # 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, - row_names.4, row_names.5, row_names.6, row_names.7, - row_names.8, row_names.9, row_names.10, row_names.11, - row_names.12, row_names.13, row_names.14, row_names.15); - - graph.plot(data.0).png | stdout(1); + graph.set_legend(row_names); END; -%] + +[% IF Param("font_file") %] + [% graph.set_x_axis_font(Param("font_file"), 9); + graph.set_x_label_font(Param("font_file"), 10); + graph.set_y_axis_font(Param("font_file"), 9); + graph.set_y_label_font(Param("font_file"), 10); + graph.set_legend_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(data.0).png | stdout(1) %] diff --git a/template/en/default/reports/report-line.png.tmpl b/template/en/default/reports/report-line.png.tmpl index 073e69bcc..585133afd 100644 --- a/template/en/default/reports/report-line.png.tmpl +++ b/template/en/default/reports/report-line.png.tmpl @@ -6,10 +6,6 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% y_label = "$terms.Bugs" %] - -[% col_field_disp = field_descs.$col_field || col_field %] - [% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %] [% END %] @@ -26,8 +22,8 @@ [% END %] [% FILTER null; - graph.set(x_label => col_field_disp, - y_label => y_label, + graph.set(x_label => field_descs.$col_field || col_field, + y_label => terms.Bugs, y_tick_number => 8, x_label_position => 0.5, x_labels_vertical => x_labels_vertical, @@ -38,13 +34,17 @@ "blue", "dpink", "lbrown", "gray", "red", "dpurple", "gold", "marine"]); - # 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, - row_names.4, row_names.5, row_names.6, row_names.7, - row_names.8, row_names.9, row_names.10, row_names.11, - row_names.12, row_names.13, row_names.14, row_names.15); - - graph.plot(data.0).png | stdout(1); + graph.set_legend(row_names); END; -%] + +[% IF Param("font_file") %] + [% graph.set_x_axis_font(Param("font_file"), 9); + graph.set_x_label_font(Param("font_file"), 10); + graph.set_y_axis_font(Param("font_file"), 9); + graph.set_y_label_font(Param("font_file"), 10); + graph.set_legend_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(data.0).png | stdout(1) %] diff --git a/template/en/default/reports/report-pie.png.tmpl b/template/en/default/reports/report-pie.png.tmpl index 9d3f16fa3..cc2a1325a 100644 --- a/template/en/default/reports/report-pie.png.tmpl +++ b/template/en/default/reports/report-pie.png.tmpl @@ -6,20 +6,24 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% col_field_disp = field_descs.$col_field || col_field %] - [% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %] [% END %] [% FILTER null; USE graph = GD.Graph.pie(width, height); - - graph.set(title => col_field_disp, + + graph.set(title => field_descs.$col_field || col_field, pie_height => 20, suppress_angle => 2, start_angle => 180); - - graph.plot(data.0).png | stdout(1); END; -%] + +[% IF Param("font_file") %] + [% graph.set_title_font(Param("font_file"), 10); + graph.set_value_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(data.0).png | stdout(1) %] |