123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- {Template phone/header_phone}
- <div class="qxtss" style="text-align: center;"><a href="/user/statistics" style="color:#666">进入数据统计</a></div>
- <div id="yzcontainer" style="height:30%"></div>
- <ul class="qsttime dr">
- <li data-time="7" class="ac" style="width:40%;margin: 15px 5% 0px 5%;">周</li>
- <li data-time="30" style="width:40%;margin: 15px 5% 0px 5%;">月</li>
- <div style="clear: both;"></div>
- </ul>
- <div id="container" style="height:200%;"></div>
- <input style="display:none" value="7" name="time" type="text">
- <script src="{$theme}js/echarts.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- defaultgo();
- })
- $(".qsttime li").click(function() {
- var time = $(this).data("time");
- $("input[name=time]").val(time)
- $(".qsttime li").removeClass("ac");
- $(this).addClass("ac");
- defaultgo(time);
- });
- function defaultgo() {
- layx.load('loadId','数据加载中');
- var time = $("input[name=time]").val();
- if(time < 10)
- {
- $("#container").css('height', '100%');
- }
- else
- {
- $("#container").css('height', '400%');
- }
- $.ajax({
- url: "/user/shopfx/",
- data: "time="+time,
- type: "POST",
- dataType: "json",
- success: function(a) {
- layx.destroy('loadId');
- if (a && a.success) {
- echartsread(a);
- }
- }
- });
- }
-
- function echartsread(datalist) {
- var dom = document.getElementById('yzcontainer');
- var myChart = echarts.init(dom);
- var app = {};
- option = null;
- option = {
- toolbox: {
- show: true,
- feature: {
- mark: { show: false },
- dataView: { show: false, readOnly: false },
- restore: { show: false },
- saveAsImage: { show: false }
- }
- },
- series: [
- {
- name: 'Nightingale Chart',
- type: 'pie',
- radius: [5, '45%'],
- center: ['50%', '50%'],
- roseType: 'area',
- itemStyle: {
- borderRadius: 8
- },
- data: datalist.data
- }
- ]
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- }
- var dom = document.getElementById('container');
- var myChart = echarts.init(dom, null, {
- renderer: 'canvas',
- useDirtyRect: false
- });
- var app = {};
-
- var option;
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- legend: {},
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'value',
- boundaryGap: [0, 0.01]
- },
- yAxis: {
- type: 'category',
- data: datalist.t
- },
- series: datalist.list
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- }
- myChart.resize();
- }
- </script>
- {Template phone/footer_phone}
|