var option = { backgroundColor: 'rgba(0,0,0,0)', tooltip: { trigger: 'axis', backgroundColor: "rgba(1, 13, 19, 0.5)", borderWidth: 0, axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' }, textStyle: { color: "rgba(212, 232, 254, 1)", // fontSize: fontChart(0.24), }, confine: true }, grid: { top: '25%', left: '5%', right: '5%', bottom: '8%', containLabel: true, }, xAxis: { type: 'category', show: true, data: ['考勤', '技能达标', '参与度', '贡献度'], axisLine: { lineStyle: { color: "#fff" } }, axisTick: { show: false }, axisLabel: { // interval: 0, // rotate: 40, show: true, textStyle: { fontFamily: 'Microsoft YaHei', color: '#fff' } }, }, yAxis: { name: '(100%)', show: true, nameTextStyle: { color: "#fff", fontFamily: "Alibaba PuHuiTi", fontSize: 11, fontWeight: 400, padding: [0, 0, -10, -30] }, nameGap: 25, // 表现为上下位置 type: 'value', //max:'5000', splitLine: { show: false, lineStyle: { color: '#eff6ff' } }, axisTick: { }, axisLine: { // 显示y轴 show: true, lineStyle: { color: "#fff", }, // onZero: false, // symbol:['rect','rect'], // 表示Y轴起始位子设置为块装 // symbolSize:[1,30] // 表示延伸位置宽度为 1px ,延伸长度为100px }, axisLabel: { show: true, textStyle: { fontFamily: 'Microsoft YaHei', color: '#fff', fontSize: 11, }, // interval:2 } }, series: [{ name: '课中学习情况', type: 'bar', barWidth: '25', stack: 'chart', showBackground: true, backgroundStyle: { color: '#5A85B5' }, barWidth: 15, itemStyle: { normal: { // 柱子的颜色 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ // 进度是0的时候柱子颜色 offset: 0, color: '#2a77ea' }, { // 进度是100%的时候 offset: 1, color: '#01DCD6' }]), }, }, // 鼠标放到柱子上显示数据 tooltip: { valueFormatter: function (value) { return value + '%'; } }, // 数据在柱子上方显示 label: { show: true, //开启显示 position: 'top', //在上方显示 textStyle: { color: '#3b6ebf', fontSize: 12, fontWeight: 400, }, //数值样式 formatter: '{c}%', }, data: [100, 95, 95, 95] }, ] };