| | |
| | | <script type="text/javascript" |
| | | th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> |
| | | <style> |
| | | .echarts { |
| | | height: 400px |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | <body class=" container-fluid"> |
| | | |
| | |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="form-group mr-20" id="timeBox"> |
| | | <div class="form-group mr-20 mt-20" id="timeBox"> |
| | | |
| | | <label>统计范围</label> |
| | | |
| | | <input name="beginTime" type="text" autocomplete="off" |
| | |
| | | name="endTime" type="text" class="form-control datetimepicker" autocomplete="off" |
| | | id="endTime"> |
| | | </div> |
| | | <div class="form-group mr-20"> |
| | | <div class="form-group mr-20 "> |
| | | <label>统计单位</label> |
| | | <select name="statisticsUnit" class=" form-control " id="unitSelect" |
| | | style="width: 80px"> |
| | |
| | | </form> |
| | | <!-- 搜索框部分en --> |
| | | |
| | | <div class="row chartsBox"> |
| | | <div class="row chartsBox " style="margin-top: 40px"> |
| | | <div class=" col-md-12"> |
| | | <div class="echarts" id="echarts-line-chart1"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row chartsBox " style="margin-top: 40px"> |
| | | <div class=" col-md-12"> |
| | | <div class="echarts" id="echarts-line-chart2"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | |
| | | <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/ChartsUtils.js}"></script> |
| | | |
| | | |
| | | <script> |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart1 = echarts.init(document.getElementById('echarts-line-chart1'), 'macarons'); |
| | | var myChart2 = echarts.init(document.getElementById('echarts-line-chart2'), 'macarons'); |
| | | |
| | | |
| | | /* |
| | | 点击事件 |
| | | myChart1.on('click', function (params) { |
| | | console.log(params); |
| | | }); |
| | | */ |
| | | // 指定图表的配置项和数据 |
| | | function getption(title) { |
| | | return { |
| | |
| | | filterMode: 'filter' |
| | | } |
| | | ], |
| | | series: [{ |
| | | name: '客流量', |
| | | type: 'line', |
| | | smooth: true, |
| | | data: [], |
| | | markLine: { |
| | | data: [ |
| | | {type: 'average', name: '平均值'} |
| | | ] |
| | | }, |
| | | markPoint: { |
| | | data: [ |
| | | {type: 'max', name: '最大值'}, |
| | | {type: 'min', name: '最小值'} |
| | | ] |
| | | }, |
| | | }], |
| | | animation: true, |
| | | animationDuration: 1000, |
| | | animationDurationUpdate: 1000, |
| | | animationDuration: 500, |
| | | animationDurationUpdate: 500, |
| | | animationEasing: 'linear', |
| | | animationEasingUpdate: 'linear', |
| | | } |
| | |
| | | |
| | | //加载数据 |
| | | function loadData() { |
| | | //加载门店客流对比 |
| | | myChart1.showLoading(); |
| | | $.AjaxProxy({ |
| | | p: MForm.toJson("#serchform"), |
| | | c: false, |
| | | }).invoke(basePath+"/admin/analysis/customerHeadCompare", |
| | | function (loj) { |
| | | var map = loj.getValue("mapInfo"); |
| | | console.log(map); |
| | | var option = getption("门店人头数对比"); |
| | | option.series = map.series; |
| | | console.log("option.series",option.series); |
| | | option.legend.data = map.legendData; |
| | | option.xAxis.data = map.xAxis; |
| | | console.log(option); |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart1.setOption(option); |
| | | myChart1.hideLoading(); |
| | | |
| | | }); |
| | | } |
| | | |
| | | var chartsUtils1 = new ChartsUtils(loadData); |
| | | chartsUtils1.setDataPackTimeValue(); |
| | | chartsUtils1.loadChartData(); |
| | | |
| | | //加载数据2 |
| | | function loadData2() { |
| | | //加载门店客流对比 |
| | | myChart2.showLoading(); |
| | | $.AjaxProxy({ |
| | | p: MForm.toJson("#serchform"), |
| | | c: false, |
| | | }).invoke(basePath+"/admin/analysis/vipVisitTendency", |
| | | }).invoke(basePath+"/admin/analysis/customerEnterCountCompare", |
| | | function (loj) { |
| | | var map = loj.getValue("mapInfo"); |
| | | var option = getption("门店客流趋势对比"); |
| | | var option = getption("门店人次对比"); |
| | | option.series = map.series; |
| | | option.legend.data = map.legendData; |
| | | option.xAxis.data = map.xAxis; |
| | | console.log(option); |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart2.setOption(option); |
| | | myChart2.hideLoading(); |
| | | |
| | | |
| | | |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | var ChartsUtils = new ChartsUtils(loadData); |
| | | ChartsUtils.setDataPackTimeValue(); |
| | | ChartsUtils.loadChartData(); |
| | | var chartsUtils2 = new ChartsUtils(loadData2); |
| | | chartsUtils2.setDataPackTimeValue(); |
| | | chartsUtils2.loadChartData(); |
| | | |
| | | |
| | | |
| | | |
| | | </script> |