Class yii\debug\models\timeline\Svg

Inheritanceyii\debug\models\timeline\Svg » yii\base\BaseObject
Implementsyii\base\Configurable
Available since version2.0.8
Source Code https://github.com/yiisoft/yii2-debug/blob/master/models/timeline/Svg.php

Svg is used to draw a graph using SVG

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$panel yii\debug\panels\TimelinePanel yii\debug\models\timeline\Svg
$points array Each point is define by a X and a Y coordinate. yii\debug\models\timeline\Svg

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\BaseObject
__construct() Constructor. yii\debug\models\timeline\Svg
__get() Returns the value of an object property. yii\base\BaseObject
__isset() Checks if a property is set, i.e. defined and not null. yii\base\BaseObject
__set() Sets value of an object property. yii\base\BaseObject
__toString() yii\debug\models\timeline\Svg
__unset() Sets an object property to null. yii\base\BaseObject
canGetProperty() Returns a value indicating whether a property can be read. yii\base\BaseObject
canSetProperty() Returns a value indicating whether a property can be set. yii\base\BaseObject
className() Returns the fully qualified name of this class. yii\base\BaseObject
hasMethod() Returns a value indicating whether a method is defined. yii\base\BaseObject
hasPoints() yii\debug\models\timeline\Svg
hasProperty() Returns a value indicating whether a property is defined. yii\base\BaseObject
init() Initializes the object. yii\base\BaseObject

Property Details

$gradient public property

Color indicators svg graph.

public array $gradient = [10 => '#d6e685'60 => '#8cc665'90 => '#44a340'100 => '#1e6823']
$listenMessages public property

Listen messages panels

public array $listenMessages = ['log''profiling']
$panel protected property
$points protected property

Each point is define by a X and a Y coordinate.

protected array $points = []
$stroke public property

Stroke color

public string $stroke '#1e6823'
$template public property

Svg template

public string $template '<svg xmlns="http://www.w3.org/2000/svg" width="{x}" height="{y}" viewBox="0 0 {x} {y}" preserveAspectRatio="none"><defs>{linearGradient}</defs><g><polygon points="{polygon}" fill="url(#gradient)"/><polyline points="{polyline}" fill="none" stroke="{stroke}" stroke-width="1"/></g></svg>'
$x public property

Max X coordinate

public integer $x 1920
$y public property

Max Y coordinate

public integer $y 40

Method Details

__construct() public method

Constructor.

The default implementation does two things:

  • Initializes the object with the given configuration $config.
  • Call init().

If this method is overridden in a child class, it is recommended that

  • the last parameter of the constructor is a configuration array, like $config here.
  • call the parent implementation at the end of the constructor.
public void __construct ( yii\debug\panels\TimelinePanel $panel, $config = [] )
$panel
$config array

Name-value pairs that will be used to initialize the object properties

__toString() public method

public string __toString ( )
addPoints() protected method

protected integer addPoints ( $messages )
$messages array

Log messages. See Logger::messages for the structure

return integer

Added points

hasPoints() public method

public boolean hasPoints ( )
return boolean

Has points

linearGradient() protected method

protected string linearGradient ( )
polygon() protected method

protected string polygon ( )
return string

Points attribute for polygon path

polyline() protected method

protected string polyline ( )
return string

Points attribute for polyline path