var newUsersChart = function() { EgretChart.init(''); EgretChart.setYAxis([{name : lan_sa_new_gamers}, {name : lan_sa_retention, axisLabel:{formatter: '{value} %'}}]); EgretChart.setData('bar', lan_sa_new_gamers, dataJson.newUsers); EgretChart.setData('line', lan_sa_retention_one, dataJson["1RatentionRate"], false, 1); EgretChart.setData('line', lan_sa_retention_three, dataJson["3RatentionRate"], false, 1); EgretChart.setData('line', lan_sa_retention_seven, dataJson["7RatentionRate"], false, 1); EgretChart.show('newUsersChart'); }; var hourDataChart = function() { EgretChart.init(); EgretChart.setData('line', lan_sa_average_new, dataJson.newUsersHour); EgretChart.show('hourDataChart'); }; var hourDataChartAll = function() { EgretChart.init(); for(m in dataJson.newUsersHourAll) { EgretChart.setData('line', m, dataJson.newUsersHourAll[m]); } EgretChart.show('hourDataChart'); }; var firstLevelChart = function() { if (dataJson.oneLevel == undefined) return true; EgretChart.init('', '', {"x2":0}); EgretChart.setData('bar', lan_sa_first_day_grade_distribution, dataJson.oneLevel); var chart = EgretChart.show('firstLevelChart'); var itemStyle = { normal: { label : { show : false, formatter : "{d}%", position:'inner' }, labelLine : { show : false } } }; EgretPieChart.init('', '', true); EgretPieChart.setData(dataJson.oneLevel, '70%', ['50%'], itemStyle); var chart1 = EgretPieChart.show('firstLevelChartPie'); chart.connect(chart1); chart1.connect(chart); }; var chanDataChart = function() { var itemStyle = { normal: { label : { show : false, formatter : "{d}%", position:'inner' }, labelLine : { show : false } } }; if (chanDataJson.chanDataTotal.length == 0) return true; EgretChart.init('', '', {"x2":20}); for (m in chanDataJson.chanData) { EgretChart.setData('line', m, chanDataJson.chanData[m]); } var chart = EgretChart.show('chanDataChart'); var itemStyle = { normal: { label : { show : false, }, labelLine : { show : false } } }; EgretPieChart.init('', '', true); EgretPieChart.setData(chanDataJson.chanDataTotal, '55%', ['50%']); var chart1 = EgretPieChart.show('chanDataChartPie'); chart.connect(chart1); chart1.connect(chart); }; $("#hourDataType").change(function(){ showHourData(); }); var showHourData = function() { var value = $("#hourDataType").val(); if (value == "day") { hourDataChartAll(); } else { hourDataChart(); } }; $("#generalTabs a").click(function(event){ $("#generalTabs a").removeClass("active"); $(this).addClass("active"); var value = $(this).attr("data"); var labels = $("#generalTabs a"); labels.each(function(){ var label = $(this).attr("data") $("#" + label).hide(); }); $("#" + value).show(); if (value != 'ltv') { if (value == "hourData") { $("#hourDataDiv").show(); var fun = "showHourData"; } else { $("#hourDataDiv").hide(); var fun = value + "Chart"; } doCallback(eval(fun)); } else { ltvPage(); } event.preventDefault(); }); // ltv 分页 var ltvPage = function () { var num_entries = $("#ltvTab tr[name='rows']").length; $("#Pagination").pagination(num_entries, { num_edge_entries: 1, //边缘页数 num_display_entries: 4, //主体页数 prev_text: lan_pre_page, next_text: lan_next_page, callback: pageselectCallback, items_per_page: 10 //每页显示10项 }); function pageselectCallback(page_index, jq){ $("#dataContent").empty(); var items_per_page = 10; var max_elem = Math.min((page_index+1) * items_per_page, num_entries); if ($("#dataContent thead").length < 1) { $("#dataContent").append($("#ltvTab thead").clone()); } if ($("#dataContent tbody").length < 1) { $("#dataContent").append(""); } else { $("#dataContent tbody").empty(); } for(var i=page_index*items_per_page;i