本文整理汇总了PHP中Graph::SetxTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::SetxTitle方法的具体用法?PHP Graph::SetxTitle怎么用?PHP Graph::SetxTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph::SetxTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gmstrftime
// require you to be a member of the super-admin group
session_require(array('group' => '1', 'admin_flags' => 'A'));
$request = HTTPRequest::instance();
$group_id = $request->getValidated('group_id', 'GroupId');
if (!$group_id) {
$group_id = 0;
}
$year = $request->getValidated('year', 'uint');
if (!$year) {
$year = gmstrftime("%Y", time());
}
$sql = "SELECT month,day,site_views,subdomain_views FROM stats_site ORDER BY month ASC, day ASC";
$res = db_query($sql);
$i = 0;
while ($row = db_fetch_array($res)) {
$xdata[$i] = $i;
$xlabel[$i] = substr($row['month'], 4) + 1 - 1 . "/" . $row['day'];
$ydata1[$i] = $row["site_views"] + $row["subdomain_views"];
++$i;
}
$graph = new Graph(750, 550);
$data1 = $graph->AddData($xdata, $ydata1, $xlabel);
$graph->DrawGrid('gray');
$graph->LineGraph($data1, 'red');
$graph->SetTitle("Codendi Page Views");
$graph->SetSubTitle("Page Views (RED) since beginning of time ( {$i} days )");
$graph->SetxTitle('Date');
$graph->SetyTitle('Views (RED)');
$graph->DrawAxis();
//$graph->showDebug();
$graph->ShowGraph('png');
示例2: Graph
$xlabel[$i] = $row['month'] . ($row['day'] ? "/" . $row['day'] : '');
$ydata1[$i] = $row["site_views"] + $row["subdomain_views"];
++$i;
}
$graph = new Graph(750, 550);
//
// Need at least 2 data points
//
if ($i == 0) {
$xdata[0] = 0;
$xlabel[0] = "";
$ydata1[1] = 0;
$xdata[1] = 1;
$xlabel[1] = "";
$ydata1[1] = 0;
}
if ($i == 1) {
$xdata[1] = 1;
$xlabel[1] = $xlabel[0];
$ydata1[1] = $ydata1[0];
}
$graph->SetTitle(_('Gforge Page Views'));
$graph->SetSubTitle(sprintf(_('Total Page Views (RED) (%1$s days)'), $i));
$data1 = $graph->AddData($xdata, $ydata1, $xlabel);
$graph->LineGraph($data1, 'red');
$graph->DrawGrid('gray');
$graph->SetxTitle(_('Date'));
$graph->SetyTitle(_('Views (RED)'));
$graph->DrawAxis();
//$graph->showDebug();
$graph->ShowGraph('png');