标签:bar fresh push var label vda name ica index
function loadCiShuAndKeHuShu(name) { var ajax1 = $.get(clientUrl_Order,{"dataType":"dp1169_app_zh_gmcs_jk","fresh":"1"}).done(function(data){ data_LN=data; }); var ajax2 = $.get(clientUrl_Order,{"dataType":"dp1169_app_zh_gmcs_lj","fresh":"1"}).done(function(data){ data_LJ=data; }); $.when(ajax1,ajax2).done(function(){ var xAxis=[]; var series_LN=[]; var series_LJ=[]; var series=[]; if (‘综合‘==name) { $.each(data_LN.monthly_trend, function(index,item) { if(xAxis.indexOf(item.vday_ym)==-1){ xAxis.push(item.stat); } }); $.each(data_LJ.monthly_trend, function(index,item) { if(xAxis.indexOf(item.stat)==-1){ xAxis.push(item.stat); } }); xAxis.sort(); console.log("--------------",xAxis) $.each(data_LN.monthly_trend,function(index,item){ var num=xAxis.indexOf(item.stat); series_LN[num]=item.custnum; }) $.each(data_LJ.monthly_trend,function(index,item){ var num=xAxis.indexOf(item.stat); series_LJ[num]=item.custnum; }) } console.log("&&&&&&&&&&&&&&&&&&",series_LN) //购买次数与客户数 let ec005_hBar = echarts.init($("#ec005_hBar")[0]); ec005_hBar.clear(); ec005_hBar.setOption(opt_line); ec005_hBar.setOption(opt_bar_vertical); ec005_hBar.setOption({ grid: { top: ‘25%‘, bottom: ‘10%‘, left: ‘15%‘, right: ‘5%‘, }, xAxis: { // name: ‘月份‘, data: xAxis, axisLabel:{ interval:0 } }, yAxis: [ { }, ], series: [ { name: ‘乐家 ‘, type: ‘bar‘, itemStyle: { color: colors[0] }, barWidth: ‘20%‘, data: series_LJ, }, { name: ‘乐农 ‘, type: ‘bar‘, itemStyle: { color: colors[1] }, barWidth: ‘20%‘, data: series_LN, } ] }); // 产品转化率 }); }
重点:
var ajax1 = $.get(clientUrl_Order,{"dataType":"dp1169_app_zh_gmcs_jk","fresh":"1"}).done(function(data){
data_LN=data;
});
var ajax2 = $.get(clientUrl_Order,{"dataType":"dp1169_app_zh_gmcs_lj","fresh":"1"}).done(function(data){
data_LJ=data;
});
$.when(ajax1,ajax2).done(function(){
})
标签:bar fresh push var label vda name ica index
原文地址:https://www.cnblogs.com/dsh2018/p/9674668.html