<?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($kM8qX, $Mczr_, $ZZMEd = '数量', $ACVUe = array()) { goto dvoCJ; ej8bt: return $this; goto WF0wi; gvYBv: $this->option['series'][$kM8qX] = array('name' => $ZZMEd, 'data' => $Mczr_, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $ACVUe['barColor'], 'barStyle' => array('color' => $ACVUe['barColor'])))); goto ej8bt; pn1eM: $this->option['legend']['data'][$kM8qX] = $ZZMEd; goto gvYBv; dvoCJ: if (!isset($ACVUe['barColor'])) { $ACVUe['barColor'] = ColorUtil::pick('L-' . $kM8qX); } goto pn1eM; WF0wi: } public function tableDailyCountLatest($Ctrg1 = array(), $JAcjY = 15) { goto h3KaH; Yg5Ym: return $this->tableDailyCount($GJZpW, $g106V, $Ctrg1); goto e8usF; h3KaH: $g106V = date('Y-m-d'); goto IKc1r; NyDtB: $wJfuo = $gYlze - ($JAcjY - 1) * TimeUtil::PERIOD_DAY; goto vbgyB; vbgyB: $GJZpW = date('Y-m-d', $wJfuo); goto Yg5Ym; IKc1r: $gYlze = strtotime($g106V); goto NyDtB; e8usF: } public function tableDailyCount($GJZpW, $g106V, $Ctrg1 = array()) { goto k9dN9; bD2KE: foreach ($zvN10['values'] as $EqYVi => $Mczr_) { $HWDST = isset($Ctrg1[$EqYVi]['color']) ? $Ctrg1[$EqYVi]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $Ctrg1[$EqYVi]['title'], 'data' => $Mczr_, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $HWDST, 'barStyle' => array('color' => $HWDST)))); } goto jXvyN; jXvyN: return $this; goto mi8NJ; DWBfP: $this->xData($zvN10['time']); goto UJ5KZ; k9dN9: $zvN10 = $this->dsTableCountSeriesDaily($GJZpW, $g106V, $Ctrg1); goto DWBfP; UJ5KZ: $this->option['series'] = array(); goto bD2KE; mi8NJ: } public function tableDailySumLatest($Ctrg1 = array(), $JAcjY = 15) { goto Bld6B; Bld6B: $g106V = date('Y-m-d'); goto fW0yK; Vw2AO: return $this->tableDailySum($GJZpW, $g106V, $Ctrg1); goto kENAI; fW0yK: $gYlze = strtotime($g106V); goto pVBfE; Z3EVm: $GJZpW = date('Y-m-d', $wJfuo); goto Vw2AO; pVBfE: $wJfuo = $gYlze - ($JAcjY - 1) * TimeUtil::PERIOD_DAY; goto Z3EVm; kENAI: } public function tableDailySum($GJZpW, $g106V, $Ctrg1 = array()) { goto V7oDf; J2ix8: $this->option['series'] = array(); goto RIkEo; V7oDf: $zvN10 = $this->dsTableSumSeriesDaily($GJZpW, $g106V, $Ctrg1); goto uGDBm; po50s: return $this; goto dYjrT; RIkEo: foreach ($zvN10['values'] as $EqYVi => $Mczr_) { $HWDST = isset($Ctrg1[$EqYVi]['color']) ? $Ctrg1[$EqYVi]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $Ctrg1[$EqYVi]['title'], 'data' => $Mczr_, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $HWDST, 'barStyle' => array('color' => $HWDST)))); } goto po50s; uGDBm: $this->xData($zvN10['time']); goto J2ix8; dYjrT: } }