'commit'
This commit is contained in:
@@ -51,8 +51,7 @@
|
||||
|
||||
<div class="chart-controls">
|
||||
<div class="btn-group">
|
||||
<button class="btn active" data-type="both">全部显示</button>
|
||||
<button class="btn" data-type="enroll">入园数总量</button>
|
||||
<button class="btn active" data-type="enroll">入园数总量</button>
|
||||
<button class="btn" data-type="inschool">在园数总量</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,7 +64,7 @@
|
||||
// 初始化图表
|
||||
var preschoolChart = echarts.init(document.getElementById('preschoolChart'));
|
||||
var chartData = null;
|
||||
var currentType = 'both';
|
||||
var currentType = 'enroll';
|
||||
|
||||
// 显示加载状态
|
||||
function showLoading() {
|
||||
@@ -89,13 +88,7 @@
|
||||
|
||||
var option = JSON.parse(JSON.stringify(chartData));
|
||||
|
||||
// 根据当前选择的类型过滤数据
|
||||
if (currentType === 'enroll') {
|
||||
option.series = [option.series[0]]; // 只显示入园总数
|
||||
} else if (currentType === 'inschool') {
|
||||
option.series = [option.series[1]]; // 只显示在园总数
|
||||
}
|
||||
|
||||
// 根据用户要求,现在显示所有系列数据,不需要过滤
|
||||
preschoolChart.setOption(option);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user