本文整理汇总了PHP中Khill\Lavacharts\Utils::arrayValuesCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::arrayValuesCheck方法的具体用法?PHP Utils::arrayValuesCheck怎么用?PHP Utils::arrayValuesCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Khill\Lavacharts\Utils
的用法示例。
在下文中一共展示了Utils::arrayValuesCheck方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Create a new Binding for the dashboard.
*
* @param mixed $arg1 One or array of many ControlWrappers
* @param mixed $arg2 One or array of many ChartWrappers
* @throws \Khill\Lavacharts\Exceptions\InvalidBindings
* @return \Khill\Lavacharts\Dashboards\Bindings\Binding
*/
public static function create($arg1, $arg2)
{
$chartWrapperArrayCheck = Utils::arrayValuesCheck($arg2, 'class', 'ChartWrapper');
$controlWrapperArrayCheck = Utils::arrayValuesCheck($arg1, 'class', 'ControlWrapper');
if ($arg1 instanceof ControlWrapper && $arg2 instanceof ChartWrapper) {
return new OneToOne($arg1, $arg2);
} elseif ($arg1 instanceof ControlWrapper && $chartWrapperArrayCheck) {
return new OneToMany($arg1, $arg2);
} elseif ($controlWrapperArrayCheck && $arg2 instanceof ChartWrapper) {
return new ManyToOne($arg1, $arg2);
} elseif ($controlWrapperArrayCheck && $chartWrapperArrayCheck) {
return new ManyToMany($arg1, $arg2);
} else {
throw new InvalidBindings();
}
}
示例2: colors
/**
* The colors to use for the chart elements.
*
* An array of strings, where each element is an HTML color string
* for example:['red','#004411']
*
*
* @access public
* @param array $colorArray
* @return \Khill\Lavacharts\Charts\Chart
* @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
*/
public function colors($colorArray)
{
if (Utils::arrayValuesCheck($colorArray, 'string') === false) {
throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'array', 'with valid HTML colors');
}
return $this->setOption(__FUNCTION__, $colorArray);
}
示例3: vAxes
/**
* Specifies properties for individual vertical axes
*
* If the chart has multiple vertical axes. Each child object is a vAxis object,
* and can contain all the properties supported by vAxis.
* These property values override any global settings for the same property.
*
* To specify a chart with multiple vertical axes, first define a new axis using
* series.targetAxisIndex, then configure the axis using vAxes.
*
* @param array $a Array of VerticalAxis objects
* @throws InvalidConfigValue
*
* @return AreaChart
*/
public function vAxes($a)
{
if (Utils::arrayValuesCheck($a, 'class', 'VerticalAxis')) {
return $this->addOption(array(__FUNCTION__ => $a));
} else {
throw $this->invalidConfigValue(__FUNCTION__, 'array', 'of VerticalAxis Objects');
}
}
示例4: addColumnFromArray
/**
* Supplemental function to add columns from an array.
*
* @param array $colDefArray
* @throws InvalidColumnDefinition
* @return DataTable
*/
private function addColumnFromArray($colDefArray)
{
if (Utils::arrayValuesCheck($colDefArray, 'string') && Utils::between(1, count($colDefArray), 4, true)) {
call_user_func_array(array($this, 'addColumnFromStrings'), $colDefArray);
} else {
throw new InvalidColumnDefinition($colDefArray);
}
return $this;
}
示例5: colors
/**
* The colors to use for the chart elements. An array of strings, where each
* element is an HTML color string, for example: colors:['red','#004411'].
*
* @param array $cArr
* @throws InvalidConfigValue
*
* @return Chart
*/
public function colors($cArr)
{
if (Utils::arrayValuesCheck($cArr, 'string')) {
return $this->addOption(array(__FUNCTION__ => $cArr));
} else {
throw $this->invalidConfigValue(__FUNCTION__, 'array', 'with valid HTML colors');
}
}
示例6: colors
/**
* Colors to assign to values in the visualization. An array of strings,
* where each element is an HTML color string.
*
* For example: ['red', '#004411']
* You must have at least two values; the gradient will include all your
* values, plus calculated intermediary values, with the first color as the
* smallest value, and the last color as the highest.
*
* @param array $colors
* @return \Khill\Lavacharts\Configs\ColorAxis
* @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
*/
public function colors($colors)
{
if (is_array($colors) === false || count($colors) <= 1 || Utils::arrayValuesCheck($colors, 'string') === false) {
throw new InvalidConfigValue(__FUNCTION__, 'array', 'with a minimum of two strings representing html colors.');
}
return $this->setOption(__FUNCTION__, $colors);
}
示例7: testArrayValuesCheckWithBadParams
/**
* @dataProvider badParamsProvider
*/
public function testArrayValuesCheckWithBadParams($badData, $testType, $extra = '')
{
$this->assertFalse(Utils::arrayValuesCheck($badData, $testType, $extra));
}
示例8: formatColumns
/**
* Sets the format of multiple columns.
*
* @access public
* @param array $colFormatArr
* @return \Khill\Lavacharts\DataTables\DataTable
* @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
*/
public function formatColumns($colFormatArr)
{
if (Utils::arrayValuesCheck($colFormatArr, 'class', 'Format') === false) {
throw new InvalidConfigValue('DataTable->' . __FUNCTION__, 'array', 'Where the keys are column indices and the values Format objects');
}
foreach ($colFormatArr as $index => $format) {
$this->formatColumn($index, $format);
}
return $this;
}
示例9: lineDashStyle
/**
* Many styles of dashed lines are possible via the lineDashStyle option, which takes an array of numbers.
*
* The first number indicates the length of a dash, and the second indicates the gap after it.
* If there is a third number, that's the length of the next dash, and a fourth number, if present,
* is the length of the next gap.
*
* When the chart is drawn, these lengths are repeated, so [4, 4] means a succession of 4-length dashes
* and 4-length gaps. [5, 1, 3] means a 5-length dash, a 1-length gap, a 3-length dash, a 5-length gap, and so on.
*
*
* @param array $lineDashStyle
* @return \Khill\Lavacharts\Configs\Series
* @throws \Khill\Lavacharts\Exceptions\InvalidConfigValue
*/
public function lineDashStyle($lineDashStyle)
{
if (Utils::arrayValuesCheck($lineDashStyle, 'int') === false) {
throw new InvalidConfigValue(static::TYPE . '->' . __FUNCTION__, 'array', 'of integers');
}
return $this->setOption(__FUNCTION__, $lineDashStyle);
}
示例10: colors
/**
* Colors to assign to values in the visualization. An array of strings,
* where each element is an HTML color string.
*
* For example: $this->colors = array('red', '#004411')
* You must have at least two values; the gradient will include all your
* values, plus calculated intermediary values, with the first color as the
* smallest value, and the last color as the highest.
*
* @param array $colors
* @throws InvalidConfigValue
* @return ColorAxis
*/
public function colors($colors)
{
if (is_array($colors) && Utils::arrayValuesCheck($colors, 'string') && count($colors) > 1) {
$this->colors = $colors;
} else {
throw new InvalidConfigValue(__FUNCTION__, 'array', 'minimum of two, with values as html color strings');
}
return $this;
}