2013-06-20 Miguel de Dios <miguel.dedios@artica.es>

* include/graphs/fgraph.php, include/graphs/functions_pchart.php:
	merged the changes from the branch 4.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8365 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-06-20 11:17:14 +00:00
parent db6e54e6ad
commit 5a612bcfbe
3 changed files with 22 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2013-06-20 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/fgraph.php, include/graphs/functions_pchart.php:
merged the changes from the branch 4.
2013-06-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/modificar_agente.php: fixed the filter of the

View File

@ -270,6 +270,7 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='" . ui_get_full_url (false, false, false, false) . "include/graphs/functions_pchart.php?static_graph=1&graph_type=area&ttl=".$ttl."&id_graph=" . $id_graph . "'>";
}
}
@ -463,7 +464,7 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height,
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
// This library allows only 8 colors
$max_values = 8;
$max_values = 5;
//Remove the html_entities
$temp = array();

View File

@ -241,7 +241,7 @@ if (empty($colors)) {
$colors = array();
}
foreach($colors as $i => $color) {
foreach ($colors as $i => $color) {
$rgb['border'] = html_html2rgb($color['border']);
$rgb_color[$i]['border']['R'] = $rgb['border'][0];
$rgb_color[$i]['border']['G'] = $rgb['border'][1];
@ -428,9 +428,11 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width,
/* Write down the legend next to the 2nd chart*/
//Calculate the bottom margin from the size of string in each index
$max_chars = graph_get_max_index($legend_values);
$legend_with_aprox = 32 + (7 * $max_chars);
if ($legend_position != 'hidden') {
// This is a hardcore adjustment to match most of the graphs, please don't alter
$legend_with_aprox = 32 + (4.5 * $max_chars);
$PieChart->drawPieLegend($width - $legend_with_aprox, 5, array("R"=>255,"G"=>255,"B"=>255, "BoxSize"=>10));
}
@ -613,6 +615,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 = '', $font_size) {
/* CAT:Vertical Charts */
if (!is_array($legend) || empty($legend)) {
unset($legend);
@ -757,12 +760,19 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$chart_size = ($digits_left * $font_size) + 20;
$max_data = max(max($data));
$default_chart_size = 40;
$rest_chars = strlen($max_data) - 6;
$default_chart_size += $rest_chars * 5;
/* Area depends on yaxisname */
if ($yaxisname != '') {
$chart_size += 40;
$chart_size += $default_chart_size;
}
else {
$chart_size = 40;
$chart_size = $default_chart_size;
}
if (isset($size['Height'])) {