本文整理汇总了PHP中graph::addBulkPoints方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::addBulkPoints方法的具体用法?PHP graph::addBulkPoints怎么用?PHP graph::addBulkPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graph
的用法示例。
在下文中一共展示了graph::addBulkPoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createGraph
function createGraph($data, $w = 400, $h = 200, $prop = "", $random = false)
{
global $numGraphs;
$numGraphs++;
$graph = new graph($w, $h);
if (is_array($prop)) {
$graph->storePropArr($prop);
} else {
$graph->setBulkProps($prop);
}
$data = explode(":", $data);
$dt = $data[1];
if (strtoupper($data[0]) == "XML") {
$graph->importXML($dt, isset($data[2]) ? $data[2] : "i", isset($data[3]) ? $data[3] : "d", isset($data[4]) ? $data[4] : "", isset($data[5]) ? $data[5] : 0);
} elseif (strtoupper($data[0]) == "CSV") {
$graph->importCSV($dt, isset($data[2]) ? $data[2] : "d,i", isset($data[3]) ? $data[3] : 0);
} elseif (strtoupper($data[0]) == "RAW") {
$graph->addBulkPoints($dt, ';');
} elseif (strtoupper($data[0]) == "FUN") {
$graph->graphFunction($dt, isset($data[2]) ? $data[2] : -1, isset($data[2]) ? $data[2] : 1);
} else {
$graph->error("Inline data format not understood. Read the readme.");
}
$graph->graph();
$name = $graph->getProp("tempfolder", "") . "graph" . substr(basename($_SERVER['PHP_SELF']), 0, 3) . $numGraphs . ($random == true ? rand(1, 100000) : "") . '.png';
$graph->showGraph($name);
if ($random && $graph->getProp("delold", true)) {
$fname = $graph->getProp("tempfolder", "") . "imagehistory" . basename($_SERVER['PHP_SELF']) . ".data";
$f = @file($fname);
if (count($f) > $graph->getProp("cachehistory", 5)) {
unlink($f[0]);
unset($f[0]);
}
$f[] = $name;
file_put_contents($fname, join(array_filter($f, $this->trimfilter), "\n"));
}
unset($graph);
return $name;
}