<?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($tMyPy, $HDpl6, $f0dxO = '数量', $AXgEz = array()) { goto pLmT0; Fscvu: $this->option['series'][$tMyPy] = array('name' => $f0dxO, 'data' => $HDpl6, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $AXgEz['barColor'], 'barStyle' => array('color' => $AXgEz['barColor'])))); goto MowSg; Y7MxW: $this->option['legend']['data'][$tMyPy] = $f0dxO; goto Fscvu; MowSg: return $this; goto WnyI1; pLmT0: if (!isset($AXgEz['barColor'])) { $AXgEz['barColor'] = ColorUtil::pick('L-' . $tMyPy); } goto Y7MxW; WnyI1: } public function tableDailyCountLatest($l8Ger = array(), $D8igw = 15) { goto WDTZ0; RvLyt: $nR73L = strtotime($HBrrp); goto r0YrC; mhGDI: return $this->tableDailyCount($JCIt8, $HBrrp, $l8Ger); goto Fr0eL; r0YrC: $X2G8M = $nR73L - ($D8igw - 1) * TimeUtil::PERIOD_DAY; goto DIoEL; WDTZ0: $HBrrp = date('Y-m-d'); goto RvLyt; DIoEL: $JCIt8 = date('Y-m-d', $X2G8M); goto mhGDI; Fr0eL: } public function tableDailyCount($JCIt8, $HBrrp, $l8Ger = array()) { goto k0kFQ; k0kFQ: $zonFp = $this->dsTableCountSeriesDaily($JCIt8, $HBrrp, $l8Ger); goto te1Ha; y8BXT: foreach ($zonFp['values'] as $xlsSz => $HDpl6) { $ZN2LW = isset($l8Ger[$xlsSz]['color']) ? $l8Ger[$xlsSz]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $l8Ger[$xlsSz]['title'], 'data' => $HDpl6, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $ZN2LW, 'barStyle' => array('color' => $ZN2LW)))); } goto mIZfQ; mIZfQ: return $this; goto IQNFS; te1Ha: $this->xData($zonFp['time']); goto rHeer; rHeer: $this->option['series'] = array(); goto y8BXT; IQNFS: } public function tableDailySumLatest($l8Ger = array(), $D8igw = 15) { goto DL1qc; ynzXb: $X2G8M = $nR73L - ($D8igw - 1) * TimeUtil::PERIOD_DAY; goto Tuoq7; Tuoq7: $JCIt8 = date('Y-m-d', $X2G8M); goto SmYVD; SmYVD: return $this->tableDailySum($JCIt8, $HBrrp, $l8Ger); goto wDjY4; s0Vs_: $nR73L = strtotime($HBrrp); goto ynzXb; DL1qc: $HBrrp = date('Y-m-d'); goto s0Vs_; wDjY4: } public function tableDailySum($JCIt8, $HBrrp, $l8Ger = array()) { goto QfM2x; h24bH: return $this; goto LjJHH; Mqa54: $this->xData($zonFp['time']); goto fgmx5; a0P0J: foreach ($zonFp['values'] as $xlsSz => $HDpl6) { $ZN2LW = isset($l8Ger[$xlsSz]['color']) ? $l8Ger[$xlsSz]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $l8Ger[$xlsSz]['title'], 'data' => $HDpl6, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $ZN2LW, 'barStyle' => array('color' => $ZN2LW)))); } goto h24bH; fgmx5: $this->option['series'] = array(); goto a0P0J; QfM2x: $zonFp = $this->dsTableSumSeriesDaily($JCIt8, $HBrrp, $l8Ger); goto Mqa54; LjJHH: } }