<?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($Xn_Rr, $mdHu1, $c6VKG = '数量', $pFM9U = array()) { goto Og2BA; yKa4M: $this->option['series'][$Xn_Rr] = array('name' => $c6VKG, 'data' => $mdHu1, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $pFM9U['barColor'], 'barStyle' => array('color' => $pFM9U['barColor'])))); goto hutC8; hutC8: return $this; goto rtpBN; p1ZpQ: $this->option['legend']['data'][$Xn_Rr] = $c6VKG; goto yKa4M; Og2BA: if (!isset($pFM9U['barColor'])) { $pFM9U['barColor'] = ColorUtil::pick('L-' . $Xn_Rr); } goto p1ZpQ; rtpBN: } public function tableDailyCountLatest($ARPC2 = array(), $XzVT3 = 15) { goto BMn0v; BMn0v: $R96Y0 = date('Y-m-d'); goto nlGTZ; aL1ba: $nktn1 = date('Y-m-d', $sOQj0); goto VrdfH; nlGTZ: $rarSr = strtotime($R96Y0); goto ikh1i; ikh1i: $sOQj0 = $rarSr - ($XzVT3 - 1) * TimeUtil::PERIOD_DAY; goto aL1ba; VrdfH: return $this->tableDailyCount($nktn1, $R96Y0, $ARPC2); goto biDpI; biDpI: } public function tableDailyCount($nktn1, $R96Y0, $ARPC2 = array()) { goto yCBAO; yCBAO: $Sj05q = $this->dsTableCountSeriesDaily($nktn1, $R96Y0, $ARPC2); goto BExxx; gnYJK: return $this; goto k9uLm; lrqP3: $this->option['series'] = array(); goto rYrxH; rYrxH: foreach ($Sj05q['values'] as $dtpXv => $mdHu1) { $svDVT = isset($ARPC2[$dtpXv]['color']) ? $ARPC2[$dtpXv]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $ARPC2[$dtpXv]['title'], 'data' => $mdHu1, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $svDVT, 'barStyle' => array('color' => $svDVT)))); } goto gnYJK; BExxx: $this->xData($Sj05q['time']); goto lrqP3; k9uLm: } public function tableDailySumLatest($ARPC2 = array(), $XzVT3 = 15) { goto xJZdz; MPVfg: $sOQj0 = $rarSr - ($XzVT3 - 1) * TimeUtil::PERIOD_DAY; goto B5am6; uAQ8x: return $this->tableDailySum($nktn1, $R96Y0, $ARPC2); goto FnpjE; B5am6: $nktn1 = date('Y-m-d', $sOQj0); goto uAQ8x; xJZdz: $R96Y0 = date('Y-m-d'); goto cyeVw; cyeVw: $rarSr = strtotime($R96Y0); goto MPVfg; FnpjE: } public function tableDailySum($nktn1, $R96Y0, $ARPC2 = array()) { goto ELzst; eIorr: foreach ($Sj05q['values'] as $dtpXv => $mdHu1) { $svDVT = isset($ARPC2[$dtpXv]['color']) ? $ARPC2[$dtpXv]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $ARPC2[$dtpXv]['title'], 'data' => $mdHu1, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $svDVT, 'barStyle' => array('color' => $svDVT)))); } goto doVmx; NMBA8: $this->xData($Sj05q['time']); goto asaK5; ELzst: $Sj05q = $this->dsTableSumSeriesDaily($nktn1, $R96Y0, $ARPC2); goto NMBA8; asaK5: $this->option['series'] = array(); goto eIorr; doVmx: return $this; goto mXTcA; mXTcA: } }