You are here

function pChart::drawCircle in Visitors 7.0

Same name and namespace in other branches
  1. 8 pchart/pChart.inc \pChart::drawCircle()
2 calls to pChart::drawCircle()
pChart::drawBasicPieGraph in pchart/pChart.inc
pChart::drawEllipse in pchart/pChart.inc

File

pchart/pChart.inc, line 2256

Class

pChart

Code

function drawCircle($Xc, $Yc, $Height, $R, $G, $B, $Width = 0) {
  if ($Width == 0) {
    $Width = $Height;
  }
  if ($R < 0) {
    $R = 0;
  }
  if ($R > 255) {
    $R = 255;
  }
  if ($G < 0) {
    $G = 0;
  }
  if ($G > 255) {
    $G = 255;
  }
  if ($B < 0) {
    $B = 0;
  }
  if ($B > 255) {
    $B = 255;
  }
  $C_Circle = imagecolorallocate($this->Picture, $R, $G, $B);
  $Step = 360 / (2 * 3.1418 * max($Width, $Height));
  for ($i = 0; $i <= 360; $i = $i + $Step) {
    $X = cos($i * 3.1418 / 180) * $Height + $Xc;
    $Y = sin($i * 3.1418 / 180) * $Width + $Yc;
    $this
      ->drawAntialiasPixel($X, $Y, $R, $G, $B);
  }
}