本文整理汇总了PHP中Label::setCallbackFunction方法的典型用法代码示例。如果您正苦于以下问题:PHP Label::setCallbackFunction方法的具体用法?PHP Label::setCallbackFunction怎么用?PHP Label::setCallbackFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::setCallbackFunction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setLabelText
/**
* Change text of labels
*
* @param array $texts Some texts
*/
public function setLabelText($texts) {
if(is_array($texts)) {
$this->auto(FALSE);
$function = 'axis'.time().'_'.(microtime() * 1000000);
eval('function '.$function.'($value) {
$texts = '.var_export($texts, TRUE).';
return isset($texts[$value]) ? $texts[$value] : \'?\';
}');
$this->label->setCallbackFunction($function);
}
}
示例2: __construct
/**
* Build the plot
*
* @param array $values Pie values
*/
public function __construct($values, $colors = awPie::COLORED)
{
$this->setValues($values);
if (is_array($colors)) {
$this->colors = $colors;
} else {
switch ($colors) {
case awPie::AQUA:
$this->colors = array(new awColor(131, 220, 215), new awColor(131, 190, 215), new awColor(131, 160, 215), new awColor(160, 140, 215), new awColor(190, 131, 215), new awColor(220, 131, 215));
break;
case awPie::EARTH:
$this->colors = array(new awColor(97, 179, 110), new awColor(130, 179, 97), new awColor(168, 179, 97), new awColor(179, 147, 97), new awColor(179, 108, 97), new awColor(99, 107, 189), new awColor(99, 165, 189));
break;
case awPie::DARK:
$this->colors = array(new awColor(140, 100, 170), new awColor(130, 170, 100), new awColor(160, 160, 120), new awColor(150, 110, 140), new awColor(130, 150, 160), new awColor(90, 170, 140));
break;
default:
$this->colors = array(new awColor(187, 213, 151), new awColor(223, 177, 151), new awColor(111, 186, 132), new awColor(197, 160, 230), new awColor(165, 169, 63), new awColor(218, 177, 89), new awColor(116, 205, 121), new awColor(200, 201, 78), new awColor(127, 205, 177), new awColor(205, 160, 160), new awColor(190, 190, 190));
break;
}
}
parent::__construct();
$this->label = new awLabel();
$this->label->setCallbackFunction('callbackPerCent');
}