当前位置: 首页>>代码示例>>PHP>>正文


PHP Toolbox::logdebug方法代码示例

本文整理汇总了PHP中Toolbox::logdebug方法的典型用法代码示例。如果您正苦于以下问题:PHP Toolbox::logdebug方法的具体用法?PHP Toolbox::logdebug怎么用?PHP Toolbox::logdebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Toolbox的用法示例。


在下文中一共展示了Toolbox::logdebug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showSunburst

 function showSunburst($params)
 {
     $criterias = PluginMreportingCommon::initGraphParams($params);
     foreach ($criterias as $key => $val) {
         ${$key} = $val;
     }
     if (self::DEBUG_CSV && isset($raw_datas)) {
         Toolbox::logdebug($raw_datas);
     }
     if (isset($raw_datas['datas'])) {
         $datas = $raw_datas['datas'];
     } else {
         $datas = array();
     }
     if (count($datas) <= 0) {
         return false;
     }
     $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']);
     foreach ($configs as $k => $v) {
         ${$k} = $v;
     }
     if ($unit == '%') {
         $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit);
     }
     $options = array("title" => $title, "desc" => $desc, "randname" => $randname, "export" => $export);
     $this->initGraph($options);
     $out = $title . " - " . $desc . "\r\n";
     $out .= $this->sunburstLevel($datas);
     echo $out;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:30,代码来源:graphcsv.class.php

