<?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($MqJHJ, $Gttsd, $sQIr6 = '数量', $qHLCM = array()) { goto sJgja; sJgja: if (!isset($qHLCM['lineColor'])) { $qHLCM['lineColor'] = ColorUtil::pick('L-' . $MqJHJ); } goto UuY1v; UuY1v: $this->option['legend']['data'][$MqJHJ] = $sQIr6; goto OpxEl; OpxEl: $this->option['series'][$MqJHJ] = array('name' => $sQIr6, 'data' => $Gttsd, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $qHLCM['lineColor'], 'lineStyle' => array('color' => $qHLCM['lineColor'])))); goto KwvT6; KwvT6: return $this; goto Wc7z1; Wc7z1: } public function tableDailyCountLatest($P4hFJ = array(), $CcreL = 15) { goto ykCNb; EdSsi: $GcZ1R = date('Y-m-d', $W9j8i); goto Dm1oy; lJMSn: $f8DbJ = strtotime($uqLdQ); goto kwUk6; ykCNb: $uqLdQ = date('Y-m-d'); goto lJMSn; kwUk6: $W9j8i = $f8DbJ - ($CcreL - 1) * TimeUtil::PERIOD_DAY; goto EdSsi; Dm1oy: return $this->tableDailyCount($GcZ1R, $uqLdQ, $P4hFJ); goto jj9Ur; jj9Ur: } public function tableDailyCount($GcZ1R, $uqLdQ, $P4hFJ = array()) { goto MUvbJ; ZJkQM: return $this; goto CrzX7; NuXmV: $this->option['series'] = array(); goto HnxcC; xGfT0: $this->xData($CnWtd['time']); goto NuXmV; HnxcC: foreach ($CnWtd['values'] as $K_IJ6 => $Gttsd) { $K_9UF = isset($P4hFJ[$K_IJ6]['color']) ? $P4hFJ[$K_IJ6]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $P4hFJ[$K_IJ6]['title'], 'data' => $Gttsd, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $K_9UF, 'lineStyle' => array('color' => $K_9UF)))); } goto ZJkQM; MUvbJ: $CnWtd = $this->dsTableCountSeriesDaily($GcZ1R, $uqLdQ, $P4hFJ); goto xGfT0; CrzX7: } public function tableDailySumLatest($P4hFJ = array(), $CcreL = 15) { goto smoFj; smoFj: $uqLdQ = date('Y-m-d'); goto G01PJ; KVZgR: return $this->tableDailySum($GcZ1R, $uqLdQ, $P4hFJ); goto nIS1e; Yzpo7: $GcZ1R = date('Y-m-d', $W9j8i); goto KVZgR; G01PJ: $f8DbJ = strtotime($uqLdQ); goto g1ezq; g1ezq: $W9j8i = $f8DbJ - ($CcreL - 1) * TimeUtil::PERIOD_DAY; goto Yzpo7; nIS1e: } public function tableDailySum($GcZ1R, $uqLdQ, $P4hFJ = array()) { goto Qukpz; rUq3q: return $this; goto oqCuE; FPOsl: foreach ($CnWtd['values'] as $K_IJ6 => $Gttsd) { $K_9UF = isset($P4hFJ[$K_IJ6]['color']) ? $P4hFJ[$K_IJ6]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $P4hFJ[$K_IJ6]['title'], 'data' => $Gttsd, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $K_9UF, 'lineStyle' => array('color' => $K_9UF)))); } goto rUq3q; he5F2: $this->xData($CnWtd['time']); goto H5UrS; Qukpz: $CnWtd = $this->dsTableSumSeriesDaily($GcZ1R, $uqLdQ, $P4hFJ); goto he5F2; H5UrS: $this->option['series'] = array(); goto FPOsl; oqCuE: } }