<?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($UCcmA, $wvO30, $L4owo = '数量', $oK4I3 = array()) { goto P1dnu; P1dnu: if (!isset($oK4I3['lineColor'])) { $oK4I3['lineColor'] = ColorUtil::pick('L-' . $UCcmA); } goto PJsR8; PJsR8: $this->option['legend']['data'][$UCcmA] = $L4owo; goto Qti0D; Mvyd1: return $this; goto W6cgR; Qti0D: $this->option['series'][$UCcmA] = array('name' => $L4owo, 'data' => $wvO30, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $oK4I3['lineColor'], 'lineStyle' => array('color' => $oK4I3['lineColor'])))); goto Mvyd1; W6cgR: } public function tableDailyCountLatest($kKV1v = array(), $ORgwx = 15) { goto VMmv2; VMmv2: $kJ2hw = date('Y-m-d'); goto oLsG8; AIJAr: $PliFt = $PdJXU - ($ORgwx - 1) * TimeUtil::PERIOD_DAY; goto favww; hS9x7: return $this->tableDailyCount($K0yTv, $kJ2hw, $kKV1v); goto kQPFd; favww: $K0yTv = date('Y-m-d', $PliFt); goto hS9x7; oLsG8: $PdJXU = strtotime($kJ2hw); goto AIJAr; kQPFd: } public function tableDailyCount($K0yTv, $kJ2hw, $kKV1v = array()) { goto whqkS; iqKhp: $this->option['series'] = array(); goto jcEpV; jpVVz: $this->xData($SjN8A['time']); goto iqKhp; Y4MIX: return $this; goto NLTJ0; whqkS: $SjN8A = $this->dsTableCountSeriesDaily($K0yTv, $kJ2hw, $kKV1v); goto jpVVz; jcEpV: foreach ($SjN8A['values'] as $ouMWs => $wvO30) { $wQkc8 = isset($kKV1v[$ouMWs]['color']) ? $kKV1v[$ouMWs]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $kKV1v[$ouMWs]['title'], 'data' => $wvO30, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $wQkc8, 'lineStyle' => array('color' => $wQkc8)))); } goto Y4MIX; NLTJ0: } public function tableDailySumLatest($kKV1v = array(), $ORgwx = 15) { goto mvuJ2; mvuJ2: $kJ2hw = date('Y-m-d'); goto igg1z; igg1z: $PdJXU = strtotime($kJ2hw); goto RYiQ9; RYiQ9: $PliFt = $PdJXU - ($ORgwx - 1) * TimeUtil::PERIOD_DAY; goto GGkgD; PvaaX: return $this->tableDailySum($K0yTv, $kJ2hw, $kKV1v); goto o8_IB; GGkgD: $K0yTv = date('Y-m-d', $PliFt); goto PvaaX; o8_IB: } public function tableDailySum($K0yTv, $kJ2hw, $kKV1v = array()) { goto Ofb5z; ziDDI: $this->option['series'] = array(); goto fPVFc; Ofb5z: $SjN8A = $this->dsTableSumSeriesDaily($K0yTv, $kJ2hw, $kKV1v); goto VCBgt; fPVFc: foreach ($SjN8A['values'] as $ouMWs => $wvO30) { $wQkc8 = isset($kKV1v[$ouMWs]['color']) ? $kKV1v[$ouMWs]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $kKV1v[$ouMWs]['title'], 'data' => $wvO30, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $wQkc8, 'lineStyle' => array('color' => $wQkc8)))); } goto ai2Q6; ai2Q6: return $this; goto TZsxI; VCBgt: $this->xData($SjN8A['time']); goto ziDDI; TZsxI: } }