示例2: showArea

    /**
     * Show a Area chart
     *
     * @param $raw_datas : an array with :
     *    - key 'datas', ex : array( 'test1' => 15, 'test2' => 25)
     *    - key 'unit', ex : '%', 'Kg' (optionnal)
     *    - key 'spline', curves line (boolean - optionnal)
     * @param $title : title of the chart
     * @param $desc : description of the chart (optionnal)
     * @param $show_label : behavior of the graph labels,
     *                      values : 'hover', 'never', 'always' (optionnal)
     * @param $export : keep only svg to export (optionnal)
     * @param $area : show plain chart instead only a line (optionnal)
     * @return nothing
     */
    function showArea($params)
    {
        global $LANG;
        $criterias = PluginMreportingCommon::initGraphParams($params);
        foreach ($criterias as $key => $val) {
            ${$key} = $val;
        }
        $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']);
        foreach ($configs as $k => $v) {
            ${$k} = $v;
        }
        if (DEBUG_MREPORTING == true) {
            $area = true;
        }
        if (self::DEBUG_GRAPH && isset($raw_datas)) {
            Toolbox::logdebug($raw_datas);
        }
        $options = array("title" => $title, "desc" => $desc, "randname" => $randname, "export" => $export, "delay" => $delay, "short_classname" => $opt["short_classname"]);
        $this->initGraph($options);
        if (!isset($raw_datas['datas'])) {
            echo "}</script>";
            echo $LANG['plugin_mreporting']["error"][1];
            $end['opt']["export"] = false;
            $end['opt']["randname"] = false;
            $end['opt']["f_name"] = $opt['f_name'];
            $end['opt']["class"] = $opt['class'];
            PluginMreportingCommon::endGraph($end);
            return false;
        }
        $datas = $raw_datas['datas'];
        $datas = $this->initDatasSimple($datas, $unit);
        $always = '';
        $hover = '';
        PluginMreportingConfig::checkVisibility($show_label, $always, $hover);
        $JS = <<<JAVASCRIPT
   var width_area = {$this->width};
   var height_area = 350;
   var offset = 0;
   var step = Math.round(n / 20);

   var x = pv.Scale.linear(0, n-1).range(5, width_area);
   var y = pv.Scale.linear(0, max).range(0, height_area);


   /* The root panel. */
   vis{$randname} = new pv.Panel()
      .width(width_area)
      .height(height_area)
      .bottom(20)
      .left(20)
      .right(10)
      .top(5);

   /* Y-axis and ticks. */
   vis{$randname}.add(pv.Rule)
      .data(y.ticks(5))
      .bottom(y)
      .lineWidth(1)
      .strokeStyle(function(d) d ? "#eee" : "black")
      .anchor("left").add(pv.Label)
         .text(y.tickFormat);

   /* X-axis and ticks. */
   vis{$randname}.add(pv.Rule)
      .data(datas)
      .left(function() x(this.index)-1)
      .bottom(-5)
      .strokeStyle(function() {
         if (this.index == 0) return "black";
         return (i == this.index) ? "black" : "#eee";
      })
      .height(height_area - 30)
      .anchor("bottom").add(pv.Label)
         .visible(function() {
            if ((this.index / step) == Math.round(this.index / step)) return true;
            else return false;
         })
         .text(function() { return labels[this.index]; });

   /* add mini black lines in front of labels tick */
   vis{$randname}.add(pv.Rule)
      .data(datas)
      .left(function() x(this.index)-1)
      .bottom(-5)
      .strokeStyle("black")
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:graph.class.php

示例3: showGArea

 /**
  * Show a multi-area chart
  *
  * @param $raw_datas : an array with :
  *    - key 'datas', ex : array( 'test1' => 15, 'test2' => 25)
  *    - key 'unit', ex : '%', 'Kg' (optionnal)
  *    - key 'spline', curves line (boolean - optionnal)
  * @param $title : title of the chart
  * @param $desc : description of the chart (optionnal)
  * @param $show_label : behavior of the graph labels,
  *                      values : 'hover', 'never', 'always' (optionnal)
  * @param $export : keep only svg to export (optionnal)
  * @return nothing
  */
 function showGArea($params)
 {
     global $LANG;
     $criterias = PluginMreportingCommon::initGraphParams($params);
     foreach ($criterias as $key => $val) {
         ${$key} = $val;
     }
     //$rand = $opt['rand'];
     $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']);
     foreach ($configs as $k => $v) {
         ${$k} = $v;
     }
     if (self::DEBUG_GRAPH && isset($raw_datas)) {
         Toolbox::logdebug($raw_datas);
     }
     if (isset($raw_datas['datas'])) {
         $datas = $raw_datas['datas'];
     } else {
         $datas = array();
     }
     $options = array("title" => $title, "desc" => $desc, "randname" => $randname, "export" => $export, "delay" => $delay, "short_classname" => $opt["short_classname"]);
     $this->initGraph($options);
     if (count($datas) <= 0) {
         if ($export != "odtall") {
             echo $LANG['plugin_mreporting']["error"][1];
             $end['opt']["export"] = false;
             $end['opt']["randname"] = false;
             $end['opt']["f_name"] = $opt['f_name'];
             $end['opt']["class"] = $opt['class'];
             PluginMreportingCommon::endGraph($end);
         }
         return false;
     }
     $labels2 = $raw_datas['labels2'];
     $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit);
     $raw_datas['datas'] = $datas;
     $values = array_values($datas);
     $labels = array_keys($datas);
     $max = 1;
     foreach ($values as $line) {
         foreach ($line as $label2 => $value) {
             if ($value > $max) {
                 $max = $value;
             }
         }
     }
     if ($max == 1 && $unit == '%') {
         $max = 100;
     }
     $nb = count($labels2);
     $width = $this->width;
     $nb_bar = count($datas);
     if ($nb_bar > 1) {
         $percent = 2 * (450 + 18 * $nb_bar) / (18 * $nb_bar * 100);
     } else {
         $percent = 0.2;
     }
     $height = $percent * 450 + 18 * $nb_bar;
     $delta = 450 - $height;
     $height_tot = 450 + $height;
     $width_line = ($width - 45) / $nb;
     $index1 = 0;
     $index3 = 1;
     $step = ceil($nb / 20);
     //create image
     $image = imagecreatetruecolor($width, $height_tot);
     if ($show_graph) {
         //colors
         $palette = self::getPalette($nb_bar);
         $alphapalette = self::getPalette($nb_bar, "50");
         $darkerpalette = self::getDarkerPalette($nb_bar);
         //background
         $bg_color = $this->white;
         imagefilledrectangle($image, 0, 0, $width - 1, $height_tot - 1, $bg_color);
         //draw x-axis grey step line and value ticks
         $xstep = round(($height + $delta + 40) / 13);
         for ($i = 0; $i < 13; $i++) {
             $yaxis = $height_tot - 30 - $xstep * $i;
             //horizontal grey lines
             imageLine($image, 30, $yaxis, 30 + $width_line * ($nb - 1), $yaxis, $this->grey);
             //value ticks
             if ($i * $max / 12 < 10) {
                 $val = round($i * $max / 12, 1);
             } else {
                 $val = round($i * $max / 12);
             }
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:graphpng.class.php


注:本文中的Toolbox::logdebug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。