<?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($jqibn, $cBDsM, $glP3G = '数量', $mattM = array()) { goto MnR0t; Zdx5Q: return $this; goto HoeHP; MnR0t: if (!isset($mattM['lineColor'])) { $mattM['lineColor'] = ColorUtil::pick('L-' . $jqibn); } goto rBqYx; rBqYx: $this->option['legend']['data'][$jqibn] = $glP3G; goto gcPv1; gcPv1: $this->option['series'][$jqibn] = array('name' => $glP3G, 'data' => $cBDsM, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $mattM['lineColor'], 'lineStyle' => array('color' => $mattM['lineColor'])))); goto Zdx5Q; HoeHP: } public function tableDailyCountLatest($lev5f = array(), $XIqI9 = 15) { goto h0LXw; sPtva: $X9g7N = date('Y-m-d', $OG0F_); goto kzwfD; MdmT8: $SAOgU = strtotime($bWtXG); goto VGHPh; VGHPh: $OG0F_ = $SAOgU - ($XIqI9 - 1) * TimeUtil::PERIOD_DAY; goto sPtva; h0LXw: $bWtXG = date('Y-m-d'); goto MdmT8; kzwfD: return $this->tableDailyCount($X9g7N, $bWtXG, $lev5f); goto mEuif; mEuif: } public function tableDailyCount($X9g7N, $bWtXG, $lev5f = array()) { goto no0fe; xm7In: $this->option['series'] = array(); goto MYwKo; GTXjW: $this->xData($dTnlu['time']); goto xm7In; MYwKo: foreach ($dTnlu['values'] as $C6OV7 => $cBDsM) { $on8l0 = isset($lev5f[$C6OV7]['color']) ? $lev5f[$C6OV7]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $lev5f[$C6OV7]['title'], 'data' => $cBDsM, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $on8l0, 'lineStyle' => array('color' => $on8l0)))); } goto XmYCY; no0fe: $dTnlu = $this->dsTableCountSeriesDaily($X9g7N, $bWtXG, $lev5f); goto GTXjW; XmYCY: return $this; goto QXCp0; QXCp0: } public function tableDailySumLatest($lev5f = array(), $XIqI9 = 15) { goto TPakm; ZJEfU: return $this->tableDailySum($X9g7N, $bWtXG, $lev5f); goto wbcgP; Wbkep: $OG0F_ = $SAOgU - ($XIqI9 - 1) * TimeUtil::PERIOD_DAY; goto T0O8h; TPakm: $bWtXG = date('Y-m-d'); goto Qaba0; Qaba0: $SAOgU = strtotime($bWtXG); goto Wbkep; T0O8h: $X9g7N = date('Y-m-d', $OG0F_); goto ZJEfU; wbcgP: } public function tableDailySum($X9g7N, $bWtXG, $lev5f = array()) { goto q3b_L; xrmih: $this->option['series'] = array(); goto TVhzs; q3b_L: $dTnlu = $this->dsTableSumSeriesDaily($X9g7N, $bWtXG, $lev5f); goto AHSFD; K8m97: return $this; goto mMD3d; TVhzs: foreach ($dTnlu['values'] as $C6OV7 => $cBDsM) { $on8l0 = isset($lev5f[$C6OV7]['color']) ? $lev5f[$C6OV7]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $lev5f[$C6OV7]['title'], 'data' => $cBDsM, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $on8l0, 'lineStyle' => array('color' => $on8l0)))); } goto K8m97; AHSFD: $this->xData($dTnlu['time']); goto xrmih; mMD3d: } }