本文整理汇总了PHP中ezcGraphRenderer::drawRadarDataLine方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcGraphRenderer::drawRadarDataLine方法的具体用法?PHP ezcGraphRenderer::drawRadarDataLine怎么用?PHP ezcGraphRenderer::drawRadarDataLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezcGraphRenderer
的用法示例。
在下文中一共展示了ezcGraphRenderer::drawRadarDataLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderData
/**
* Render the assigned data
*
* Will renderer all charts data in the remaining boundings after drawing
* all other chart elements. The data will be rendered depending on the
* settings in the dataset.
*
* @param ezcGraphRenderer $renderer Renderer
* @param ezcGraphBoundings $boundings Remaining boundings
* @return void
*/
protected function renderData(ezcGraphRenderer $renderer, ezcGraphBoundings $boundings)
{
// Apply axis space
$xAxisSpace = ($boundings->x1 - $boundings->x0) * $this->axis->axisSpace;
$yAxisSpace = ($boundings->y1 - $boundings->y0) * $this->axis->axisSpace;
$center = new ezcGraphCoordinate($boundings->width / 2, $boundings->height / 2);
// We do not differentiate between display types in radar charts.
$nr = $count = count($this->data);
// Draw axis at major steps of virtual axis
$steps = $this->elements['rotationAxis']->getSteps();
$lastStepPosition = null;
$axisColor = $this->elements['axis']->border;
foreach ($steps as $step) {
$this->elements['axis']->label = $step->label;
$this->drawRotatedAxis($this->elements['axis'], $boundings, $center, $step->position, $lastStepPosition);
$lastStepPosition = $step->position;
if (count($step->childs)) {
foreach ($step->childs as $childStep) {
$this->elements['axis']->label = null;
$this->elements['axis']->border = $this->childAxisColor;
$this->drawRotatedAxis($this->elements['axis'], $boundings, $center, $childStep->position, $lastStepPosition);
$lastStepPosition = $childStep->position;
}
}
$this->elements['axis']->border = $axisColor;
}
// Display data
$this->elements['axis']->position = ezcGraph::TOP;
foreach ($this->data as $datasetName => $data) {
--$nr;
// Determine fill color for dataset
if ($this->options->fillLines !== false) {
$fillColor = clone $data->color->default;
$fillColor->alpha = (int) round((255 - $fillColor->alpha) * ($this->options->fillLines / 255));
} else {
$fillColor = null;
}
// Draw lines for dataset
$lastPoint = false;
foreach ($data as $key => $value) {
$point = new ezcGraphCoordinate($this->elements['rotationAxis']->getCoordinate($key), $this->elements['axis']->getCoordinate($value));
/* Transformation required for 3d like renderers ...
* which axis should transform here?
$point = $this->elements['xAxis']->axisLabelRenderer->modifyChartDataPosition(
$this->elements['yAxis']->axisLabelRenderer->modifyChartDataPosition(
new ezcGraphCoordinate(
$this->elements['xAxis']->getCoordinate( $key ),
$this->elements['yAxis']->getCoordinate( $value )
)
)
);
// */
$renderer->drawRadarDataLine($boundings, new ezcGraphContext($datasetName, $key, $data->url[$key]), $data->color->default, clone $center, $lastPoint === false ? $point : $lastPoint, $point, $nr, $count, $data->symbol[$key], $data->color[$key], $fillColor, $this->options->lineThickness);
$lastPoint = $point;
}
}
}