本文整理汇总了PHP中graph::set_inner_background方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::set_inner_background方法的具体用法?PHP graph::set_inner_background怎么用?PHP graph::set_inner_background使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graph
的用法示例。
在下文中一共展示了graph::set_inner_background方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: return_ofc_data
function return_ofc_data($styles)
{
global $cms, $ps;
$ofc = $cms->input['ofc'];
$data = array();
$data_avg = array();
$avg = 0;
$interval = 1000;
$maxlimit = 1000;
$minlimit = 0;
$max = 21;
$field = $ofc == 'skill' ? 'dayskill' : $ofc;
if (!in_array($field, array('skill', 'kills', 'onlinetime'))) {
$field = 'dayskill';
}
$plrid = $cms->input['id'];
$ps->db->query("SELECT statdate,{$field} FROM {$ps->t_plr_data} WHERE plrid=" . $ps->db->escape($plrid, true) . " ORDER BY statdate DESC LIMIT {$max}");
$i = 1;
while (list($statdate, $skill) = $ps->db->fetch_row(0)) {
$skill = round($skill);
$sum += $skill;
$data[] = $skill;
$labels[] = $statdate;
}
if ($data) {
$data = array_reverse($data);
$labels = array_reverse($labels);
$avg = $sum / count($data);
$data_avg[] = $avg;
$data_avg = array_pad($data_avg, count($data) - 1, 'null');
// yes, 'null' is a string
$data_avg[] = $avg;
$minlimit = floor(min($data) / $interval) * $interval;
$maxlimit = ceil(max($data) / $interval) * $interval;
}
include_once PS_ROOTDIR . '/includes/ofc/open-flash-chart.php';
$g = new graph();
$g->bg_colour = $styles->val('flash.plrskill.bgcolor', 'flash.bgcolor');
$g->title($styles->val('flash.plrskill.title'), '{' . $styles->val('flash.plrskill.title.style', 'font-size: 12px', true) . '}');
$g->set_data($data_avg);
$g->set_data($data);
$lines = $styles->attr('flash.plrskill.lines.line');
$g->line(coalesce($lines[0]['width'], 1), coalesce($lines[0]['color'], '#9999ee'), coalesce($lines[0]['key'], $cms->trans('Average')), coalesce($lines[0]['key_size'], $styles->val('flash.plrskill.lines.key_size'), 9));
$g->line(coalesce($lines[1]['width'], 1), coalesce($lines[1]['color'], '#9999ee'), coalesce($lines[1]['key'], $cms->trans('Skill')), coalesce($lines[1]['key_size'], $styles->val('flash.plrskill.lines.key_size'), 9));
// label each point with its value
$g->set_x_labels($labels);
// $g->set_x_axis_steps(count($labels) / 3 + 1);
// $g->set_x_tick_size(1);
// $g->set_x_label_style( 10, '0x000000', 0, 2 );
// $g->set_x_label_style('none');
$g->set_x_label_style(8, '#000000', 2);
$g->set_inner_background(coalesce($styles->val('flash.plrskill.bg_inner1', 'flash.bg_inner1'), '#E3F0FD'), coalesce($styles->val('flash.plrskill.bg_inner2', 'flash.bg_inner2'), '#CBD7E6'), coalesce($styles->val('flash.plrskill.bg_inner_angle', 'flash.bg_inner_angle'), 90));
$g->x_axis_colour('#eeeeee', '#eeeeee');
$g->y_axis_colour('#eeeeee', '#eeeeee');
// $g->set_x_offset( false );
// set the Y max
$g->set_y_max($maxlimit);
$g->set_y_min($minlimit);
// label every 20 (0,20,40,60)
// $g->x_label_steps( 2 );
// display the data
print $g->render();
}
示例2: date
$max = 0;
for ($i = -4; $i < 1; $i++) {
$date = date('Y-m-d', strtotime($i . ' days'));
if ($i == 0) {
$daysRow[] = t('Today');
} else {
$daysRow[] = strftime('%a', strtotime($i . ' days'));
}
$total = PageStatistics::getTotalPageViewsForOthers($u, $date);
$viewsArray[] = $total;
if ($total > $max) {
$max = $total;
}
}
$g = new graph();
$g->set_title(' ', '{color: #ffffff}');
$g->set_data($viewsArray);
$g->bg_colour = '#ffffff';
$g->set_inner_background('#ffffff', "#cccccc", 90);
// we add the 3 line types and key labels
$g->line_dot(3, 5, '#4C85BB', false, 10);
$g->set_x_labels($daysRow);
$g->set_x_label_style(10, '#ababab', 0, 2);
$g->x_axis_colour('#333333', '#bebebe');
$g->y_axis_colour('#333333', '#bebebe');
$g->set_y_max($max);
$g->num_decimals = 0;
$g->is_fixed_num_decimals_forced = true;
$g->y_label_steps(5);
$g->set_y_legend(t('Views'), 12, '#333333');
echo $g->render();
示例3: return_ofc_day
function return_ofc_day()
{
global $cms, $ps;
$styles =& $cms->theme->styles;
$days = array();
$labels = array();
$data = array();
$data_avg = array();
$sum = 0;
$avg = 0;
$max = 31;
$maxlimit = 100;
// get the last 31 days of data
$list = $ps->db->fetch_rows(1, "SELECT statdate,SUM(connections) connections " . "FROM {$ps->t_map_data} " . "GROUP BY statdate " . "ORDER BY statdate DESC LIMIT {$max}");
$now = $list ? ymd2time($list[0]['statdate']) : time();
while (count($days) < $max) {
$days[date('Y-m-d', $now)] = 'null';
$labels[] = date('M jS', $now);
$now -= 60 * 60 * 24;
}
$days = array_reverse($days);
$labels = array_reverse($labels);
// build our data and labels
$data = $days;
$maxdata = 0;
foreach ($list as $d) {
if (!array_key_exists($d['statdate'], $days)) {
continue;
}
$sum += $d['connections'];
$data[$d['statdate']] = $d['connections'];
$maxdata = max($maxdata, $d['connections']);
}
if ($data) {
$avg = $sum / count($data);
$data_avg[] = $avg;
$data_avg = array_pad($data_avg, count($data), 'null');
$data_avg[] = $avg;
# $data_avg = array_pad(array(), count($data), $avg);
$maxlimit = ceil(ceil($maxdata / 100) * 100);
}
include_once PS_ROOTDIR . '/includes/ofc/open-flash-chart.php';
$g = new graph();
$g->bg_colour = $styles->val('flash.conn.bgcolor', 'flash.bgcolor');
$g->title($styles->val('flash.conn.title', $cms->trans('Daily Connections'), true), '{' . $styles->val('flash.conn.title.style', 'font-size: 16px', true) . '}');
# $g->set_data($data_avg);
# $g->line(1, '#9999ee', 'Average Connections', 9);
# $g->set_data($data);
## $g->line_hollow(1, 3, '#5555ff', 'Connections', 9);
# $g->bar(75, '#5555ff', 'Connections', 9);
$avg_line = new line($styles->val('flash.conn.line.width'), $styles->val('flash.conn.line.color'));
$avg_line->key($styles->val('flast.conn.line.key', $cms->trans('Average Connections'), true), $styles->val('flash.conn.line.size', 9, true));
$avg_line->data = $data_avg;
$conn_bar = new bar_3d($styles->val('flash.conn.bar3d.opacity', 75, true), $styles->val('flash.conn.bar3d.color1', '#5555ff', true), $styles->val('flash.conn.bar3d.color2', '#3333DD', true));
$conn_bar->key($styles->val('flash.conn.bar3d.key', $cms->trans('Connections'), true), $styles->val('flash.conn.bar3d.size', 9, true));
$conn_bar->data = $data;
/*
$keys = array_keys($data);
for ($i=0; $i<count($data); $i++) {
$conn_bar->add_data_tip($data[$keys[$i]],
$cms->trans("Connections: %d", $data[$keys[$i]]) . "<br>" .
$cms->trans("Average: %d", $data_avg[0])
);
}
/**/
$g->set_tool_tip(sprintf($styles->val('flash.conn.tooltip', '#x_label#<br>#key#: #val# (' . $cms->trans('Avg') . ': %d)', true), round($data_avg[0])));
$g->data_sets[] = $avg_line;
$g->data_sets[] = $conn_bar;
$g->set_x_axis_3d(6);
// label each point with its value
$g->set_x_labels($labels);
// $g->set_x_axis_steps(count($labels) / 3 + 1);
// $g->set_x_tick_size(1);
$g->set_x_label_style(10, '#000000', 0, 3, '#cccccc');
// $g->set_x_label_style('none');
# $g->set_x_label_style( 8, '#000000', 2 );
$g->set_inner_background(coalesce($styles->val('flash.conn.bg_inner1', 'flash.bg_inner1'), '#E3F0FD'), coalesce($styles->val('flash.conn.bg_inner2', 'flash.bg_inner2'), '#CBD7E6'), coalesce($styles->val('flash.conn.bg_inner_angle', 'flash.bg_inner_angle'), 90));
$g->x_axis_colour('#909090', '#ADB5C7');
// $g->x_axis_colour('#eeeeee', '#eeeeee');
$g->y_axis_colour('#5555ff', '#eeeeee');
// $g->set_x_offset( false );
// set the Y max
$g->set_y_min(0);
$g->set_y_max($maxlimit);
$g->set_y_legend($styles->val('flash.conn.bar3d.key', $cms->trans('Connections')), 12, $styles->val('flash.conn.bar3d.color1', '#5555ff', true));
print $g->render();
}
示例4: graph
<?php
include_once( 'classes/open-flash-chart.php' );
$data = $_REQUEST['d'];
$labels = $_REQUEST['l'];
$title = $_REQUEST['title'];
$type = $_REQUEST['type'];
$sort = $_REQUEST['sort'];
$resubmit = $PHP_SELF . "?" . $_SERVER['QUERY_STRING'];
$g = new graph();
$g->title( $title, '{font-size: 18px; color: #A0A0A0;}' );
$g->set_inner_background( '#E3F0FD', '#CBD7E6', 90 );
$g->bg_colour = '#FFFFFF';
if ($sort == true){
array_multisort($labels,$data);
}
if ($type == 'line'){
$g->set_data($data);
$g->line_hollow( 2, 4, '#5E83BF', 'Documentos', 10 );
$g->set_x_labels($labels);
$g->set_x_label_style( 10, '0x000000', 0, 2 );
$g->set_y_max( max($data) );
$g->y_label_steps(4);