<?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($JhHfm, $ib3B9, $XggBq = '数量', $pmJAc = array()) { goto Rg3c8; sOVr8: $this->option['series'][$JhHfm] = array('name' => $XggBq, 'data' => $ib3B9, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $pmJAc['barColor'], 'barStyle' => array('color' => $pmJAc['barColor'])))); goto bXMeK; Rg3c8: if (!isset($pmJAc['barColor'])) { $pmJAc['barColor'] = ColorUtil::pick('L-' . $JhHfm); } goto lYDWw; lYDWw: $this->option['legend']['data'][$JhHfm] = $XggBq; goto sOVr8; bXMeK: return $this; goto RJIJN; RJIJN: } public function tableDailyCountLatest($Jvdi3 = array(), $P4x0J = 15) { goto hDfRu; obSAC: $kcWAV = $Kq3sI - ($P4x0J - 1) * TimeUtil::PERIOD_DAY; goto HuBE6; HuBE6: $MkLTs = date('Y-m-d', $kcWAV); goto oGGSW; oGGSW: return $this->tableDailyCount($MkLTs, $o6kkl, $Jvdi3); goto WT7q2; hDfRu: $o6kkl = date('Y-m-d'); goto sUbYZ; sUbYZ: $Kq3sI = strtotime($o6kkl); goto obSAC; WT7q2: } public function tableDailyCount($MkLTs, $o6kkl, $Jvdi3 = array()) { goto Ae4kQ; uCFmF: return $this; goto qOP3a; J_4va: 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' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $bsOGg, 'barStyle' => array('color' => $bsOGg)))); } goto uCFmF; Ae4kQ: $IaeCl = $this->dsTableCountSeriesDaily($MkLTs, $o6kkl, $Jvdi3); goto l4H4h; l4H4h: $this->xData($IaeCl['time']); goto Nz4db; Nz4db: $this->option['series'] = array(); goto J_4va; qOP3a: } public function tableDailySumLatest($Jvdi3 = array(), $P4x0J = 15) { goto oghCE; oghCE: $o6kkl = date('Y-m-d'); goto JSRI0; VLFY3: $MkLTs = date('Y-m-d', $kcWAV); goto rzojq; rzojq: return $this->tableDailySum($MkLTs, $o6kkl, $Jvdi3); goto DKDCP; JSRI0: $Kq3sI = strtotime($o6kkl); goto fEwcy; fEwcy: $kcWAV = $Kq3sI - ($P4x0J - 1) * TimeUtil::PERIOD_DAY; goto VLFY3; DKDCP: } public function tableDailySum($MkLTs, $o6kkl, $Jvdi3 = array()) { goto bdfhl; riwhQ: $this->xData($IaeCl['time']); goto eKjUD; bdfhl: $IaeCl = $this->dsTableSumSeriesDaily($MkLTs, $o6kkl, $Jvdi3); goto riwhQ; PkjDF: 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' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $bsOGg, 'barStyle' => array('color' => $bsOGg)))); } goto SUNss; SUNss: return $this; goto Lvr1p; eKjUD: $this->option['series'] = array(); goto PkjDF; Lvr1p: } }