本文整理汇总了PHP中Chart::createImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Chart::createImage方法的具体用法?PHP Chart::createImage怎么用?PHP Chart::createImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chart
的用法示例。
在下文中一共展示了Chart::createImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createImage
/**
* Create the image.
*/
protected function createImage()
{
parent::createImage();
// Get graphical obects
$img = $this->plot->getImg();
$palette = $this->plot->getPalette();
$text = $this->plot->getText();
$primitive = $this->plot->getPrimitive();
// Get the graph area
$graphArea = $this->plot->getGraphArea();
// Aqua-like background
for ($i = $graphArea->y1; $i < $graphArea->y2; $i++) {
$color = $palette->backgroundColor[($i + 3) % 4];
$primitive->line($graphArea->x1, $i, $graphArea->x2, $i, $color);
}
}
示例2: createImage
/**
* Creates the pie chart image
*
* @access private
*/
function createImage()
{
parent::createImage();
$pieColors = array(array(2, 78, 0), array(148, 170, 36), array(233, 191, 49), array(240, 127, 41), array(243, 63, 34), array(190, 71, 47), array(135, 81, 60), array(128, 78, 162), array(121, 75, 255), array(142, 165, 250), array(162, 254, 239), array(137, 240, 166), array(104, 221, 71), array(98, 174, 35), array(93, 129, 1));
$this->pieColor = array();
$this->pieShadowColor = array();
$shadowFactor = 0.5;
foreach ($pieColors as $colorRGB) {
list($red, $green, $blue) = $colorRGB;
$color = new Color($red, $green, $blue);
$shadowColor = new Color($red * $shadowFactor, $green * $shadowFactor, $blue * $shadowFactor);
array_push($this->pieColor, $color);
array_push($this->pieShadowColor, $shadowColor);
}
$this->axisColor1 = new Color(201, 201, 201);
$this->axisColor2 = new Color(158, 158, 158);
$this->aquaColor1 = new Color(242, 242, 242);
$this->aquaColor2 = new Color(231, 231, 231);
$this->aquaColor3 = new Color(239, 239, 239);
$this->aquaColor4 = new Color(253, 253, 253);
// Legend box
$this->outlinedBox($this->pieTLX, $this->pieTLY, $this->pieBRX, $this->pieBRY);
// Aqua-like background
$aquaColor = array($this->aquaColor1, $this->aquaColor2, $this->aquaColor3, $this->aquaColor4);
for ($i = $this->pieTLY + 2; $i < $this->pieBRY - 1; $i++) {
$color = $aquaColor[($i + 3) % 4];
$this->primitive->line($this->pieTLX + 2, $i, $this->pieBRX - 2, $i, $color);
}
}
示例3: createImage
/**
* Create the image
*
* @access protected
*/
function createImage()
{
parent::createImage();
$this->axisColor1 = new Color(201, 201, 201);
$this->axisColor2 = new Color(158, 158, 158);
$this->aquaColor1 = new Color(242, 242, 242);
$this->aquaColor2 = new Color(231, 231, 231);
$this->aquaColor3 = new Color(239, 239, 239);
$this->aquaColor4 = new Color(253, 253, 253);
$this->barColor1 = new Color(42, 71, 181);
$this->barColor2 = new Color(33, 56, 143);
$this->barColor3 = new Color(172, 172, 210);
$this->barColor4 = new Color(117, 117, 143);
// Aqua-like background
$aquaColor = array($this->aquaColor1, $this->aquaColor2, $this->aquaColor3, $this->aquaColor4);
for ($i = $this->graphTLY; $i < $this->graphBRY; $i++) {
$color = $aquaColor[($i + 3) % 4];
$this->primitive->line($this->graphTLX, $i, $this->graphBRX, $i, $color);
}
// Axis
imagerectangle($this->img, $this->graphTLX - 1, $this->graphTLY, $this->graphTLX, $this->graphBRY, $this->axisColor1->getColor($this->img));
imagerectangle($this->img, $this->graphTLX - 1, $this->graphBRY, $this->graphBRX, $this->graphBRY + 1, $this->axisColor1->getColor($this->img));
}
示例4: createImage
/**
* Creates the pie chart image.
*/
protected function createImage()
{
parent::createImage();
// Get graphical obects
$img = $this->plot->getImg();
$palette = $this->plot->getPalette();
$primitive = $this->plot->getPrimitive();
// Get the graph area
$graphArea = $this->plot->getGraphArea();
// Legend box
$primitive->outlinedBox($graphArea->x1, $graphArea->y1, $graphArea->x2, $graphArea->y2, $palette->axisColor[0], $palette->axisColor[1]);
// Aqua-like background
for ($i = $graphArea->y1 + 2; $i < $graphArea->y2 - 1; $i++) {
$color = $palette->backgroundColor[($i + 3) % 4];
$primitive->line($graphArea->x1 + 2, $i, $graphArea->x2 - 2, $i, $color);
}
}