123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- {Template header}
- <body>
- <div class="warp">
- <div class="title default" style="margin-bottom:20px;"><input id="timetk" value="{date('Y-m-d',time()-7*24*3600)}" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD'})">
- 至 <input id="timetj" value="{date('Y-m-d',time())}" name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD'})"><span>确 定</span></div>
- <div id="container" style="width:100%;height:40%;float:left"></div>
- <div class="button"><font class="fh">关 闭</font></div>
- </div>
- <script src="{$theme}js/echarts.min.js?v=201911220005"></script>
- <script type="text/javascript">
- $(".default span").click(function() {
- defaultgo();
- });
- $(document).ready(function() {
- defaultgo();
- })
- function defaultgo() {
- layx.load('loadId','数据加载中');
- $.ajax({
- url: "/customertt/newold/",
- data: "timek="+$("#timetk").val()+"&timej="+$("#timetj").val(),
- type: "POST",
- dataType: "json",
- success: function(a) {
- if (a && a.success) {
- layx.destroy('loadId');
- var dom = document.getElementById("container");
- var myChart = echarts.init(dom);
- var app = {};
- option = null;
- option = {
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data:['新客户','复购客户']
- },
- toolbox: {
- show: true,
- feature: {
- dataZoom: {
- yAxisIndex: 'none'
- },
- dataView: {readOnly: false},
- magicType: {type: ['line', 'bar']},
- restore: {},
- saveAsImage: {}
- }
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: a.time
- },
- yAxis: {
- type: 'value',
- axisLabel: {
- formatter: '{value}'
- }
- },
- series: [
- {
- name:'新客户',
- type:'line',
- data: a.cnew,
- markPoint: {
- data: [
- {type: 'max', name: '最大值'},
- {type: 'min', name: '最小值'}
- ]
- },
- markLine: {
- data: [
- {type: 'average', name: '平均值'}
- ]
- }
- },
- {
- name:'复购客户',
- type:'line',
- data: a.cold,
- markLine: {
- data: [
- {type: 'average', name: '平均值'},
- [{
- symbol: 'none',
- x: '90%',
- yAxis: 'max'
- }, {
- symbol: 'circle',
- label: {
- normal: {
- position: 'start',
- formatter: '最大值'
- }
- },
- type: 'max',
- name: '最高点'
- }]
- ]
- }
- }
- ]
- };
- ;
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- }
- }
- }
- });
- };
- </script>
- <script type="text/javascript" src="{$theme}js/laydate.js"></script>
- {Template footer}
|