<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget\Chart; use ModStart\Core\Util\ColorUtil; use ModStart\Core\Util\TimeUtil; class Line 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($JhHfm, $ib3B9, $XggBq = '数量', $pmJAc = array()) { goto Ta56E; qUEIn: $this->option['series'][$JhHfm] = array('name' => $XggBq, 'data' => $ib3B9, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $pmJAc['lineColor'], 'lineStyle' => array('color' => $pmJAc['lineColor'])))); goto Fy1bw; Fy1bw: return $this; goto q9jDY; E2zfZ: $this->option['legend']['data'][$JhHfm] = $XggBq; goto qUEIn; Ta56E: if (!isset($pmJAc['lineColor'])) { $pmJAc['lineColor'] = ColorUtil::pick('L-' . $JhHfm); } goto E2zfZ; q9jDY: } public function tableDailyCountLatest($Jvdi3 = array(), $P4x0J = 15) { goto Ka1rL; RLCrW: $Kq3sI = strtotime($o6kkl); goto ArLTu; Ka1rL: $o6kkl = date('Y-m-d'); goto RLCrW; gG5yk: $MkLTs = date('Y-m-d', $kcWAV); goto R_pj4; R_pj4: return $this->tableDailyCount($MkLTs, $o6kkl, $Jvdi3); goto OP1qo; ArLTu: $kcWAV = $Kq3sI - ($P4x0J - 1) * TimeUtil::PERIOD_DAY; goto gG5yk; OP1qo: } public function tableDailyCount($MkLTs, $o6kkl, $Jvdi3 = array()) { goto K73Mp; blOJC: foreach ($IaeCl['values'] as $aDVv6 => $ib3B9) { $bsOGg = isset($Jvdi3[$aDVv6]['color']) ? $Jvdi3[$aDVv6]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $Jvdi3[$aDVv6]['title'], 'data' => $ib3B9, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $bsOGg, 'lineStyle' => array('color' => $bsOGg)))); } goto uBF3n; uBF3n: return $this; goto OYcCZ; K73Mp: $IaeCl = $this->dsTableCountSeriesDaily($MkLTs, $o6kkl, $Jvdi3); goto ppTlo; ppTlo: $this->xData($IaeCl['time']); goto XeB25; XeB25: $this->option['series'] = array(); goto blOJC; OYcCZ: } public function tableDailySumLatest($Jvdi3 = array(), $P4x0J = 15) { goto ThxnU; KFP9V: $kcWAV = $Kq3sI - ($P4x0J - 1) * TimeUtil::PERIOD_DAY; goto s0Qmd; ThxnU: $o6kkl = date('Y-m-d'); goto Jbxvp; s0Qmd: $MkLTs = date('Y-m-d', $kcWAV); goto aLpDW; Jbxvp: $Kq3sI = strtotime($o6kkl); goto KFP9V; aLpDW: return $this->tableDailySum($MkLTs, $o6kkl, $Jvdi3); goto JXhvN; JXhvN: } public function tableDailySum($MkLTs, $o6kkl, $Jvdi3 = array()) { goto Nly13; Nly13: $IaeCl = $this->dsTableSumSeriesDaily($MkLTs, $o6kkl, $Jvdi3); goto uvVmX; cRHJA: foreach ($IaeCl['values'] as $aDVv6 => $ib3B9) { $bsOGg = isset($Jvdi3[$aDVv6]['color']) ? $Jvdi3[$aDVv6]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $Jvdi3[$aDVv6]['title'], 'data' => $ib3B9, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $bsOGg, 'lineStyle' => array('color' => $bsOGg)))); } goto kBWVy; uvVmX: $this->xData($IaeCl['time']); goto nqMZh; kBWVy: return $this; goto fDV7u; nqMZh: $this->option['series'] = array(); goto cRHJA; fDV7u: } }