當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Lavacharts\Utils類代碼示例

本文整理匯總了PHP中Khill\Lavacharts\Utils的典型用法代碼示例。如果您正苦於以下問題:PHP Utils類的具體用法?PHP Utils怎麽用?PHP Utils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Utils類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getOption

 /**
  * Overriding getOption function to pull config options from calendar array.
  * (Thanks google)
  *
  * @param  string             $o Which option to fetch
  * @throws InvalidConfigValue
  * @return mixed
  */
 public function getOption($o)
 {
     if (is_string($o) && array_key_exists($o, $this->options['calendar'])) {
         return $this->options['calendar'][$o];
     } else {
         if (is_string($o) && array_key_exists($o, $this->options)) {
             return $this->options[$o];
         } else {
             $calendarOptions = $this->options['calendar'];
             $nonCalendarOptions = array_diff($this->options, $calendarOptions);
             $options = array_merge($calendarOptions, $nonCalendarOptions);
             throw $this->invalidConfigValue(__FUNCTION__, 'string', 'must be one of ' . Utils::arrayToPipedString(array_keys($options)));
         }
     }
 }
開發者ID:alvarobfdev,項目名稱:applog,代碼行數:23,代碼來源:CalendarChart.php

示例2: strokeOpacity

 /**
  * Sets the opacity of the stroke.
  *
  * @param  float $strokeOpacity
  * @return \Khill\Lavacharts\Configs\Stroke
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  */
 public function strokeOpacity($strokeOpacity)
 {
     if (Utils::between(0.0, $strokeOpacity, 1.0, true) === false) {
         throw new InvalidConfigValue(__FUNCTION__, 'float', 'between 0.0 and 1.0');
     }
     return $this->setOption(__FUNCTION__, $strokeOpacity);
 }
開發者ID:tahertechs,項目名稱:lavacharts,代碼行數:14,代碼來源:Stroke.php

示例3: offset

 /**
  * How far to separate the slice from the rest of the pie.
  * from 0.0 (not at all) to 1.0 (the pie's radius).
  *
  * @param  float $offset
  * @return \Khill\Lavacharts\Configs\Slice
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  */
 public function offset($offset)
 {
     if (Utils::between(0.0, $offset, 1.0) === false) {
         throw new InvalidConfigValue(__FUNCTION__, 'float', 'where 0.0 < $offset < 1.0');
     }
     return $this->setOption(__FUNCTION__, $offset);
 }
開發者ID:tahertechs,項目名稱:lavacharts,代碼行數:15,代碼來源:Slice.php

示例4: opacity

 /**
  * Sets the transparency of assigned object points
  *
  * 1.0 being completely opaque and 0.0 fully transparent.
  *
  * @param  float $opacity
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  * @return \Khill\Lavacharts\Charts\Chart
  */
 public function opacity($opacity)
 {
     if (Utils::between(0.0, $opacity, 1.0) === false) {
         throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'float', 'between 0.0 - 1.0');
     }
     return $this->setOption(__FUNCTION__, $opacity);
 }
開發者ID:tahertechs,項目名稱:lavacharts,代碼行數:16,代碼來源:OpacityTrait.php

示例5: barGroupWidth

 /**
  * The width of a group of bars, specified in either of these formats:
  * - Pixels (e.g. 50).
  * - Percentage of the available width for each group (e.g. '20%'),
  *   where '100%' means that groups have no space between them.
  *
  * @param  int|string $barGroupWidth
  * @return \Khill\Lavacharts\Charts\Chart
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  */
 public function barGroupWidth($barGroupWidth)
 {
     if (Utils::isIntOrPercent($barGroupWidth) === false) {
         throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'int|string', 'String only if representing a percent. "50%"');
     }
     return $this->setOption(__FUNCTION__, ['groupWidth' => $barGroupWidth]);
 }
開發者ID:tahertechs,項目名稱:lavacharts,代碼行數:17,代碼來源:BarGroupWidthTrait.php

示例6: pieHole

 /**
  * If between 0 and 1, displays a donut chart.
  *
  * The hole with have a radius equal to $pieHole times the radius of the chart.
  *
  *
  * @param  integer|float $pieHole Size of the pie hole.
  * @return \Khill\Lavacharts\Charts\DonutChart
  * @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
  */
 public function pieHole($pieHole)
 {
     if (Utils::between(0.0, $pieHole, 1.0) === false) {
         throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'float', 'while, 0 < pieHole < 1 ');
     }
     return $this->setOption(__FUNCTION__, $pieHole);
 }
開發者ID:tahertechs,項目名稱:lavacharts,代碼行數:17,代碼來源:DonutChart.php

示例7: set

 /**
  * Sets the callback for an event.
  *
  * @access public
  * @param  string $event
  * @param  string $callback
  * @throws \Khill\Lavacharts\Exceptions\InvalidEvent
  * @throws \Khill\Lavacharts\Exceptions\InvalidEventCallback
  */
 public function set($event, $callback)
 {
     $this->validEvent($event);
     if (Utils::nonEmptyString($callback) === false) {
         throw new InvalidEventCallback($callback);
     }
     $this->events[$event] = $callback;
 }
開發者ID:tahertechs,項目名稱:lavacharts,代碼行數:17,代碼來源:EventManager.php

示例8: __construct

 /**
  * Builds the Event object.
  *
  * @param  string             $c Name of Javascript callback function.
  * @throws InvalidConfigValue
  * @return Event
  */
 public function __construct($c)
 {
     if (Utils::nonEmptyString($c)) {
         $this->callback = $c;
     } else {
         throw new InvalidConfigValue('an Event', 'string');
     }
 }
