本文整理汇总了PHP中graph::set_width方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::set_width方法的具体用法?PHP graph::set_width怎么用?PHP graph::set_width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graph
的用法示例。
在下文中一共展示了graph::set_width方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if (sizeof($oCat->getAllChildren($val)) == 0) {
$links[] = "javascript:alert('Cette categorie n a pas de sous-categorie')";
} else {
$links[] = "./statsCompte.php?cat_id={$val}";
}
}
$pie->pie_slice_colours($color);
$oSmarty->assign("DEBUG", $debug);
$pie->pie_values($data, $label, $links);
//
// Colours for each slice, in this case some of the colours
// will be re-used (3 colurs for 5 slices means the last two
// slices will have colours colour[0] and colour[1]):
//
$pie->set_tool_tip('#val#%');
$pie->set_width(650);
$pie->set_height(400);
$pie->title('Résumé sur l\'année', '{font-size:18px; color: #d01f3c}');
$pie->set_output_type('js');
$ofc2 = $pie->render();
/*************************************/
$oSmarty->assign("OFC", $ofc);
$oSmarty->assign("OFC2", $ofc2);
$oSmarty->assign("OFC3", $ofc3);
// stats
$chrono->stop();
$oSmarty->assign("TIME", $chrono->getTime());
$oSmarty->assign("REQUESTS", $mysql->nbRequest);
// Affichage du template après compilation
$oSmarty->debugging = false;
$oSmarty->display('statsCompte.html');
示例2: isset
/**
*/
function chart_flash($data, $params)
{
if (empty($data)) {
return;
}
include_once YF_PATH . 'libs/yf_open_flash_chart/open-flash-chart.php';
$width = isset($params['width']) ? $params['width'] : '90%';
$height = isset($params['height']) ? $params['height'] : '90%';
$g = new graph();
$g->js_path = isset($params['js_path']) ? $params['js_path'] : '/js/';
$g->swf_path = isset($params['swf_path']) ? $params['swf_path'] : '/js/';
$g->title(' ', '{font-size: 20px;}');
$g->bg_colour = '#e9e9e9';
$g->x_axis_colour('#000000', '#c1c1c1');
$g->y_axis_colour('#000000', '#c1c1c1');
$g->set_data($data);
// Find maximal strlen of x axis label
foreach ((array) $data as $k => $v) {
$xlabel_len[] = _strlen($k);
}
if (max($xlabel_len) > 7) {
$orientation = 2;
} else {
$orientation = 0;
}
$g->set_x_labels(array_keys($data));
$g->set_x_label_style(10, '#000000', $orientation, 2);
$g->set_y_max(max($data));
$g->set_y_label_style(10, '#000000', 0, 2);
$g->set_y_legend('Price', 10, '#000000');
$g->set_x_legend('Date', 10, '#000000');
$g->set_tool_tip('#val# EUR on #x_label#');
$g->line_dot(2, 3, '#0750D9', '', 10);
// формат значений
$g->set_num_decimals(0);
$g->set_y_format('#val#€');
$g->set_width($width);
$g->set_height($height);
$g->set_output_type('js');
return $g->render();
}
示例3: umc_donation_java_chart
function umc_donation_java_chart()
{
global $UMC_SETTING;
$sql_chart = "SELECT SUM(amount) as monthly, year(date) as date_year, month(date) as date_month FROM minecraft_srvr.`donations` GROUP BY YEAR(date), MONTH(date);";
$D = umc_mysql_fetch_all($sql_chart);
$lastdate = "2010-11";
$ydata = array();
$legend = array();
$minval = $maxval = 0;
$sum = 0;
foreach ($D as $row) {
$month = sprintf("%02d", $row['date_month']);
$date = $row['date_year'] . '-' . $month;
$datetime1 = new DateTime("{$lastdate}-01");
$datetime2 = new DateTime("{$date}-01");
$interval = $datetime1->diff($datetime2);
$int = $interval->format('%m');
$int--;
for ($i = $int; $i > 0; $i--) {
// echo "$i $int - ";
$e_date = date("Y-m", mktime(0, 0, 0, $row['date_month'] - $i, 01, $row['date_year']));
// $e_month = $row['date_month'] - $i;
// $e_date = $row['date_year'] . '-' . $e_month;
$sum = $sum - 135;
$ydata[] = $sum;
//echo $e_date . ": " . $sum . "<br>";
$legend[] = $e_date . "-01";
$maxval = max($sum, $maxval);
$minval = min($sum, $minval);
}
$sum = $sum + $row['monthly'] - 135;
//echo $date . ": " . $sum . "<br>";
$ydata[] = $sum;
$legend[] = $date . "-01";
$lastdate = $date;
$maxval = max($sum, $maxval);
$minval = min($sum, $minval);
}
$outstanding = $sum * -1;
require_once $UMC_SETTING['path']['html'] . '/admin/flash/open-flash-chart.php';
$g = new graph();
//$g->title("Donation Stats", '{font-size: 15px; color: #000000}');
$g->bg_colour = '#FFFFFF';
// Some data (line 1):
$g->set_data($ydata);
$legend1 = "Cost vs. donations balance in USD";
$g->line(1, '#0000FF', $legend1, 10);
// $g->set_y_legend( $legend1, 12, '#0000FF' );
$g->set_y_max($maxval);
$g->set_y_min($minval);
$g->y_axis_colour('#0000FF', '#DFDFDF');
$g->x_axis_colour('#DFDFDF', '#FFFFFF');
$g->set_x_legend('Uncovery Minecraft Server uptime', 12, '#000000');
// The X Axis labels are the time, 00:00, 01:00, 02:00 etc...
$g->set_x_labels($legend);
$g->set_x_label_style(8, '#000000', 1, 1, '#DFDFDF');
// lines in the background
$g->y_label_steps(10);
$g->set_width('100%');
$g->set_height(300);
$g->set_output_type('js');
$g->set_js_path('/admin/flash/');
$g->set_swf_path('/admin/flash/');
return array('chart' => $g->render(), 'outstanding' => $outstanding);
}
示例4:
?>
<html>
<head>
<title><?=$title?></title>
<link rel="stylesheet" rev="stylesheet" href="css/chart.css" type="text/css" media="screen"/>
</head>
<body>
<ul>
<li class="chart_bar">
<a href="<?=$resubmit. "&type=bar"?>"><span>Barra</span></a>
</li>
<li class="chart_line">
<a href="<?=$resubmit. "&type=line"?>"><span>Linha</span></a>
</li>
<li class="chart_pie">
<a href="<?=$resubmit. "&type=pie"?>"><span>Pizza</span></a>
</li>
</ul>
<?
$g->set_width( 630 );
$g->set_height( 430 );
$g->set_output_type('js');
echo $g->render();
?>
</body>
</html>