Source for file Circular.php
Documentation is available at Circular.php
* Description: Circled Series
* @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
Represents the static finalant pi / 180.
private $circleBackColor;
private $iBack3D; // global to all instances
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
self::$PIDEGREE = M_PI / 180;
$this->circleBackColor = new Color(0,0,0,0,true); // EMPTY
$this->HALFPI = 0.5 * M_PI;
$this->vxValues->name = "ValuesAngle"; // TODO $this->Language->getString("ValuesAngle");
if (($r->width % 2) == 1) {
if (($r->height % 2) == 1) {
$this->circleWidth = $r->width;
$this->circleHeight = $r->height;
$result = $this->circleBackColor;
if ($result->isEmpty()) {
if ($this->chart->getPrinting()) {
$result = $tmpColor->WHITE;
if (!$this->chart->getWalls()->getBack()->getTransparent()) {
if ($result->isEmpty()) {
$result = $this->chart->getPanel()->getColor();
$result = $this->circleGradient;
if ($this->customXRadius != 0) {
$this->circleWidth = 2 * $this->iXRadius;
$this->iXRadius = $this->circleWidth / 2;
if ($this->customYRadius != 0) {
$this->circleHeight = 2 * $this->iYRadius;
$this->iYRadius = $this->circleHeight / 2;
private function adjustRatio($aRatio, $g) {
// todo: obtain width and height from "g" instead of screen device
$tmpRatio = (1.0 * $tmpW / $tmpH);
$result = 1.0 * $aRatio / $tmpRatio;
private function calcCircledRatio() {
$this->chart->getGraphics3D());
private function adjustCircleMarks() {
$tmpFrame = $this->getMarks()->getCallout()->getLength();
if ($this->getMarks()->getPen()->getVisible()) {
$this->chart->getGraphics3D()->setFont($this->getMarks()->getFont());
$tmpH = $this->chart->getGraphics3D()->getFontHeight() + $tmpFrame;
$this->chart->getGraphics3D()->textWidth(" ") + $tmpFrame); // TODO textWidth($this->Language->getString("CharForHeight"))
//CDI base method called last to initialise Radius values
$this->adjustCircleMarks();
$this->calcCircledRatio();
// Trick (due to .Net delayed GC)
if ($value != $this->chart) {
if ($this->chart != null) {
if ($this->chart != null) {
$g = $this->chart->getGraphics3D();
$tmp = ($g == null) ? true : !$g->getSupportsFullRotation();
if ($enableParentProps) {
if ($this->iBack3D != null) {
$this->chart->getAspect()->assign($this->iBack3D);
if ($this->iBack3D == null) {
$this->iBack3D = new Aspect();
$a = $this->chart->getAspect();
$this->iBack3D->assign($a);
if ($a->getOrthogonal()) {
$a->setOrthogonal(false);
* The angle of Chart rotation.<br>
* The RotationAngle can be a valid integer number between 0 and 359.<br>
* This angle can be changed by code to rotate the Pie (or Polar). <br>
return $this->rotationAngle;
* Sets angle of Chart rotation.<br>
* <pre><font face="Courier" size="4">
* pieSeries = new com.steema.teechart.styles.Pie(myChart.getChart());
* pieSeries.getMarks().setVisible(true);
* pieSeries.getMarks().setStyle(MarksStyle.LABELPERCENT);
* pieSeries.fillSampleValues(5);
* pieSeries.setAngleSize(180);
* pieSeries.setRotationAngle(90);
$this->rotDegree = $this->rotationAngle * self::$PIDEGREE;
* Returns the exact Screen position for a given pair of Angle and Radius
public function angleToPos($angle, $aXRadius, $aYRadius) {
* Returns the angle from the XY point parameter to the circle center.
$result = - $this->HALFPI;
* Returns the radius from XY point to the circle center.
$dx *= $range / (double) $this->iXRadius;
$dy *= $range / (double) $this->iYRadius;
* Returns the angle by which the Chart is rotated.
public function rotate($angle) {
* Returns the exact horizontal size of the ellipse's radius in pixels.<br>
* The ellipse XRadius can be set to a fixed number of pixels by using
* this method. Circled series.Circled controls whether both radii must
* be proportional to the Screen X/Y ratio.
* Returns the exact vertical size of the ellipse's radius in pixels.<br>
* The ellipse YRadius can be set to a fixed number of pixels by using this
* method. Circled series .Circled controls whether both radii must be
* proportional to the Screen X/Y ratio.
* Returns the exact horizontal position of ellipse's center in pixels.<br>
* Run-time and read only.
* The ellipse's radius is determined by Circled series.XRadius and YRadius.
* The AngleToPoint function converts from angles to X and Y Screen
* coordinates. The PointToAngle function converts from XY Screen positions
* Returns the exact vertical position of the ellipse's center in pixels.
* The ellipse's radius is determined by Circled series.XRadius and YRadius.
* The AngleToPoint function converts from angles to X and Y Screen
* coordinates. The PointToAngle function converts from XY Screen positions
* Returns the width of the bounding Circle.
return $this->circleWidth;
* Returns the height of the bounding Circle.
return $this->circleHeight;
* Returns the rectangle that bounds the circle.<br>
* eg. Pie Series, in its default position displacement of elevevation,
* rotation ,etc not applied.
return!$this->circleBackColor->isEmpty();
* Determines the color to fill the ellipse.<br>
* Setting it to Color.EMPTY indicates the CircledSeries to use to
* tChart.getPanel().getColor() color.
return $this->circleBackColor;
* Determines the color to fill the ellipse.<br>
if ($this->bBrush->getTransparency() != 0) {
$this->circleBackColor = $value->transparentColor($this->bBrush->getTransparency());
$this->circleBackColor = $this->setColorProperty($this->circleBackColor, $value);
* Determines the Gradient which fills the ellipse.<br>
* <pre><font face="Courier" size="4">
* series = new com.steema.teechart.styles.Polar(myChart.getChart());
* series.fillSampleValues(20);
* series.setCircled(true);
* series.getCircleGradient().setDirection(GradientDirection.RADIAL);
* series.getCircleGradient().setStartColor(Color.WHITE);
* series.getCircleGradient().setEndColor(Color.DARK_GRAY);
* series.getCircleGradient().setRadialX(100);
* series.getCircleGradient().setRadialY(-100);
* series.getCircleGradient().setVisible(true);
* series.getCirclePen().setColor(Color.NAVY);
* series.getCirclePen().setStyle(DashStyle::$DOT);
* series.getCirclePen().setWidth(2);
if ($this->circleGradient == null) {
return $this->circleGradient;
* The CirleSeries as elliptical or circular.<br>
* Sets CirleSeries as elliptical or circular.<br>
* The ellipse's horizontal radius in pixels.<br>
return $this->customXRadius;
* Sets ellipse's horizontal radius in pixels.<br>
* The ellipse's vertical radius in pixels.<br>
return $this->customYRadius;
* Sets ellipse's vertical radius in pixels.<br>
|