開發者ID:alvarobfdev,項目名稱:applog,代碼行數:15,代碼來源:Event.php

示例9: offset

 /**
  * How far to separate the slice from the rest of the pie.
  * from 0.0 (not at all) to 1.0 (the pie's radius).
  *
  * @param  float              $offset
  * @throws InvalidConfigValue
  * @return Slice
  */
 public function offset($offset)
 {
     if (Utils::between(0.0, $offset, 1.0)) {
         $this->offset = $offset;
     } else {
         throw new InvalidConfigValue(__FUNCTION__, 'float', 'where 0.0 < $offset < 0.1');
     }
     return $this;
 }
開發者ID:alvarobfdev,項目名稱:applog,代碼行數:17,代碼來源:Slice.php

示例10: barGroupWidth

 /**
  * The width of a group of bars, specified in either of these formats:
  * - Pixels (e.g. 50).
  * - Percentage of the available width for each group (e.g. '20%'),
  *   where '100%' means that groups have no space between them.
  *
  * @param  mixed       $barGroupWidth
  * @return ColumnChart
  */
 public function barGroupWidth($barGroupWidth)
 {
     if (Utils::isIntOrPercent($barGroupWidth)) {
         $this->addOption(array('bar' => array('groupWidth' => $barGroupWidth)));
     } else {
         throw $this->invalidConfigValue(__FUNCTION__, 'string | int', 'must be a valid int or percent [ 50 | 65% ]');
     }
     return $this;
 }
開發者ID:antoniotajuelo,項目名稱:lavacharts,代碼行數:18,代碼來源:ColumnChart.php

示例11: strokeOpacity

 /**
  * Sets the opacity of the stroke.
  *
  * @param  float             $strokeOpacity
  * @throws InvalidConfigValue
  * @return Stroke
  */
 public function strokeOpacity($so)
 {
     if (Utils::between(0.0, $so, 1.0, true)) {
         $this->strokeOpacity = (double) $so;
     } else {
         throw new InvalidConfigValue(__FUNCTION__, 'float');
     }
     return $this;
 }
開發者ID:alvarobfdev,項目名稱:applog,代碼行數:16,代碼來源:Stroke.php

示例12: pieHole

 /**
  * If between 0 and 1, displays a donut chart. The hole with have a radius
  * equal to $pieHole times the radius of the chart.
  *
  * @param int|float $pieHole
  *
  * @return DonutChart
  */
 public function pieHole($pieHole)
 {
     if (Utils::between(0.0, $pieHole, 1.0)) {
         $this->addOption(array('pieHole' => $pieHole));
     } else {
         throw $this->invalidConfigValue(__FUNCTION__, 'float', 'while, 0 < pieHole < 1 ');
     }
     return $this;
 }
開發者ID:alvarobfdev,項目名稱:applog,代碼行數:17,代碼來源:DonutChart.php

示例13: matchType

 /**
  * The method of filtering the string:
  *
  * exact - The pattern matches the string exactly.
  * prefix - The pattern is found at the beginning of the string.
  * any - The pattern is found anywhere in the string.
  *
  * @param  string             $position
  * @throws InvalidConfigValue
  * @return StringFilter
  */
 public function matchType($type)
 {
     $values = array('exact', 'prefix', 'any');
     if (is_string($type) && in_array($type, $values)) {
         $this->addOption(array(__FUNCTION__ => $type));
     } else {
         throw $this->invalidConfigValue(__FUNCTION__, 'string', 'with a value of ' . Utils::arrayToPipedString($values));
     }
     return $this;
 }
開發者ID:peter-draznik,項目名稱:lavacharts,代碼行數:21,代碼來源:StringFilter.php

示例14: curveType

 /**
  * Controls the curve of the lines when the line width is not zero.
  *
  * Can be one of the following:
  * 'none' - Straight lines without curve.
  * 'function' - The angles of the line will be smoothed.
  *
  * @param  string             $curveType
  * @throws InvalidConfigValue
  * @return LineChart
  */
 public function curveType($curveType)
 {
     $values = array('none', 'function');
     if (is_string($curveType) && in_array($curveType, $values)) {
         $this->addOption(array('curveType' => $curveType));
     } else {
         throw $this->invalidConfigValue(__FUNCTION__, 'string', 'with a value of ' . Utils::arrayToPipedString($values));
     }
     return $this;
 }
開發者ID:alienwizard,項目名稱:MediahelpCRM_local,代碼行數:21,代碼來源:LineChart.php

示例15: axisTitlesPosition

 /**
  * Where to place the axis titles, compared to the chart area. Supported values:
  *
  * in - Draw the axis titles inside the the chart area.
  * out - Draw the axis titles outside the chart area.
  * none - Omit the axis titles.
  *
  * @param  string             $position
  * @throws InvalidConfigValue
  * @return AreaChart
  */
 public function axisTitlesPosition($position)
 {
     $values = array('in', 'out', 'none');
     if (is_string($position) && in_array($position, $values)) {
         $this->addOption(array('axisTitlesPosition' => $position));
     } else {
         throw $this->invalidConfigValue(__FUNCTION__, 'string', 'with a value of ' . Utils::arrayToPipedString($values));
     }
     return $this;
 }
開發者ID:alienwizard,項目名稱:MediahelpCRM_local,代碼行數:21,代碼來源:AreaChart.php


注:本文中的Khill\Lavacharts\Utils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。