<?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($kM8qX, $Mczr_, $ZZMEd = '数量', $ACVUe = array()) { goto DIokc; DIokc: if (!isset($ACVUe['lineColor'])) { $ACVUe['lineColor'] = ColorUtil::pick('L-' . $kM8qX); } goto mttJE; LO6RL: $this->option['series'][$kM8qX] = array('name' => $ZZMEd, 'data' => $Mczr_, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $ACVUe['lineColor'], 'lineStyle' => array('color' => $ACVUe['lineColor'])))); goto kJBB6; mttJE: $this->option['legend']['data'][$kM8qX] = $ZZMEd; goto LO6RL; kJBB6: return $this; goto kl6qo; kl6qo: } public function tableDailyCountLatest($Ctrg1 = array(), $JAcjY = 15) { goto YN870; F8a29: return $this->tableDailyCount($GJZpW, $g106V, $Ctrg1); goto A2Xqf; Qtxon: $gYlze = strtotime($g106V); goto cuaM2; cuaM2: $wJfuo = $gYlze - ($JAcjY - 1) * TimeUtil::PERIOD_DAY; goto wdVIM; YN870: $g106V = date('Y-m-d'); goto Qtxon; wdVIM: $GJZpW = date('Y-m-d', $wJfuo); goto F8a29; A2Xqf: } public function tableDailyCount($GJZpW, $g106V, $Ctrg1 = array()) { goto mWfQG; Epawu: foreach ($zvN10['values'] as $EqYVi => $Mczr_) { $HWDST = isset($Ctrg1[$EqYVi]['color']) ? $Ctrg1[$EqYVi]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $Ctrg1[$EqYVi]['title'], 'data' => $Mczr_, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $HWDST, 'lineStyle' => array('color' => $HWDST)))); } goto yNp6P; yXAbW: $this->option['series'] = array(); goto Epawu; bPcwz: $this->xData($zvN10['time']); goto yXAbW; yNp6P: return $this; goto MytXU; mWfQG: $zvN10 = $this->dsTableCountSeriesDaily($GJZpW, $g106V, $Ctrg1); goto bPcwz; MytXU: } public function tableDailySumLatest($Ctrg1 = array(), $JAcjY = 15) { goto IWD0b; IWD0b: $g106V = date('Y-m-d'); goto CaMa1; Ux3Zt: $GJZpW = date('Y-m-d', $wJfuo); goto COADl; CaMa1: $gYlze = strtotime($g106V); goto o1G_w; o1G_w: $wJfuo = $gYlze - ($JAcjY - 1) * TimeUtil::PERIOD_DAY; goto Ux3Zt; COADl: return $this->tableDailySum($GJZpW, $g106V, $Ctrg1); goto cPYGO; cPYGO: } public function tableDailySum($GJZpW, $g106V, $Ctrg1 = array()) { goto eBq2i; Cs243: $this->xData($zvN10['time']); goto UlUdO; eBq2i: $zvN10 = $this->dsTableSumSeriesDaily($GJZpW, $g106V, $Ctrg1); goto Cs243; ZGXlW: foreach ($zvN10['values'] as $EqYVi => $Mczr_) { $HWDST = isset($Ctrg1[$EqYVi]['color']) ? $Ctrg1[$EqYVi]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $Ctrg1[$EqYVi]['title'], 'data' => $Mczr_, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $HWDST, 'lineStyle' => array('color' => $HWDST)))); } goto YvcA1; UlUdO: $this->option['series'] = array(); goto ZGXlW; YvcA1: return $this; goto yE3qn; yE3qn: } }