Source for file ChartPen.php
Documentation is available at ChartPen.php
* Description: Common Chart Pen. Pen used to draw lines and borders
* @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
// public $dashCap = DashCap.FLAT;
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
public function ChartPen($c, $startColor= null, $startVisible= true,
$startWidth= 1, $startEndCap=- 1, $startStyle= null) {
$startColor= new Color(0,0,0,0,true);
if ($startEndCap== null) {
// TODO $tmpLineCap=new LineCap();
// $startEndCap = $tmpLineCap->BEVEL;
$this->width = $startWidth;
public function reset() {
setEndCap(LineCap.ROUND);
setDashCap(DashCap.FLAT);
$this->width = $p->width;
$this->color = $p->color;
// TODO $this->dashCap = $p->dashCap;
$this->transparency = $p->transparency;
$this->stroke = $p->stroke;
//CDI AssignVisiblePenColor
public function _assign($p, $value) {
if ($this->color != $value) {
if ($this->colorChanged != null) {
$this->colorChanged->invoke($this, null, null);
* Determines if the pen will draw lines or not.
* Determines if the pen will draw lines or not.
* Sets Transparency level from 0 to 100%. <br>
return (127* $this->transparency/ 100);
* Sets Transparency level from 0 to 100%. <br>
* Determines the color used by the pen to draw lines on the Drawing.
* It can be any valid color constant like Color.Red, Color.Green, etc. <br>
* A special color constant unique to TeeChart is: Color.EMPTY.
* This is the "default color". <br><br>
* Each TeeChart drawing object has a different default color. For example,
* the tChart.getFrame() property has a default color of Color.BLACK.
if ($this->transparency == 0) {
return $this->color->transparentColor($this->transparency);
if ($this->endCap != $value) {
if ($this->stroke == null) {
// "stroke" is cached due to speed reasons.
// creating a BasicStroke is a slow operation.
private function recreateStroke() {
/* if ($this->dashStyle == DashStyle::$SOLID) {
// todo remove ... imagesetthickness ( resource image, int thickness)
$this->stroke = new BasicStroke($this->width, $this->dashCap.getValue(), $this->endCap.getValue());
$this->stroke = new $this->BasicStroke($this->width, $this->dashCap.getValue(), $this->endCap.getValue(),
$this->dashStyle.getDash(), 0);
private function changed() {
/** @todo FINISH / NECESSARY? */
if (this == chart.getGraphics3D().getPen()) {
chart.getGraphics3D().Changed(this);
* Defines segment ending style of dashed lines.<br>
* Default value: DashCap.Flat
if ($this->dashCap != $value) {
* Determines the width of lines the pen draws.<br>
* Determines the width of lines the pen draws.<br>
if ($this->width != $value) {
* Determines the style in which the pen draw lines on the Drawing.
* Determines the style in which the pen draw lines on the Drawing.
// TODO maybe remove ? pep $this->recreateStroke();
$this->dashWidth = $value;
|