<?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($UCcmA, $wvO30, $L4owo = '数量', $oK4I3 = array()) { goto psGci; d5XSq: return $this; goto Hn9ZE; p6ud1: $this->option['series'][$UCcmA] = array('name' => $L4owo, 'data' => $wvO30, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $oK4I3['barColor'], 'barStyle' => array('color' => $oK4I3['barColor'])))); goto d5XSq; LmbR7: $this->option['legend']['data'][$UCcmA] = $L4owo; goto p6ud1; psGci: if (!isset($oK4I3['barColor'])) { $oK4I3['barColor'] = ColorUtil::pick('L-' . $UCcmA); } goto LmbR7; Hn9ZE: } public function tableDailyCountLatest($kKV1v = array(), $ORgwx = 15) { goto c_itu; E8tIp: return $this->tableDailyCount($K0yTv, $kJ2hw, $kKV1v); goto bAVto; c_itu: $kJ2hw = date('Y-m-d'); goto gvwpv; ECroS: $K0yTv = date('Y-m-d', $PliFt); goto E8tIp; Dpma3: $PliFt = $PdJXU - ($ORgwx - 1) * TimeUtil::PERIOD_DAY; goto ECroS; gvwpv: $PdJXU = strtotime($kJ2hw); goto Dpma3; bAVto: } public function tableDailyCount($K0yTv, $kJ2hw, $kKV1v = array()) { goto CbAIE; csZpF: $this->option['series'] = array(); goto UopKX; oNFIk: $this->xData($SjN8A['time']); goto csZpF; UopKX: 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' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $wQkc8, 'barStyle' => array('color' => $wQkc8)))); } goto xlFJ1; xlFJ1: return $this; goto lX7BW; CbAIE: $SjN8A = $this->dsTableCountSeriesDaily($K0yTv, $kJ2hw, $kKV1v); goto oNFIk; lX7BW: } public function tableDailySumLatest($kKV1v = array(), $ORgwx = 15) { goto Zv1wq; Cl2Ym: return $this->tableDailySum($K0yTv, $kJ2hw, $kKV1v); goto TbdSW; Zy2JY: $K0yTv = date('Y-m-d', $PliFt); goto Cl2Ym; YclyI: $PdJXU = strtotime($kJ2hw); goto pGde6; pGde6: $PliFt = $PdJXU - ($ORgwx - 1) * TimeUtil::PERIOD_DAY; goto Zy2JY; Zv1wq: $kJ2hw = date('Y-m-d'); goto YclyI; TbdSW: } public function tableDailySum($K0yTv, $kJ2hw, $kKV1v = array()) { goto jo84l; bwNw2: 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' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $wQkc8, 'barStyle' => array('color' => $wQkc8)))); } goto nPyij; L0M8P: $this->option['series'] = array(); goto bwNw2; jo84l: $SjN8A = $this->dsTableSumSeriesDaily($K0yTv, $kJ2hw, $kKV1v); goto PY4As; nPyij: return $this; goto pZE7N; PY4As: $this->xData($SjN8A['time']); goto L0M8P; pZE7N: } }