setTimeout(function (){ axios.post("/role/rolestaff") .then(function (result) { var rolenames = []; var contss = []; result.data.data.forEach(function (item, index) { rolenames.push(item.rolename); contss.push(item.counts); }) const myChart=echarts.init(document.getElementById('wwc')); let options = { xAxis: { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, axisLabel: { interval:0, rotate:40, }, axisTick: { alignWithLabel: true }, type: 'category', data: rolenames }, yAxis: { type: 'value' }, series: [ { data: contss, type: 'bar' } ] }; myChart.setOption(options); }) },1000)
echarts解决添加多表
最新推荐文章于 2024-01-11 11:01:29 发布