<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget\Chart; use ModStart\Core\Util\ColorUtil; use ModStart\Core\Util\TimeUtil; class Bar 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 Jgzw9; k5Gla: $this->option['legend']['data'][$MqJHJ] = $sQIr6; goto qA9uV; sfMyN: return $this; goto Iemfu; Jgzw9: if (!isset($qHLCM['barColor'])) { $qHLCM['barColor'] = ColorUtil::pick('L-' . $MqJHJ); } goto k5Gla; qA9uV: $this->option['series'][$MqJHJ] = array('name' => $sQIr6, 'data' => $Gttsd, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $qHLCM['barColor'], 'barStyle' => array('color' => $qHLCM['barColor'])))); goto sfMyN; Iemfu: } public function tableDailyCountLatest($P4hFJ = array(), $CcreL = 15) { goto pEglx; RxIIP: $W9j8i = $f8DbJ - ($CcreL - 1) * TimeUtil::PERIOD_DAY; goto U9L2e; ANFN1: $f8DbJ = strtotime($uqLdQ); goto RxIIP; pEglx: $uqLdQ = date('Y-m-d'); goto ANFN1; GRGpx: return $this->tableDailyCount($GcZ1R, $uqLdQ, $P4hFJ); goto zXJt6; U9L2e: $GcZ1R = date('Y-m-d', $W9j8i); goto GRGpx; zXJt6: } public function tableDailyCount($GcZ1R, $uqLdQ, $P4hFJ = array()) { goto uhLF2; uhLF2: $CnWtd = $this->dsTableCountSeriesDaily($GcZ1R, $uqLdQ, $P4hFJ); goto hbvrR; vNtl3: return $this; goto x6YNA; Ah48R: 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' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $K_9UF, 'barStyle' => array('color' => $K_9UF)))); } goto vNtl3; PwTUA: $this->option['series'] = array(); goto Ah48R; hbvrR: $this->xData($CnWtd['time']); goto PwTUA; x6YNA: } public function tableDailySumLatest($P4hFJ = array(), $CcreL = 15) { goto SEm1d; SEm1d: $uqLdQ = date('Y-m-d'); goto QY0vf; dYrXO: return $this->tableDailySum($GcZ1R, $uqLdQ, $P4hFJ); goto mBcXs; QY0vf: $f8DbJ = strtotime($uqLdQ); goto FvwEm; FvwEm: $W9j8i = $f8DbJ - ($CcreL - 1) * TimeUtil::PERIOD_DAY; goto FHfdu; FHfdu: $GcZ1R = date('Y-m-d', $W9j8i); goto dYrXO; mBcXs: } public function tableDailySum($GcZ1R, $uqLdQ, $P4hFJ = array()) { goto ilpB9; HI3fI: return $this; goto Gw7mN; ytlMi: $this->xData($CnWtd['time']); goto f9wAX; ilpB9: $CnWtd = $this->dsTableSumSeriesDaily($GcZ1R, $uqLdQ, $P4hFJ); goto ytlMi; f9wAX: $this->option['series'] = array(); goto gLxjN; gLxjN: 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' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $K_9UF, 'barStyle' => array('color' => $K_9UF)))); } goto HI3fI; Gw7mN: } }