From c4307abaed0184241599fcb5019168149b344b49 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 20 Apr 2011 15:54:31 +0000 Subject: [PATCH] 2011-04-20 Miguel de Dios * include/fonts/unicode.ttf: renamed form code.ttf. * include/fonts/smallfont.ttf: added new smaller font. * include/functions_config.php, godmode/setup/setup_visuals.php: now you can set the size of font for the graphs. * include/functions_graph.php, include/graphs/functions_pchart.php, include/graphs/fgraph.php: changed source code to set the size of font in the graphs. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4270 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 13 +++ .../godmode/setup/setup_visuals.php | 16 ++-- pandora_console/include/fonts/smallfont.ttf | Bin 0 -> 22176 bytes .../include/fonts/{code.ttf => unicode.ttf} | Bin pandora_console/include/functions_config.php | 10 ++- pandora_console/include/functions_graph.php | 76 ++++++++++++------ pandora_console/include/graphs/fgraph.php | 46 ++++++++--- .../include/graphs/functions_pchart.php | 66 +++++++++------ 8 files changed, 158 insertions(+), 69 deletions(-) create mode 100644 pandora_console/include/fonts/smallfont.ttf rename pandora_console/include/fonts/{code.ttf => unicode.ttf} (100%) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2abeaf7bc3..bbac1b5310 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2011-04-20 Miguel de Dios + + * include/fonts/unicode.ttf: renamed form code.ttf. + + * include/fonts/smallfont.ttf: added new smaller font. + + * include/functions_config.php, godmode/setup/setup_visuals.php: now you + can set the size of font for the graphs. + + * include/functions_graph.php, include/graphs/functions_pchart.php, + include/graphs/fgraph.php: changed source code to set the size of font + in the graphs. + 2011-04-20 Miguel de Dios * include/functions_graph.php, include/graphs/functions_pchart.php, diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index e272fe32aa..309a1eb139 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -78,20 +78,20 @@ $table->data[9][1] = print_select ($iconsets, 'status_images_set', $config["stat $table->data[10][0] = __('Font path'); - $fonts = load_fonts(); - $table->data[10][1] = print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true); -//$table->data[10][1] = print_input_text ('fontpath', $config["fontpath"], '', 50, 255, true); -$table->data[11][0] = __('Flash charts'); -$table->data[11][1] = __('Yes').' '.print_radio_button ('flash_charts', 1, '', $config["flash_charts"], true).'  '; -$table->data[11][1] .= __('No').' '.print_radio_button ('flash_charts', 0, '', $config["flash_charts"], true); +$table->data[11][0] = __('Font size'); +$table->data[11][1] = print_select(range(1, 15), 'font_size', $config["font_size"], '', '', 0, true); + +$table->data[12][0] = __('Flash charts'); +$table->data[12][1] = __('Yes').' '.print_radio_button ('flash_charts', 1, '', $config["flash_charts"], true).'  '; +$table->data[12][1] .= __('No').' '.print_radio_button ('flash_charts', 0, '', $config["flash_charts"], true); if (!defined ('PANDORA_ENTERPRISE')){ - $table->data[12][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true); - $table->data[12][1] = print_select (list_files ('images/custom_logo', "png", 1, 0), 'custom_logo', $config["custom_logo"], '', '', '', true); + $table->data[13][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true); + $table->data[13][1] = print_select (list_files ('images/custom_logo', "png", 1, 0), 'custom_logo', $config["custom_logo"], '', '', '', true); } echo '
'; diff --git a/pandora_console/include/fonts/smallfont.ttf b/pandora_console/include/fonts/smallfont.ttf new file mode 100644 index 0000000000000000000000000000000000000000..90c96f312934c7e1552336c8ad8e05e9b937c5ae GIT binary patch literal 22176 zcmc(n3!Gflec%6gW_LkILK=-$(&#y>wInbEquDMB81pcoP*x^X5WtO%ku_@s5<)MK zz%v^RE=D*p6dU0HCKMBFC_&V5U240ri(^|jH4p+68^SA&tx}^lLGi~sl2-lx{^#78 zJG(3Fr2V9GckbM|bI5mTh=O=FX(!m=Kc6Geb`4PV7EvK`*7}xoc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10-&H&*>{^~obvaK;TLZ6Uo*Z=s^3v1Lj%QoO(Fc*t zX5MRg23VQ@OI*bhz%FN$K3DP7s6p(tjD***l{2t5`?o>H4s!My_EoN2$>(K2TgTW< zZLr6Kd=fCu<5^l|ykQW08`y7#&Q+W_pJPE?kEUDnUdWkETyr_Rt>^qwa8?|~Xb7$G z(Z9(VXL_6smX+QAlrQhX^A{60k3v3r=9!-G_8w%kl&6H9%$oQU{poQh@RYeeFuvQL z9d`tFH4$r?!;|MqJV#E?jhoJs>Gb?HJ>%`GJnQWep5u0kody^4crM+MSocEcUO=@v zjsI%=3;5Z^GrT771iGJK_b>9iu^V`1*Nyfmo@;g+GJV>gRrVB5yZbAD+S^XoyF^MtaqS$lboKbtOnCSCT4 zbQi_v(fuw@Gy5=45POa1qy3C0uf1Y7^Mtu?@uaecdFI_sNsi~FJ-~C*{@&iUzq5a^ zz4i-yrJvmWxBfJ}pJOju(DhcHmA1jPdlk=Bdy*%yJ!&82X=qoV?X~_~y7fFI?OL9C zR_EDg+jx@MkX_Gn(Dv|jv;xmGyN{=w{f)iZan{wFuJWjHJ!<7{;MIm8a#!cBUcP*J f`SdO8R;}N1`Q|dOgS?g $data_tmp[5]); return pie3d_graph($config['flash_charts'], $data, 320, 200, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1020,7 +1034,8 @@ function graph_incidents_status2 () { } return pie3d_graph($config['flash_charts'], $data, 370, 180, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1047,7 +1062,8 @@ function graphic_incident_group2 () { } return pie3d_graph($config['flash_charts'], $data, 320, 200, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1085,7 +1101,8 @@ function graphic_incident_user2 () { } return pie3d_graph($config['flash_charts'], $data, 320, 200, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1128,7 +1145,8 @@ function graphic_incident_source2($width = 320, $height = 200) { } return pie3d_graph($config['flash_charts'], $data, $width, $height, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1193,7 +1211,8 @@ function grafico_eventos_grupo2 ($width = 300, $height = 200, $url = "") { } return pie3d_graph($config['flash_charts'], $data, $width, $height, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1228,7 +1247,8 @@ function grafico_eventos_total2($filter = "") { asort ($data); return pie3d_graph($config['flash_charts'], $data, 320, 200, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1265,7 +1285,8 @@ function grafico_eventos_usuario2 ($width, $height) { } return pie3d_graph($config['flash_charts'], $data, $width, $height, - __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png"); + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1320,14 +1341,19 @@ function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar' switch ($type) { case 'sql_graph_vbar': // vertical bar return hbar_graph($flash_charts, $data, $width, $height, array(), - array(), "", "", false, $homeurl, $config['homedir'] . "/images/logo_vertical_water.png"); + array(), "", "", false, $homeurl, + $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); break; case 'sql_graph_hbar': // horizontal bar - return vbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", $homeurl); + return vbar_graph($flash_charts, $data, $width, $height, array(), + array(), "", "", $homeurl, + $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); break; case 'sql_graph_pie': // Pie return pie3d_graph($flash_charts, $data, $width, $height, __("other"), $homeurl, - $config['homedir'] . "/images/logo_vertical_water.png"); + $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath']); break; } } @@ -1729,7 +1755,8 @@ function grafico_modulo_boolean2 ($agent_module_id, $period, $show_events, return area_graph($flash_chart, $chart, $width, $height, $color, $legend, $long_index, "images/image_problem.opaque.png", "", "", $homeurl, - $config['homedir'] . "/images/logo_vertical_water.png"); + $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } /** @@ -1956,7 +1983,8 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events, return area_graph($flash_chart, $chart, $width, $height, $color, $legend, $long_index, "images/image_problem.opaque.png", "", "", $homeurl, - $config['homedir'] . "/images/logo_vertical_water.png"); + $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); } function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event, diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 701438586e..6df37c2357 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -107,7 +107,8 @@ function slicesbar_graph($chart_data, $width, $height, $colors, $font, $round_co } function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), - $legend = array(), $xaxisname = "", $yaxisname = "", $homedir="", $water_mark = '') { + $legend = array(), $xaxisname = "", $yaxisname = "", $homedir="", + $water_mark = '', $font = '', $font_size = '') { if($flash_chart) { echo fs_2d_column_chart ($chart_data, $width, $height); } @@ -121,6 +122,8 @@ function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array() $graph['xaxisname'] = $xaxisname; $graph['yaxisname'] = $yaxisname; $graph['water_mark'] = $water_mark; + $graph['font'] = $font; + $graph['font_size'] = $font_size; $id_graph = serialize_in_temp($graph); @@ -138,7 +141,8 @@ function threshold_graph($flash_chart, $chart_data, $width, $height) { } function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, - $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $homedir="", $water_mark = "") { + $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $homedir="", + $water_mark = "", $font = '', $font_size = '') { if (empty($chart_data)) { return ''; } @@ -156,6 +160,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $graph['xaxisname'] = $xaxisname; $graph['yaxisname'] = $yaxisname; $graph['water_mark'] = $water_mark; + $graph['font'] = $font; + $graph['font_size'] = $font_size; $id_graph = serialize_in_temp($graph); @@ -164,7 +170,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, } function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color, - $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "") { + $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", + $water_mark = "", $font = '', $font_size = '') { if (empty($chart_data)) { return ''; @@ -186,6 +193,8 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color, $graph['xaxisname'] = $xaxisname; $graph['yaxisname'] = $yaxisname; $graph['water_mark'] = $water_mark; + $graph['font'] = $font; + $graph['font_size'] = $font_size; $id_graph = serialize_in_temp($graph); @@ -194,7 +203,8 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color, } function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color, - $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "") { + $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", + $water_mark = "", $font = '', $font_size = '') { if (empty($chart_data)) { return ''; } @@ -215,6 +225,8 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color, $graph['xaxisname'] = $xaxisname; $graph['yaxisname'] = $yaxisname; $graph['water_mark'] = $water_mark; + $graph['font'] = $font; + $graph['font_size'] = $font_size; $id_graph = serialize_in_temp($graph); @@ -223,7 +235,8 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color, } function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, - $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "") { + $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", + $water_mark = "", $font = '', $font_size = '') { if (empty($chart_data)) { return ''; } @@ -241,6 +254,8 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $graph['xaxisname'] = $xaxisname; $graph['yaxisname'] = $yaxisname; $graph['water_mark'] = $water_mark; + $graph['font'] = $font; + $graph['font_size'] = $font_size; $id_graph = serialize_in_temp($graph); @@ -273,7 +288,7 @@ function polar_graph($flash_chart, $chart_data, $width, $height, $no_data_image) function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), $legend = array(), $xaxisname = "", $yaxisname = "", $force_height = true, - $homedir="", $water_mark = '') {$flash_chart = false; + $homedir="", $water_mark = '', $font = '', $font_size = '') {$flash_chart = false; if($flash_chart) { echo fs_2d_hcolumn_chart ($chart_data, $width, $height); } @@ -288,6 +303,8 @@ function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array() $graph['yaxisname'] = $yaxisname; $graph['force_height'] = $force_height; $graph['water_mark'] = $water_mark; + $graph['font'] = $font; + $graph['font_size'] = $font_size; $id_graph = serialize_in_temp($graph); @@ -295,15 +312,20 @@ function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array() } } -function pie3d_graph($flash_chart, $chart_data, $width, $height, $others_str = "other", $homedir="", $water_mark = "") { - return pie_graph('3d', $flash_chart, $chart_data, $width, $height, $others_str, $homedir, $water_mark); +function pie3d_graph($flash_chart, $chart_data, $width, $height, + $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '') { + return pie_graph('3d', $flash_chart, $chart_data, $width, $height, + $others_str, $homedir, $water_mark, $font); } -function pie2d_graph($flash_chart, $chart_data, $width, $height, $others_str = "other", $homedir="", $water_mark = "") { - return pie_graph('2d', $flash_chart, $chart_data, $width, $height, $others_str, $homedir, $water_mark); +function pie2d_graph($flash_chart, $chart_data, $width, $height, + $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '') { + return pie_graph('2d', $flash_chart, $chart_data, $width, $height, + $others_str, $homedir, $water_mark, $font); } -function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height, $others_str = "other", $homedir="", $water_mark = "") { +function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height, + $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '') { // This library allows only 8 colors $max_values = 8; @@ -341,6 +363,8 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height, $oth $graph['width'] = $width; $graph['height'] = $height; $graph['water_mark'] = $water_mark; + $graph['font'] = $font; + $graph['font_size'] = $font_size; $id_graph = serialize_in_temp($graph); diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index 23dd47d7a4..c6e80085bd 100755 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -36,11 +36,12 @@ $default_fine_colors[] = "#999999"; // Default values $antialiasing = true; -$font = '../fonts/code.ttf'; +$font = '../fonts/unicode.ttf'; $xaxisname = ''; $yaxisname = ''; $legend = null; $colors = null; +$font_size = 8; $graph_type = get_parameter('graph_type', ''); @@ -82,6 +83,11 @@ if(isset($graph['font'])) { $font = $graph['font']; } } +if(isset($graph['font_size'])) { + if (!empty($graph['font_size'])) { + $font_size = $graph['font_size']; + } +} if(isset($graph['antialiasing'])) { $antialiasing = $graph['antialiasing']; } @@ -100,7 +106,6 @@ $water_mark = ''; if(isset($graph['water_mark'])) { $water_mark = $graph['water_mark']; //"/var/www/pandora_console/images/logo_vertical_water.png"; } -debugPrint($graph['water_mark'], true); /* $colors = array(); @@ -254,34 +259,38 @@ foreach($colors as $i => $color) { switch($graph_type) { case 'pie3d': case 'pie2d': - pch_pie_graph($graph_type, array_values($data), array_keys($data), $width, $height, $font, $water_mark); + pch_pie_graph($graph_type, array_values($data), array_keys($data), + $width, $height, $font, $water_mark, $font_size); break; case 'slicebar': - pch_slicebar_graph($graph_type, $data, $width, $height, $colors, $font, $round_corner); + pch_slicebar_graph($graph_type, $data, $width, $height, $colors, $font, $round_corner, $font_size); break; case 'polar': case 'radar': - pch_kiviat_graph($graph_type, array_values($data), array_keys($data), $width, $height, $font); + pch_kiviat_graph($graph_type, array_values($data), array_keys($data), + $width, $height, $font, $font_size); break; case 'hbar': case 'vbar': pch_bar_graph($graph_type, $data_keys, $data_values, $width, $height, $font, $antialiasing, $rgb_color, $xaxisname, $yaxisname, false, - $legend, $fine_colors, $water_mark); + $legend, $fine_colors, $water_mark, $font_size); break; case 'stacked_area': case 'area': case 'line': pch_vertical_graph($graph_type, $data_keys, $data_values, $width, $height, $rgb_color, $xaxisname, $yaxisname, false, $legend, - $font, $antialiasing, $water_mark); + $font, $antialiasing, $water_mark, $font_size); break; case 'threshold': - pch_threshold_graph($graph_type, $data_keys, $data_values, $width, $height, $font, $antialiasing, $xaxisname, $yaxisname, $title); + pch_threshold_graph($graph_type, $data_keys, $data_values, $width, + $height, $font, $antialiasing, $xaxisname, $yaxisname, $title, + $font_size); break; } -function pch_slicebar_graph ($graph_type, $data, $width, $height, $colors, $font, $round_corner) { +function pch_slicebar_graph ($graph_type, $data, $width, $height, $colors, $font, $round_corner, $font_size) { /* CAT:Slicebar charts */ set_time_limit (0); @@ -292,7 +301,7 @@ function pch_slicebar_graph ($graph_type, $data, $width, $height, $colors, $font /* Turn of Antialiasing */ $myPicture->Antialias = $antialiasing; - $myPicture->setFontProperties(array("FontName"=>"../fonts/code.ttf","FontSize"=>8,"R"=>80,"G"=>80,"B"=>80)); + $myPicture->setFontProperties(array("FontName"=> $font, "FontSize"=>$font_size,"R"=>80,"G"=>80,"B"=>80)); // Round corners defined in global setup if ($round_corner != 0) @@ -341,7 +350,8 @@ function pch_slicebar_graph ($graph_type, $data, $width, $height, $colors, $font $myPicture->Stroke (); } -function pch_pie_graph ($graph_type, $data_values, $legend_values, $width, $height, $font, $water_mark) { +function pch_pie_graph ($graph_type, $data_values, $legend_values, $width, + $height, $font, $water_mark, $font_size) { /* CAT:Pie charts */ /* Create and populate the pData object */ @@ -357,7 +367,7 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width, $heig $myPicture = new pImage($width,$height,$MyData,TRUE); /* Set the default font properties */ - $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); + $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>$font_size,"R"=>80,"G"=>80,"B"=>80)); @@ -410,7 +420,8 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width, $heig $myPicture->stroke(); } -function pch_kiviat_graph ($graph_type, $data_values, $legend_values, $width, $height, $font) { +function pch_kiviat_graph ($graph_type, $data_values, $legend_values, $width, + $height, $font, $font_size) { /* CAT:Radar/Polar charts */ /* Create and populate the pData object */ @@ -426,7 +437,7 @@ function pch_kiviat_graph ($graph_type, $data_values, $legend_values, $width, $h $myPicture = new pImage($width,$height,$MyData,TRUE); /* Set the default font properties */ - $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>8,"R"=>80,"G"=>80,"B"=>80)); + $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>$font_size,"R"=>80,"G"=>80,"B"=>80)); /* Create the pRadar object */ $SplitChart = new pRadar(); @@ -437,11 +448,16 @@ function pch_kiviat_graph ($graph_type, $data_values, $legend_values, $width, $h /* Draw an AA pie chart */ switch($graph_type) { case "radar": - $Options = array("SkipLabels"=>0,"LabelPos"=>RADAR_LABELS_HORIZONTAL, "LabelMiddle"=>FALSE,"Layout"=>RADAR_LAYOUT_STAR,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50), "FontName"=>$font,"FontSize"=>6); + $Options = array("SkipLabels"=>0,"LabelPos"=>RADAR_LABELS_HORIZONTAL, + "LabelMiddle"=>FALSE,"Layout"=>RADAR_LAYOUT_STAR, + "BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255, + "StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50), + "FontName"=>$font,"FontSize"=>$font_size / 1.8); $SplitChart->drawRadar($myPicture,$MyData,$Options); break; case "polar": - $Options = array("Layout"=>RADAR_LAYOUT_CIRCLE,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50), "FontName"=>$font,"FontSize"=>6); + $Options = array("Layout"=>RADAR_LAYOUT_CIRCLE,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50), + "FontName"=>$font,"FontSize"=>$font_size / 1.8); $SplitChart->drawRadar($myPicture,$MyData,$Options); break; } @@ -452,7 +468,7 @@ function pch_kiviat_graph ($graph_type, $data_values, $legend_values, $width, $h function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font, $antialiasing, $rgb_color = false, $xaxisname = "", $yaxisname = "", - $show_values = false, $legend = array(), $fine_colors = array(), $water_mark = '') { + $show_values = false, $legend = array(), $fine_colors = array(), $water_mark = '', $font_size) { /* CAT: Vertical Bar Chart */ if(!is_array($legend) || empty($legend)) { unset($legend); @@ -509,7 +525,7 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font, $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); /* Set the default font */ - $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>10)); + $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>$font_size)); /* Draw the scale */ // TODO: AvoidTickWhenEmpty = FALSE When the distance between two ticks will be less than 50 px @@ -582,7 +598,7 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font, function pch_vertical_graph ($graph_type, $index, $data, $width, $height, $rgb_color = false, $xaxisname = "", $yaxisname = "", $show_values = false, - $legend = array(), $font, $antialiasing, $water_mark = '') { + $legend = array(), $font, $antialiasing, $water_mark = '', $font_size) { /* CAT:Vertical Charts */ if(!is_array($legend) || empty($legend)) { unset($legend); @@ -665,7 +681,7 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height, //$myPicture->drawRectangle(0,0,$width,$height,array("R"=>0,"G"=>0,"B"=>0)); /* Set the default font */ - $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>10)); + $myPicture->setFontProperties(array("FontName"=>$font, "FontSize"=>$font_size)); if(isset($legend)) { /* Set horizontal legend if is posible */ @@ -758,7 +774,9 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height, $myPicture->stroke(); } -function pch_threshold_graph ($graph_type, $index, $data, $width, $height, $font, $antialiasing, $xaxisname = "", $yaxisname = "", $title = "", $show_values = false, $show_legend = false) { +function pch_threshold_graph ($graph_type, $index, $data, $width, $height, $font, + $antialiasing, $xaxisname = "", $yaxisname = "", $title = "", + $show_values = false, $show_legend = false, $font_size) { /* CAT:Threshold Chart */ /* Create and populate the pData object */ @@ -777,15 +795,15 @@ function pch_threshold_graph ($graph_type, $index, $data, $width, $height, $font $myPicture->drawRectangle(0,0,699,229,array("R"=>200,"G"=>200,"B"=>200)); /* Write the picture title */ - $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>11)); - $myPicture->drawText(60,35,$title,array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMLEFT)); + $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>$font_size)); + $myPicture->drawText(60,35,$title,array("FontSize"=>($font_size * 1.8),"Align"=>TEXT_ALIGN_BOTTOMLEFT)); /* Do some cosmetic and draw the chart */ $myPicture->setGraphArea(60,40,670,190); $myPicture->drawFilledRectangle(60,40,670,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10)); $myPicture->drawScale(array("GridR"=>180,"GridG"=>180,"GridB"=>180, "Mode" => SCALE_MODE_START0)); $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); - $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>6)); + $myPicture->setFontProperties(array("FontName"=>$font,"FontSize"=>($font_size / 1.8))); $settings = array("Gradient"=>TRUE,"GradientMode"=>GRADIENT_EFFECT_CAN,"DisplayValues"=>$show_values,"DisplayZeroValues"=>FALSE,"DisplayR"=>100,"DisplayG"=>100,"DisplayB"=>100,"DisplayShadow"=>TRUE,"Surrounding"=>5,"AroundZero"=>FALSE); $myPicture->drawSplineChart($settings); $myPicture->setShadow(FALSE);