<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget\Chart; use ModStart\Core\Util\ColorUtil; use ModStart\Core\Util\TimeUtil; class Line 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 rgBhe; GdTrB: return $this; goto FNojo; fknIq: $this->option['legend']['data'][$VJ5vg] = $L1g9F; goto kL04J; rgBhe: if (!isset($zlK8N['lineColor'])) { $zlK8N['lineColor'] = ColorUtil::pick('L-' . $VJ5vg); } goto fknIq; kL04J: $this->option['series'][$VJ5vg] = array('name' => $L1g9F, 'data' => $gwXrh, 'type' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $zlK8N['lineColor'], 'lineStyle' => array('color' => $zlK8N['lineColor'])))); goto GdTrB; FNojo: } public function tableDailyCountLatest($LimKa = array(), $Cq2Q4 = 15) { goto lwI6N; KhDkG: $wWDME = $lTrDO - ($Cq2Q4 - 1) * TimeUtil::PERIOD_DAY; goto Y5yFm; lwI6N: $s3Bxz = date('Y-m-d'); goto YX8hy; Y5yFm: $E3ils = date('Y-m-d', $wWDME); goto QYIES; YX8hy: $lTrDO = strtotime($s3Bxz); goto KhDkG; QYIES: return $this->tableDailyCount($E3ils, $s3Bxz, $LimKa); goto u1Z0t; u1Z0t: } public function tableDailyCount($E3ils, $s3Bxz, $LimKa = array()) { goto nET8K; nET8K: $OTBPk = $this->dsTableCountSeriesDaily($E3ils, $s3Bxz, $LimKa); goto vIjiq; jDEqI: 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' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $hfJA2, 'lineStyle' => array('color' => $hfJA2)))); } goto D3en6; jo1Dg: $this->option['series'] = array(); goto jDEqI; D3en6: return $this; goto qYdHn; vIjiq: $this->xData($OTBPk['time']); goto jo1Dg; qYdHn: } public function tableDailySumLatest($LimKa = array(), $Cq2Q4 = 15) { goto ARS44; ofKNC: $E3ils = date('Y-m-d', $wWDME); goto CC8Ah; CC8Ah: return $this->tableDailySum($E3ils, $s3Bxz, $LimKa); goto YDqfZ; ARS44: $s3Bxz = date('Y-m-d'); goto t9fsZ; yWaM0: $wWDME = $lTrDO - ($Cq2Q4 - 1) * TimeUtil::PERIOD_DAY; goto ofKNC; t9fsZ: $lTrDO = strtotime($s3Bxz); goto yWaM0; YDqfZ: } public function tableDailySum($E3ils, $s3Bxz, $LimKa = array()) { goto jqKDr; jqKDr: $OTBPk = $this->dsTableSumSeriesDaily($E3ils, $s3Bxz, $LimKa); goto N9eMN; IimiG: 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' => 'line', 'smooth' => true, 'itemStyle' => array('normal' => array('color' => $hfJA2, 'lineStyle' => array('color' => $hfJA2)))); } goto a50Ry; h2UqH: $this->option['series'] = array(); goto IimiG; N9eMN: $this->xData($OTBPk['time']); goto h2UqH; a50Ry: return $this; goto YwLf9; YwLf9: } }