[Rt-commit] r8453 - in rt/branches/3.6-RELEASE: html/Search
ruz at bestpractical.com
ruz at bestpractical.com
Wed Aug 8 17:04:32 EDT 2007
Author: ruz
Date: Wed Aug 8 17:04:31 2007
New Revision: 8453
Modified:
rt/branches/3.6-RELEASE/etc/RT_Config.pm.in
rt/branches/3.6-RELEASE/html/Search/Chart
Log:
* add new $ChartFont option to the config which allow admin to
select a tru type font RT uses in charts
Modified: rt/branches/3.6-RELEASE/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/3.6-RELEASE/etc/RT_Config.pm.in (original)
+++ rt/branches/3.6-RELEASE/etc/RT_Config.pm.in Wed Aug 8 17:04:31 2007
@@ -505,6 +505,13 @@
Set($DontSearchFileAttachments, undef);
+# GD module RT uses has a builtin font, however that font has no characters
+# for all languages, you can use $ChartFont option to define absolute path to
+# a true type font, however you must have GD libray with support for true type
+# fonts to use this option
+
+Set($ChartFont, undef);
+
# }}}
Modified: rt/branches/3.6-RELEASE/html/Search/Chart
==============================================================================
--- rt/branches/3.6-RELEASE/html/Search/Chart (original)
+++ rt/branches/3.6-RELEASE/html/Search/Chart Wed Aug 8 17:04:31 2007
@@ -74,14 +74,25 @@
my $value_name = $tix->Column( FIELD => $PrimaryGroupBy );
my $chart = $chart_class->new( 600 => 400 );
+
+my $font = $RT::FontForCharts || ['verdana', 'arial', gdMediumBoldFont];
+$chart->set_title_font( $font, 12 ) if $chart->can('set_title_font');
+$chart->set_legend_font( $font, 12 ) if $chart->can('set_legend_font');
+$chart->set_x_label_font( $font, 10 ) if $chart->can('set_x_label_font');
+$chart->set_y_label_font( $font, 10 ) if $chart->can('set_y_label_font');
+$chart->set_label_font( $font, 10 ) if $chart->can('set_label_font');
+$chart->set_x_axis_font( $font, 9 ) if $chart->can('set_x_axis_font');
+$chart->set_y_axis_font( $font, 9 ) if $chart->can('set_y_axis_font');
+$chart->set_values_font( $font, 9 ) if $chart->can('set_values_font');
+$chart->set_value_font( $font, 9 ) if $chart->can('set_value_font');
+
if ($chart_class eq "GD::Graph::bars") {
$chart->set(
x_label => $tix->Label( $PrimaryGroupBy ),
x_labels_vertical => 1,
- y_label => 'Tickets',
+ y_label => loc('Tickets'),
show_values => 1
);
- $chart->set_legend_font( ['verdana', 'arial', gdMediumBoldFont], 12);
}
my %class = (
More information about the Rt-commit
mailing list