<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget\Chart; use ModStart\Core\Util\ColorUtil; use ModStart\Core\Util\TimeUtil; class Bar extends Chart { protected $option = array('grid' => array('right' => '1%', 'left' => '1%', 'bottom' => '10%', 'containLabel' => true), 'toolbox' => array('feature' => array('dataView' => array('show' => true, 'readOnly' => false), 'restore' => array('show' => true), 'saveAsImage' => array('show' => true))), 'tooltip' => array('trigger' => 'axis', 'axisPointer' => array('type' => 'shadow', 'snap' => true, 'crossStyle' => array('color' => '#999'))), 'legend' => array('data' => array()), 'xAxis' => array('type' => 'category', 'data' => array()), 'yAxis' => array('type' => 'value', 'minInterval' => 1), 'series' => array()); public function ySeries($jqibn, $cBDsM, $glP3G = '数量', $mattM = array()) { goto PCaHR; IlWiZ: return $this; goto APGu2; oMxTr: $this->option['legend']['data'][$jqibn] = $glP3G; goto M2FsF; M2FsF: $this->option['series'][$jqibn] = array('name' => $glP3G, 'data' => $cBDsM, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $mattM['barColor'], 'barStyle' => array('color' => $mattM['barColor'])))); goto IlWiZ; PCaHR: if (!isset($mattM['barColor'])) { $mattM['barColor'] = ColorUtil::pick('L-' . $jqibn); } goto oMxTr; APGu2: } public function tableDailyCountLatest($lev5f = array(), $XIqI9 = 15) { goto UFU78; w0MA1: $SAOgU = strtotime($bWtXG); goto Gvqwn; Gvqwn: $OG0F_ = $SAOgU - ($XIqI9 - 1) * TimeUtil::PERIOD_DAY; goto HyWqy; qHv3i: return $this->tableDailyCount($X9g7N, $bWtXG, $lev5f); goto kgGRh; HyWqy: $X9g7N = date('Y-m-d', $OG0F_); goto qHv3i; UFU78: $bWtXG = date('Y-m-d'); goto w0MA1; kgGRh: } public function tableDailyCount($X9g7N, $bWtXG, $lev5f = array()) { goto rv6OU; rv6OU: $dTnlu = $this->dsTableCountSeriesDaily($X9g7N, $bWtXG, $lev5f); goto CaU2X; CaU2X: $this->xData($dTnlu['time']); goto TTW71; xh21_: foreach ($dTnlu['values'] as $C6OV7 => $cBDsM) { $on8l0 = isset($lev5f[$C6OV7]['color']) ? $lev5f[$C6OV7]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $lev5f[$C6OV7]['title'], 'data' => $cBDsM, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $on8l0, 'barStyle' => array('color' => $on8l0)))); } goto jFrjB; TTW71: $this->option['series'] = array(); goto xh21_; jFrjB: return $this; goto cd4uZ; cd4uZ: } public function tableDailySumLatest($lev5f = array(), $XIqI9 = 15) { goto htpNE; htpNE: $bWtXG = date('Y-m-d'); goto dwP8h; dwP8h: $SAOgU = strtotime($bWtXG); goto WPdO7; Gz9vW: $X9g7N = date('Y-m-d', $OG0F_); goto yE0_v; yE0_v: return $this->tableDailySum($X9g7N, $bWtXG, $lev5f); goto V3jFa; WPdO7: $OG0F_ = $SAOgU - ($XIqI9 - 1) * TimeUtil::PERIOD_DAY; goto Gz9vW; V3jFa: } public function tableDailySum($X9g7N, $bWtXG, $lev5f = array()) { goto SXvXp; b1mfE: return $this; goto emOCy; was_r: $this->xData($dTnlu['time']); goto UlOqP; SXvXp: $dTnlu = $this->dsTableSumSeriesDaily($X9g7N, $bWtXG, $lev5f); goto was_r; UlOqP: $this->option['series'] = array(); goto vfw1e; vfw1e: foreach ($dTnlu['values'] as $C6OV7 => $cBDsM) { $on8l0 = isset($lev5f[$C6OV7]['color']) ? $lev5f[$C6OV7]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $lev5f[$C6OV7]['title'], 'data' => $cBDsM, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $on8l0, 'barStyle' => array('color' => $on8l0)))); } goto b1mfE; emOCy: } }