当前位置: 首页>>代码示例>>PHP>>正文


PHP start_graph函数代码示例

本文整理汇总了PHP中start_graph函数的典型用法代码示例。如果您正苦于以下问题:PHP start_graph函数的具体用法?PHP start_graph怎么用?PHP start_graph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了start_graph函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: reports_quick_graph

/**
 * reports_quick_graph() - Show a quick graph of data.
 *
 * @param		string	Graph title
 * @param		int		First query resource ID
 * @param		int		Second query resource ID
 * @param		string	The bar colors
 */
function reports_quick_graph($title, $sql1, $sql2, $bar_colors)
{
    $result1 = db_query($sql1);
    $result2 = db_query($sql2);
    if ($result1 && $result2 && db_numrows($result2) > 0) {
        $assoc_open = util_result_columns_to_assoc($result1);
        $assoc_all = util_result_columns_to_assoc($result2);
        while (list($key, $val) = each($assoc_all)) {
            $titles[] = $key;
            $all[] = $val;
            if ($assoc_open[$key]) {
                $open[] = $assoc_open[$key];
            } else {
                $open[] = 0;
            }
        }
        /*	       	for ($i=0; $i<db_numrows($result1); $i++) {
        			echo "$titles[$i]=>$opened[$i]/$all[$i]<br />";
        		}
        */
        $scale = graph_calculate_scale(array($opened, $all), 400);
        $props["scale"] = $scale;
        $props["cellspacing"] = 5;
        $props = hv_graph_defaults($props);
        start_graph($props, $titles);
        horizontal_multisection_graph($titles, array($open, $all), $bar_colors, $props);
        end_graph();
        print '<p /><br />';
        print '<table cellspacing="0" border="0"><tr align="center"><td width="15%">' . _('Key') . ':</td><td width="5%">(</td><td width="35%" style="background-color:' . $bar_colors[0] . '">' . _('Open') . '</td>' . '<td width="5%">/</td><td width="35%" style="background-color:' . $bar_colors[1] . '">' . _('All') . ' </td><td width="5%">)</td></tr></table>';
        print '<p />';
        //      		GraphResult($result,$title);
    } else {
        echo "<h2>" . _('No data found to report') . "</h2>";
    }
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:43,代码来源:tool_reports.php

示例2: 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;
}
开发者ID:R-Future,项目名称:zencart,代码行数:21,代码来源:html_graphs.php

示例3: array

$nr = 2349;
$oms = 'percentage HAVO/VWO geslaagden op totaal aantal geslaagden';
$graph = false;
$eindjaar = false;
$cols = array('val10', 'val11');
$scale = 100;
$table_row = get_data_cols($cbs, $regio, $nr, $oms, $graph, $cols, $rand, $eindjaar, $scale, $cbs2, $regio2);
echo $table_row;
$bron[] = getsource(1687);
$nr = 1687;
$oms = 'achterstandsleerlingen (4-12 jaar)';
$col = 'val3';
$eindjaar = false;
$table_row = get_data_abs($cbs, $nr, $oms, $regio, $cbs2, $regio2, $col, $eindjaar);
echo $table_row;
$rand = start_graph();
$nr = 1687;
$oms = 'percentage achterstandsleerlingen op totaal aantal basisschoolleerlingen';
$graph = true;
$eindjaar = false;
$cols = array('val3', 'val7');
$scale = 100;
$table_row = get_data_cols($cbs, $regio, $nr, $oms, $graph, $cols, $rand, $eindjaar, $scale, $cbs2, $regio2);
echo $table_row;
echo "</tbody>";
echo "</table>";
include 'source.php';
$graph_title = 'percentage achterstandsleerlingen';
$graph_type = 'single_bar_graph';
$xml_file = date("Ymd") . $rand;
show_graph($graph_title, $graph_type, $rand, $xml_file, $cbs, $cbs2, $regio, $regio2);
开发者ID:Mwalima,项目名称:databank,代码行数:31,代码来源:report_jeugd.php


注:本文中的start_graph函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。