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


PHP graph::draw方法代码示例

本文整理汇总了PHP中graph::draw方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::draw方法的具体用法?PHP graph::draw怎么用?PHP graph::draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在graph的用法示例。


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

示例1: array

$bandlabels = array();
for ($i = 0; $i < $quiz->grade; $i += $bandwidth) {
    $label = quiz_format_grade($quiz, $i) . ' - ';
    if ($quiz->grade > $i + $bandwidth) {
        $label .= quiz_format_grade($quiz, $i + $bandwidth);
    } else {
        $label .= quiz_format_grade($quiz, $quiz->grade);
    }
    $bandlabels[] = $label;
}
$line->x_data = $bandlabels;
$line->y_format['allusers'] = array('colour' => 'red', 'bar' => 'fill', 'shadow_offset' => 1, 'legend' => get_string('allparticipants'));
$line->y_data['allusers'] = quiz_report_grade_bands($bandwidth, $bands, $quizid, $groupusers);
$line->y_order = array('allusers');
$line->parameter['y_min_left'] = 0;
// start at 0
$line->parameter['y_max_left'] = max($line->y_data['allusers']);
$line->parameter['y_decimal_left'] = 0;
// 2 decimal places for y axis.
//pick a sensible number of gridlines depending on max value on graph.
$gridlines = max($line->y_data['allusers']);
while ($gridlines >= 10) {
    if ($gridlines >= 50) {
        $gridlines = $gridlines / 5;
    } else {
        $gridlines = $gridlines / 2;
    }
}
$line->parameter['y_axis_gridlines'] = $gridlines + 1;
$line->draw();
开发者ID:ajv,项目名称:Offline-Caching,代码行数:30,代码来源:overviewgraph.php

示例2: array

        $graph->y_data['stdev1'] = $stdev1;
        $graph->y_format['stdev1'] = array('colour' => 'ltltblue', 'bar' => 'fill', 'shadow_offset' => 0.1, 'legend' => 'none', 'bar_size' => 0.3);
        $graph->y_data['stdev2'] = $stdev2;
        $graph->y_format['stdev2'] = array('colour' => 'ltltorange', 'bar' => 'fill', 'shadow_offset' => 0.1, 'legend' => 'none', 'bar_size' => 0.2);
        $graph->offset_relation['stdev1'] = 'answers1';
        $graph->offset_relation['stdev2'] = 'answers2';
        $graph->parameter['bar_size'] = 0.15;
        $graph->parameter['legend'] = 'outside-top';
        $graph->parameter['legend_border'] = 'black';
        $graph->parameter['legend_offset'] = 4;
        $graph->y_tick_labels = $options;
        if ($maxbuckets1 > 0.0 && $maxbuckets2 > 0.0) {
            $graph->y_order = array('stdev1', 'stdev2', 'answers1', 'answers2', 'studanswers1', 'studanswers2');
        } else {
            if ($maxbuckets1 > 0.0) {
                $graph->y_order = array('stdev1', 'answers1', 'studanswers1');
            } else {
                $graph->y_order = array('stdev2', 'answers2', 'studanswers2');
            }
        }
        $graph->parameter['y_max_left'] = count($options) - 1;
        $graph->parameter['y_axis_gridlines'] = count($options);
        $graph->parameter['y_resolution_left'] = 1;
        $graph->parameter['y_decimal_left'] = 1;
        $graph->parameter['x_axis_angle'] = 20;
        $graph->draw();
        break;
    default:
        break;
}
exit;
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:graph.php

示例3: array

        $c = 0;
    }
    if ($d < 0) {
        $d = 0;
    }
    if ($e < 0) {
        $e = 0;
    }
    if ($f < 0) {
        $f = 0;
    }
    $chart->y_data[$i] = array($a, $b, $c, $d, $e, $f);
}
$chart->parameter['point_size'] = 6;
// format for each data set
$chart->y_format['alpha'] = array('colour' => 'blue', 'line' => 'brush', 'legend' => 'First Data Set');
$chart->y_format['beta'] = array('colour' => 'yellow', 'line' => 'brush', 'legend' => 'Second Data Set');
$chart->y_format['theta'] = array('colour' => 'green', 'line' => 'brush', 'legend' => 'Third Data Set');
// order in which to draw data sets.
$chart->y_order = array('alpha', 'beta', 'theta');
$chart->parameter['x_axis_angle'] = 60;
// x_axis text rotation
$chart->parameter['y_decimal_left'] = 2;
$chart->parameter['y_axis_num_ticks'] = 6;
$chart->parameter['brush_size'] = 4;
$chart->parameter['shadow_offset'] = 4;
//$chart->parameter['legend'] = 'outside-left';
//$chart->parameter['legend_border'] = 'black';
// draw it.
$chart->draw();
开发者ID:shojibflamon,项目名称:Bar-Code-example,代码行数:30,代码来源:test02.php

