<?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($Xn_Rr, $mdHu1, $c6VKG = '数量', $pFM9U = array()) { goto yQGEX; J1GmU: return $this; goto BLZZE; yQGEX: if (!isset($pFM9U['lineColor'])) { $pFM9U['lineColor'] = ColorUtil::pick('L-' . $Xn_Rr); } goto A4lF6; o3vBl: $this->option['series'][$Xn_Rr] = array('name' => $c6VKG, 'data' => $mdHu1, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $pFM9U['lineColor'], 'lineStyle' => array('color' => $pFM9U['lineColor'])))); goto J1GmU; A4lF6: $this->option['legend']['data'][$Xn_Rr] = $c6VKG; goto o3vBl; BLZZE: } public function tableDailyCountLatest($ARPC2 = array(), $XzVT3 = 15) { goto Yf6cg; Yf6cg: $R96Y0 = date('Y-m-d'); goto oAJ9o; oAJ9o: $rarSr = strtotime($R96Y0); goto HSkLc; mHgmK: $nktn1 = date('Y-m-d', $sOQj0); goto O9YUq; HSkLc: $sOQj0 = $rarSr - ($XzVT3 - 1) * TimeUtil::PERIOD_DAY; goto mHgmK; O9YUq: return $this->tableDailyCount($nktn1, $R96Y0, $ARPC2); goto Wackg; Wackg: } public function tableDailyCount($nktn1, $R96Y0, $ARPC2 = array()) { goto Niopa; pCM7s: 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' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $svDVT, 'lineStyle' => array('color' => $svDVT)))); } goto gHXDJ; Niopa: $Sj05q = $this->dsTableCountSeriesDaily($nktn1, $R96Y0, $ARPC2); goto F9iEU; QtxCr: $this->option['series'] = array(); goto pCM7s; gHXDJ: return $this; goto WDdJ7; F9iEU: $this->xData($Sj05q['time']); goto QtxCr; WDdJ7: } public function tableDailySumLatest($ARPC2 = array(), $XzVT3 = 15) { goto Zj2AA; lrGAE: $nktn1 = date('Y-m-d', $sOQj0); goto u1CIF; Zj2AA: $R96Y0 = date('Y-m-d'); goto yVmw4; jViPv: $sOQj0 = $rarSr - ($XzVT3 - 1) * TimeUtil::PERIOD_DAY; goto lrGAE; u1CIF: return $this->tableDailySum($nktn1, $R96Y0, $ARPC2); goto bl1cy; yVmw4: $rarSr = strtotime($R96Y0); goto jViPv; bl1cy: } public function tableDailySum($nktn1, $R96Y0, $ARPC2 = array()) { goto IdBa8; K8vAW: return $this; goto mQ21L; Y3Rl1: 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' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $svDVT, 'lineStyle' => array('color' => $svDVT)))); } goto K8vAW; IdBa8: $Sj05q = $this->dsTableSumSeriesDaily($nktn1, $R96Y0, $ARPC2); goto ad0xV; kWTF_: $this->option['series'] = array(); goto Y3Rl1; ad0xV: $this->xData($Sj05q['time']); goto kWTF_; mQ21L: } }