<?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($VJ5vg, $gwXrh, $L1g9F = '数量', $zlK8N = array()) { goto JRhTa; JRhTa: if (!isset($zlK8N['barColor'])) { $zlK8N['barColor'] = ColorUtil::pick('L-' . $VJ5vg); } goto HmAbR; HmAbR: $this->option['legend']['data'][$VJ5vg] = $L1g9F; goto nX5Ie; nX5Ie: $this->option['series'][$VJ5vg] = array('name' => $L1g9F, 'data' => $gwXrh, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $zlK8N['barColor'], 'barStyle' => array('color' => $zlK8N['barColor'])))); goto yGsb0; yGsb0: return $this; goto ohjP2; ohjP2: } public function tableDailyCountLatest($LimKa = array(), $Cq2Q4 = 15) { goto bpf3Q; K_ZVp: return $this->tableDailyCount($E3ils, $s3Bxz, $LimKa); goto Lth5n; x0a8t: $E3ils = date('Y-m-d', $wWDME); goto K_ZVp; HvlD9: $lTrDO = strtotime($s3Bxz); goto gyg6M; bpf3Q: $s3Bxz = date('Y-m-d'); goto HvlD9; gyg6M: $wWDME = $lTrDO - ($Cq2Q4 - 1) * TimeUtil::PERIOD_DAY; goto x0a8t; Lth5n: } public function tableDailyCount($E3ils, $s3Bxz, $LimKa = array()) { goto NWc2G; FqFNX: return $this; goto YaLKq; XR8wG: $this->option['series'] = array(); goto gC7Z7; NWc2G: $OTBPk = $this->dsTableCountSeriesDaily($E3ils, $s3Bxz, $LimKa); goto BGMlh; gC7Z7: foreach ($OTBPk['values'] as $R80S9 => $gwXrh) { $hfJA2 = isset($LimKa[$R80S9]['color']) ? $LimKa[$R80S9]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $LimKa[$R80S9]['title'], 'data' => $gwXrh, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $hfJA2, 'barStyle' => array('color' => $hfJA2)))); } goto FqFNX; BGMlh: $this->xData($OTBPk['time']); goto XR8wG; YaLKq: } public function tableDailySumLatest($LimKa = array(), $Cq2Q4 = 15) { goto v_uPO; zUgb9: return $this->tableDailySum($E3ils, $s3Bxz, $LimKa); goto bnk5B; YqhPC: $lTrDO = strtotime($s3Bxz); goto BX1ZA; OjtIN: $E3ils = date('Y-m-d', $wWDME); goto zUgb9; BX1ZA: $wWDME = $lTrDO - ($Cq2Q4 - 1) * TimeUtil::PERIOD_DAY; goto OjtIN; v_uPO: $s3Bxz = date('Y-m-d'); goto YqhPC; bnk5B: } public function tableDailySum($E3ils, $s3Bxz, $LimKa = array()) { goto LgVSE; LgVSE: $OTBPk = $this->dsTableSumSeriesDaily($E3ils, $s3Bxz, $LimKa); goto Nqq4p; gj6sr: $this->option['series'] = array(); goto T0bBA; Nqq4p: $this->xData($OTBPk['time']); goto gj6sr; T0bBA: foreach ($OTBPk['values'] as $R80S9 => $gwXrh) { $hfJA2 = isset($LimKa[$R80S9]['color']) ? $LimKa[$R80S9]['color'] : ColorUtil::randomColor(); $this->option['series'][] = array('name' => $LimKa[$R80S9]['title'], 'data' => $gwXrh, 'type' => 'bar', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $hfJA2, 'barStyle' => array('color' => $hfJA2)))); } goto dq5fa; dq5fa: return $this; goto k8ZD0; k8ZD0: } }