1、
<div class="form-group col-sm-3 form-horizontal">
<div class="col-sm-8">
<button id="table" class="col-sm-4 control-label switchWords fa fa-th" οnclick="switchChart()" style="display:none;">切换图表
</button>
<button id="chart" class="col-sm-4 control-label switchWord fa fa-th" οnclick="switchTable()">切换表格
</button>
</div>
</div>
2、
function switchChart() {
isChart = true;
initChart();
document.getElementById("table").style.display = "none";
document.getElementById("chart").style.display = "block";
document.getElementById("listContainer").style.display = "none";
document.getElementById("chartContainer").style.display = "block";
}
function switchTable() {
isChart = false;
initTable();
document.getElementById("chart").style.display = "none";
document.getElementById("table").style.display = "block";
document.getElementById("chartContainer").style.display = "none";
document.getElementById("listContainer").style.display = "block";
}