1.图标自适应
window.addEventListener("resize", function() {
myChart.resize();
});
2.x轴旋转
xAxis : [ {
type : 'category',
name : '单位',
axisLabel : {
interval : 0,
rotate : 25
},
data : orgNameList
} ],
3.legend:{top:'8.5%',right: 'right',right: '14%',}
4.图表的位置 grid:{top: '0%',bottom: '0%',left: '0%',}
5.隐藏坐标轴 axisLine: { show: false }, axisTick: {show: false }, axisLabel: {show: false},
6.图表网格线样式 splitLine: {show: true, lineStyle: {color: '#F1F3F5',type: 'solid' }},
7.echarts字体大小自适应
title : {
text: title2,
textStyle: {
color: '#333',
fontSize:getDpr(),
},
padding: [5, 40, 40, 0]
},
var getDpr = function getDpr() { var windowWidth = $(window).width(); if (windowWidth < 1920) { return 12 } if (windowWidth >= 1920 && windowWidth <= 3840) { return 18 } if (windowWidth > 3840 && windowWidth <= 5760) { return 30 } };