本文整理汇总了PHP中horizontal_graph函数的典型用法代码示例。如果您正苦于以下问题:PHP horizontal_graph函数的具体用法?PHP horizontal_graph怎么用?PHP horizontal_graph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了horizontal_graph函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html_graph
function html_graph($names, $values, $bars, $vals, $dvalues = 0, $dbars = 0)
{
// set the error level on entry and exit so as not to interfear with anyone elses error checking.
$er = error_reporting(1);
// set the values that the user didn't
$vals = hv_graph_defaults($vals);
$html_graph_string = start_graph($vals, $names);
if ($vals['type'] == 0) {
$html_graph_string .= horizontal_graph($names, $values, $bars, $vals);
} elseif ($vals['type'] == 1) {
$html_graph_string .= vertical_graph($names, $values, $bars, $vals);
} elseif ($vals['type'] == 2) {
$html_graph_string .= double_horizontal_graph($names, $values, $bars, $vals, $dvalues, $dbars);
} elseif ($vals['type'] == 3) {
$html_graph_string .= double_vertical_graph($names, $values, $bars, $vals, $dvalues, $dbars);
}
$html_graph_string .= end_graph();
// Set the error level back to where it was.
error_reporting($er);
return $html_graph_string;
}
示例2: render_graph
function render_graph($cache_file_name, $html_imagename, $cnt_val, $name_val, $width, $height, $left, $right, $top, $bottom, $title, $target_val, $graph_type)
{
//Checks whether the cached image is present or not
if (file_exists($cache_file_name)) {
@unlink($cache_file_name);
}
if (file_exists($cache_file_name . '.map')) {
@unlink($cache_file_name . '.map');
}
if (!file_exists($cache_file_name) || !file_exists($cache_file_name . '.map')) {
//If the Cached image is not present
if ($graph_type == "horizontal") {
return horizontal_graph($cnt_val, $name_val, $width, $height, $left, $right, $top, $bottom, $title, $target_val, $cache_file_name, $html_imagename);
} else {
if ($graph_type == "vertical") {
return vertical_graph($cnt_val, $name_val, $width, $height, $left, $right, $top, $bottom, $title, $target_val, $cache_file_name, $html_imagename);
} else {
if ($graph_type == "pie") {
return pie_chart($cnt_val, $name_val, $width, $height, $left, $right, $top, $bottom, $title, $target_val, $cache_file_name, $html_imagename);
}
}
}
} else {
//Getting the cached image
$imgMap_fp = fopen($cache_file_name . '.map', "rb");
$imgMap = fread($imgMap_fp, filesize($cache_file_name . '.map'));
fclose($imgMap_fp);
$base_name_cache_file = basename($cache_file_name);
$ccc = "cache/images/" . $base_name_cache_file;
$return = "\n{$imgMap}\n";
$return .= "<img src={$ccc} ismap usemap=#{$html_imagename} border='0'>";
return $return;
}
}