移除期望城市TOP8图表(无实际作用), 其余三图自动重排
This commit is contained in:
+3
-9
@@ -103,9 +103,8 @@ tr.today:hover td{background:#fde68a!important}
|
||||
<div class="panel"><h3>近30天趋势</h3><div id="chTrend" style="height:300px"></div></div>
|
||||
<div class="chartRow">
|
||||
<div class="panel"><h3>评分级别分布</h3><div id="chLevel" style="height:280px"></div></div>
|
||||
<div class="panel"><h3>学历分布</h3><div id="chEdu" style="height:280px"></div></div>
|
||||
<div class="panel"><h3>期望城市 TOP8</h3><div id="chCity" style="height:280px"></div></div>
|
||||
<div class="panel"><h3>筛选漏斗</h3><div id="chFunnel" style="height:280px"></div></div>
|
||||
<div class="panel"><h3>学历分布</h3><div id="chEdu" style="height:280px"></div></div>
|
||||
<div class="panel"><h3>筛选漏斗</h3><div id="chFunnel" style="height:280px"></div></div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="pane">
|
||||
@@ -240,7 +239,7 @@ async function loadStats(){
|
||||
const charts=[];
|
||||
function mkChart(id){const c=echarts.init($(id));charts.push(c);return c}
|
||||
function renderCharts(s){
|
||||
if(typeof echarts==='undefined'){['chTrend','chLevel','chEdu','chCity','chFunnel'].forEach(id=>{$(id).innerHTML='<div style="color:var(--sub);padding:40px;text-align:center">图表库未加载</div>'});return}
|
||||
if(typeof echarts==='undefined'){['chTrend','chLevel','chEdu','chFunnel'].forEach(id=>{$(id).innerHTML='<div style="color:var(--sub);padding:40px;text-align:center">图表库未加载</div>'});return}
|
||||
charts.splice(0).forEach(c=>c.dispose());
|
||||
const axis='#6b7280',split='#e5e7eb';
|
||||
mkChart('chTrend').setOption({
|
||||
@@ -263,11 +262,6 @@ function renderCharts(s){
|
||||
xAxis:{type:'category',data:s.byEducation.map(x=>x.k),axisLabel:{color:axis,interval:0},axisLine:{lineStyle:{color:split}}},
|
||||
yAxis:{type:'value',axisLabel:{color:axis},splitLine:{lineStyle:{color:split}}},
|
||||
series:[{type:'bar',barWidth:'55%',data:s.byEducation.map(x=>x.c),itemStyle:{color:'#2563eb',borderRadius:[4,4,0,0]}}]});
|
||||
mkChart('chCity').setOption({
|
||||
tooltip:{},grid:{left:70,right:30,top:20,bottom:30},
|
||||
xAxis:{type:'value',axisLabel:{color:axis},splitLine:{lineStyle:{color:split}}},
|
||||
yAxis:{type:'category',data:s.byCity.map(x=>x.k).reverse(),axisLabel:{color:axis}},
|
||||
series:[{type:'bar',barWidth:'55%',data:s.byCity.map(x=>x.c).reverse(),itemStyle:{color:'#0ea5e9',borderRadius:[0,4,4,0]}}]});
|
||||
const lv=s.byLevel.reduce((m,x)=>(m[x.k]=x.c,m),{});
|
||||
mkChart('chFunnel').setOption({
|
||||
tooltip:{trigger:'item',formatter:'{b}: {c}'},
|
||||
|
||||
Reference in New Issue
Block a user