示例4: graph

        $maxpermin = $row->permin;
    }
}
//print_r($permincount);
rs_close($userspermin);
$bar = new graph(800, 600);
$bar->parameter['title'] = '';
$bar->parameter['y_label_left'] = 'users per minute';
$bar->parameter['x_label'] = 'count';
$bar->parameter['y_label_angle'] = 90;
$bar->parameter['x_label_angle'] = 0;
$bar->parameter['x_axis_angle'] = 60;
//following two lines seem to silence notice warnings from graphlib.php
$bar->y_tick_labels = null;
$bar->offset_relation = null;
//$bar->parameter['bar_size']    = 1; // will make size > 1 to get overlap effect when showing groups
//$bar->parameter['bar_spacing'] = 1; // don't forget to increase spacing so that graph doesn't become one big block of colour
$bar->x_data = $xdata;
$bar->y_data['count'] = $permincount;
$bar->y_format['count'] = array('colour' => 'blue', 'bar' => 'fill');
$bar->y_order = array('count');
$bar->parameter['y_min_left'] = 0;
// start at 0
$bar->parameter['y_max_left'] = $maxpermin;
$bar->parameter['y_decimal_left'] = 0;
// 2 decimal places for y axis.
//$bar->parameter['x_min_left'] = 0;  // start at 0
//$bar->parameter['x_max_left'] = count($userspermin);
//$bar->parameter['y_axis_gridlines'] = $maxpermin;
$bar->draw();
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:30,代码来源:usersgraph.php

示例5: graph

$db_tg = new graph(500, 400);
if ($SYS["bcompiler_extension"]) {
    $db_tg->y_data["barras"] = array_values($plist_time_ellapsed);
}
$db_tg->y_data["mbarras"] = array_values($cplist_time_ellapsed);
$db_tg->x_data = array_keys($cplist_time_ellapsed);
$db_tg->parameter["file_name"] = $SYS["BASE"] . "/Data/Img/Tmp/render";
$db_tg->parameter["path_to_fonts"] = $SYS["DOCROOT"] . "/Data/Fonts/";
if ($SYS["bcompiler_extension"]) {
    $db_tg->parameter['title'] = _("lib_planty Compiled  vs Source") . "({$totaltime})";
} else {
    $db_tg->parameter['title'] = _("lib_planty") . "({$totaltime})";
}
$db_tg->parameter['x_label'] = _("Number of rows");
$db_tg->parameter['y_label_left'] = _("Render time");
if ($SYS["bcompiler_extension"]) {
    $db_tg->y_format['barras'] = array('colour' => 'green', 'line' => 'line', 'point' => 'square-open', 'bar' => 'fill');
}
$db_tg->y_format['mbarras'] = array('colour' => 'red', 'line' => 'line', 'point' => 'square-open', 'bar' => 'fill');
if ($SYS["bcompiler_extension"]) {
    $db_tg->y_order = array('barras', "mbarras");
} else {
    $db_tg->y_order = array('mbarras');
}
$db_tg->parameter["y_decimal_left"] = 5;
$db_tg->parameter['y_resolution_left'] = 5;
$db_tg->draw();
/* end of render test */
$img_tabs = array("memory_usage" => $SYS["ROOT"] . '/Data/Img/Tmp/memory_usage.png', "time_ellapsed" => $SYS["ROOT"] . '/Data/Img/Tmp/time_ellapsed.png', "database" => $SYS["ROOT"] . '/Data/Img/Tmp/database.png', "select" => $SYS["ROOT"] . '/Data/Img/Tmp/select.png', "render" => $SYS["ROOT"] . '/Data/Img/Tmp/render.png', "OBJECT_TIME" => $OBJECT_TIME, "DB_TIME" => $DB_TIME);
plantHTML($img_tabs, "test_tabs");
HTML("footer");
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:31,代码来源:testme.php


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