本文整理汇总了PHP中Grid::draw方法的典型用法代码示例。如果您正苦于以下问题:PHP Grid::draw方法的具体用法?PHP Grid::draw怎么用?PHP Grid::draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid
的用法示例。
在下文中一共展示了Grid::draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init(awDriver $driver)
{
list($x1, $y1, $x2, $y2) = $this->getPosition();
// Get PlotGroup space
list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1);
// Count values in the group
$values = $this->getXAxisNumber();
// Init the PlotGroup
$this->axis->top->line->setX($x1, $x2);
$this->axis->bottom->line->setX($x1, $x2);
$this->axis->left->line->setY($y2, $y1);
$this->axis->right->line->setY($y2, $y1);
$this->axis->top->setPadding($leftSpace, $rightSpace);
$this->axis->bottom->setPadding($leftSpace, $rightSpace);
$xMin = $this->getXMin();
$xMax = $this->getXMax();
$this->axis->top->setRange($xMin, $xMax);
$this->axis->bottom->setRange($xMin, $xMax);
for ($i = 0; $i < count($this->components); $i++) {
$component = $this->components[$i];
$component->auto($this->auto);
// Copy space to the component
$component->setSpace($this->space->left, $this->space->right, $this->space->top, $this->space->bottom);
$component->xAxis->setPadding($leftSpace, $rightSpace);
$component->xAxis->line->setX($x1, $x2);
$component->yAxis->line->setY($y2, $y1);
}
// Set Y axis range
foreach (array('left', 'right') as $axis) {
if ($this->isAxisUsed($axis)) {
$min = $this->getRealYMin($axis);
$max = $this->getRealYMax($axis);
$interval = $max - $min;
$this->axis->{$axis}->setRange($min - $interval * $this->space->bottom / 100, $max + $interval * $this->space->top / 100);
// Auto-scaling mode
if ($this->axis->{$axis}->isAuto()) {
$this->axis->{$axis}->autoScale();
}
}
}
if ($this->axis->left->getLabelNumber() === NULL) {
$number = round(($y2 - $y1) / 75) + 2;
$this->axis->left->setLabelNumber($number);
}
if ($this->axis->right->getLabelNumber() === NULL) {
$number = round(($y2 - $y1) / 75) + 2;
$this->axis->right->setLabelNumber($number);
}
// Center labels on X axis if needed
$test = array(awPlot::TOP => FALSE, awPlot::BOTTOM => FALSE);
for ($i = 0; $i < count($this->components); $i++) {
$component = $this->components[$i];
if ($component->getValues() !== NULL) {
$axis = $component->getXAxis();
if ($test[$axis] === FALSE) {
// Center labels for bar plots
if ($component->getXCenter()) {
$size = $this->axis->{$axis}->getDistance(0, 1);
$this->axis->{$axis}->label->move($size / 2, 0);
$this->axis->{$axis}->label->hideLast(TRUE);
$test[$axis] = TRUE;
}
}
}
}
// Set axis labels
$labels = array();
for ($i = $xMin; $i <= $xMax; $i++) {
$labels[] = $i;
}
if ($this->axis->top->label->count() === 0) {
$this->axis->top->label->set($labels);
}
if ($this->axis->bottom->label->count() === 0) {
$this->axis->bottom->label->set($labels);
}
// Set ticks
$this->axis->top->tick('major')->setNumber($values);
$this->axis->bottom->tick('major')->setNumber($values);
$this->axis->left->tick('major')->setNumber($this->axis->left->getLabelNumber());
$this->axis->right->tick('major')->setNumber($this->axis->right->getLabelNumber());
// Set X axis on zero
if ($this->xAxisZero) {
$axis = $this->selectYAxis();
$this->axis->bottom->setYCenter($axis, 0);
$this->axis->top->setYCenter($axis, 0);
}
// Set Y axis on zero
if ($this->yAxisZero) {
$axis = $this->selectXAxis();
$this->axis->left->setXCenter($axis, 1);
$this->axis->right->setXCenter($axis, 1);
}
parent::init($driver);
list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1);
// Create the grid
$this->createGrid();
// Draw the grid
$this->grid->setSpace($leftSpace, $rightSpace, 0, 0);
$this->grid->draw($driver, $x1, $y1, $x2, $y2);
//.........这里部分代码省略.........
示例2: init
function init($drawer)
{
list($x1, $y1, $x2, $y2) = $this->getPosition();
$this->xAxis->line->setX($x1, $x2);
$this->xAxis->label->setAlign(NULL, LABEL_BOTTOM);
$this->xAxis->label->move(0, 3);
$this->xAxis->setRange($this->extremum->left, $this->extremum->right);
$this->yAxis->line->setY($y2, $y1);
$this->yAxis->label->setAlign(LABEL_RIGHT);
$this->yAxis->label->move(-6, 0);
$this->yAxis->reverseTickStyle();
$this->yAxis->setRange($this->extremum->bottom, $this->extremum->top);
$this->xAxis->setYCenter($this->yAxis, 0);
$this->yAxis->setXCenter($this->xAxis, 0);
if ($this->yAxis->getLabelNumber() === NULL) {
$number = $this->extremum->top - $this->extremum->bottom + 1;
$this->yAxis->setLabelNumber($number);
}
if ($this->xAxis->getLabelNumber() === NULL) {
$number = $this->extremum->right - $this->extremum->left + 1;
$this->xAxis->setLabelNumber($number);
}
// Set ticks
$this->xAxis->ticks['major']->setNumber($this->xAxis->getLabelNumber());
$this->yAxis->ticks['major']->setNumber($this->yAxis->getLabelNumber());
// Set axis labels
$labels = array();
for ($i = 0, $count = $this->xAxis->getLabelNumber(); $i < $count; $i++) {
$labels[] = $i;
}
$this->xAxis->label->set($labels);
$labels = array();
for ($i = 0, $count = $this->yAxis->getLabelNumber(); $i < $count; $i++) {
$labels[] = $i;
}
$this->yAxis->label->set($labels);
parent::init($drawer);
// Create the grid
$this->createGrid();
// Draw the grid
$this->grid->draw($drawer, $x1, $y1, $x2, $y2);
}
示例3: Column
$grilla->addColumn(new Column("S", 0, true, false, -1, "btnSeleccionar", "/modules/usuarios_registrados/clientes/seleccionar_empresa.php", "", -1, true, -1, "Seleccionar"));
$grilla->addColumn(new Column("Contrato"));
$grilla->addColumn(new Column("CUIT"));
$grilla->addColumn(new Column("Razón Social"));
$grilla->setColsSeparator(true);
$grilla->setOrderBy($ob);
$grilla->setPageNumber($pagina);
$grilla->setParams($params);
$grilla->setRefreshIntoWindow(true);
$grilla->setRowsSeparator(true);
$grilla->setRowsSeparatorColor("#c0c0c0");
$grilla->setShowTotalRegistros(false);
$grilla->setSql($sql);
$grilla->setTableStyle("GridTableCiiu");
$grilla->setUseTmpIframe(true);
$grilla->draw();
?>
</div>
<div align="center" id="divProcesando" name="divProcesando" style="display:none"><img border="0" src="/images/waiting.gif" title="Espere por favor..."></div>
<script type="text/javascript">
function CopyContent() {
try {
window.parent.document.getElementById('divContentGrid').innerHTML = document.getElementById('divContentGrid').innerHTML;
}
catch(err) {
//
}
}
CopyContent();
</script>