本文整理汇总了PHP中Khill\Lavacharts\Utils类的典型用法代码示例。如果您正苦于以下问题:PHP Utils类的具体用法?PHP Utils怎么用?PHP Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Utils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: animationEasing
/**
* Animation Easing
*
* The easing function applied to the animation. The following options are available:
* 'linear' - Constant speed.
* 'in' - Ease in - Start slow and speed up.
* 'out' - Ease out - Start fast and slow down.
* 'inAndOut' - Ease in and out - Start slow, speed up, then slow down.
*
* @param string $easing
*
* @return Chart
*/
public function animationEasing($easing = 'linear')
{
$values = array('linear', 'in', 'out', 'inAndOut');
if (in_array($easing, $values)) {
$this->easing = $easing;
} else {
$this->error('Invalid animationEasing value, must be (string) ' . Utils::arrayToPipedString($values));
}
return $this;
}
开发者ID:alvarobfdev,项目名称:applog,代码行数:23,代码来源:Animation.php
示例17: hAxes
/**
* Specifies properties for individual horizontal axes, if the chart has multiple horizontal axes.
* Each child object is a hAxis object, and can contain all the properties supported by hAxis.
* These property values override any global settings for the same property.
* To specify a chart with multiple horizontal axes, first define a new axis using series.targetAxisIndex,
* then configure the axis using hAxes.
*
* @param array $hAxisConfigArray Array of HorizontalAxis configuration arrays
* @return \Khill\Lavacharts\Charts\Chart
* @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
*/
public function hAxes($hAxisConfigArray)
{
if (Utils::arrayIsMulti($hAxisConfigArray) === false) {
throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'array', 'With arrays of HorizontalAxis options.');
}
$hAxes = [];
foreach ($hAxisConfigArray as $hAxisConfig) {
$hAxes[] = new HorizontalAxis($hAxisConfig);
}
return $this->setOption(__FUNCTION__, $hAxes);
}
开发者ID:tahertechs,项目名称:lavacharts,代码行数:22,代码来源:HorizontalAxesTrait.php
示例18: series
/**
* An array of objects, each describing the format of the corresponding series
* in the chart.
* To use default values for a series, specify an null in the array.
* If a series or a value is not specified, the global value will be used.
*
* @param array $seriesConfigArray Array of Series options.
* @return \Khill\Lavacharts\Charts\Chart
* @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
*/
public function series($seriesConfigArray)
{
if (Utils::arrayIsMulti($seriesConfigArray) === false) {
throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'array', 'With arrays of Series options.');
}
$series = [];
foreach ($seriesConfigArray as $seriesConfig) {
$series[] = new Series($seriesConfig);
}
return $this->setOption(__FUNCTION__, $series);
}
开发者ID:tahertechs,项目名称:lavacharts,代码行数:21,代码来源:SeriesTrait.php
示例19: isStacked
/**
* If set to true, stacks the elements for all series at each domain value.
*
* Note: In Column, Area, and SteppedArea charts, Google Charts reverses the order
* of legend items to better correspond with the stacking of the series elements
* (E.g. series 0 will be the bottom-most legend item). This does not apply to Bar Charts.
*
* The isStacked option also supports 100% stacking, where the stacks
* of elements at each domain value are rescaled to add up to 100%.
*
* The options for isStacked are:
*
* false — elements will not stack. This is the default option.
* true — stacks elements for all series at each domain value.
* 'percent' — stacks elements for all series at each domain value
* and rescales them such that they add up to 100%, with each element's
* value calculated as a percentage of 100%.
* 'relative' — stacks elements for all series at each domain value
* and rescales them such that they add up to 1, with each element's
* value calculated as a fraction of 1.
* 'absolute' — functions the same as isStacked: true.
*
* For 100% stacking, the calculated value for each element will appear
* in the tooltip after its actual value.
*
* The target axis will default to tick values based on the relative
* 0-1 scale as fractions of 1 for 'relative', and 0-100% for 'percent'
* (Note: when using the 'percent' option, the axis/tick values are
* displayed as percentages, however the actual values are the relative
* 0-1 scale values. This is because the percentage axis ticks are the
* result of applying a format of "#.##%" to the relative 0-1 scale values.
* When using isStacked: 'percent', be sure to specify any ticks/gridlines
* using the relative 0-1 scale values). You can customize the gridlines/tick
* values and formatting using the appropriate hAxis/vAxis options.
*
* 100% stacking only supports data values of type number, and must have a baseline of zero.
*
* @param bool|string $isStacked
* @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
* @return \Khill\Lavacharts\Charts\Chart
*/
public function isStacked($isStacked)
{
$values = ['relative', 'absolute'];
if (is_bool($isStacked) === true) {
return $this->setBoolOption(__FUNCTION__, $isStacked);
} elseif (is_string($isStacked) === true) {
return $this->setStringInArrayOption(__FUNCTION__, $isStacked, $values);
} else {
throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'bool|string', 'Whose value is one of ' . Utils::arrayToPipedString($values));
}
}
开发者ID:tahertechs,项目名称:lavacharts,代码行数:52,代码来源:IsStackedTrait.php
示例20: trendlines
/**
* Defines how the chart trendlines will be displayed.
*
* @param array $trendlineConfigArray
* @return \Khill\Lavacharts\Charts\Chart
* @throws \Khill\Lavacharts\Traits\InvalidConfigValue
*/
public function trendlines($trendlineConfigArray)
{
if (Utils::arrayIsMulti($trendlineConfigArray) === false) {
throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'array', 'With arrays of Trendline options.');
}
$trendlines = [];
foreach ($trendlineConfigArray as $index => $trendlineConfig) {
$trendlines[(string) $index] = new Trendline($trendlineConfig);
}
return $this->setOption(__FUNCTION__, $trendlines);
}
开发者ID:tahertechs,项目名称:lavacharts,代码行数:18,代码来源:TrendlinesTrait.php
注:本文中的Khill\Lavacharts\Utils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论