mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
2011-04-13 Sergio Martin <sergio.martin@artica.es>
* include/graphs/functions_pchart.php include/functions_custom_graphs.php: Improved the vertical graph legend to use in horizontal when is possible. Fixing a Miguel modification erased by me in the last commit. Fix a combined graph bug in the size git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4202 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7fe638e70d
commit
4ce26cf019
@ -1,3 +1,13 @@
|
|||||||
|
2011-04-13 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* include/graphs/functions_pchart.php
|
||||||
|
include/functions_custom_graphs.php: Improved the
|
||||||
|
vertical graph legend to use in horizontal when
|
||||||
|
is possible.
|
||||||
|
Fixing a Miguel modification erased by me in the last
|
||||||
|
commit.
|
||||||
|
Fix a combined graph bug in the size
|
||||||
|
|
||||||
2011-04-13 Sergio Martin <sergio.martin@artica.es>
|
2011-04-13 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_graph.php
|
* include/functions_graph.php
|
||||||
|
@ -28,6 +28,8 @@ if ($config['flash_charts']) {
|
|||||||
require_once ('include/fgraph.php');
|
require_once ('include/fgraph.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once ($config["homedir"] . '/include/functions_graph.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all the custom graphs a user can see.
|
* Get all the custom graphs a user can see.
|
||||||
*
|
*
|
||||||
@ -89,11 +91,10 @@ function get_user_custom_graphs ($id_user = 0, $only_names = false, $returnAllGr
|
|||||||
* @param $return Whether to return an output string or echo now (optional, echo by default).
|
* @param $return Whether to return an output string or echo now (optional, echo by default).
|
||||||
* @param $date Date to start printing the graph
|
* @param $date Date to start printing the graph
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function print_custom_graph ($id_graph, $height, $width, $period, $stacked, $return = false, $date = 0) {
|
function print_custom_graph ($id_graph, $height, $width, $period, $stacked, $return = false, $date = 0) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
require_once ($config["homedir"] . '/include/functions_graph.php');
|
|
||||||
|
|
||||||
$sources = get_db_all_rows_field_filter ('tgraph_source', 'id_graph', $id_graph);
|
$sources = get_db_all_rows_field_filter ('tgraph_source', 'id_graph', $id_graph);
|
||||||
$modules = array ();
|
$modules = array ();
|
||||||
$weights = array ();
|
$weights = array ();
|
||||||
|
@ -566,9 +566,16 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height, $rgb_c
|
|||||||
$myPicture->setFontProperties(array("FontName"=>"../fonts/code.ttf","FontSize"=>10));
|
$myPicture->setFontProperties(array("FontName"=>"../fonts/code.ttf","FontSize"=>10));
|
||||||
|
|
||||||
if(isset($legend)) {
|
if(isset($legend)) {
|
||||||
|
/* Set horizontal legend if is posible */
|
||||||
|
$legend_mode = LEGEND_HORIZONTAL;
|
||||||
|
$size = $myPicture->getLegendSize(array("Style"=>LEGEND_NOBORDER,"Mode"=>$legend_mode));
|
||||||
|
if($size['Width'] > ($width - 5)) {
|
||||||
|
$legend_mode = LEGEND_VERTICAL;
|
||||||
|
$size = $myPicture->getLegendSize(array("Style"=>LEGEND_NOBORDER,"Mode"=>$legend_mode));
|
||||||
|
}
|
||||||
|
|
||||||
/* Write the chart legend */
|
/* Write the chart legend */
|
||||||
$size = $myPicture->getLegendSize(array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_VERTICAL));
|
$myPicture->drawLegend($width-$size['Width'], 8,array("Style"=>LEGEND_NOBORDER,"Mode"=>$legend_mode));
|
||||||
$myPicture->drawLegend($width-$size['Width'], 8,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_VERTICAL));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calculate the bottom margin from the size of string in each index
|
//Calculate the bottom margin from the size of string in each index
|
||||||
@ -742,4 +749,4 @@ function pch_horizontal_graph ($graph_type, $index, $data, $width, $height, $xax
|
|||||||
/* Render the picture */
|
/* Render the picture */
|
||||||
$myPicture->stroke();
|
$myPicture->stroke();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user