echarts配置相关

1.调整图表与div间上下左右留白,则设置grid属性

grid:{
   x:25,
   y:45,
   x2:5,
   y2:20,
   borderWidth:1
},
//或者
grid: {
 left: '3%',
 right: '4%',
 bottom: '3%',
 containLabel: true
},

2.xy轴的字体颜色大小,坐标线颜色,以及网格线的设置

xAxis和yAxis 添加
axisLabel: {
 textStyle: {color: '#f1f1f1'},//字体颜色
 interval:0,//横轴信息全部显示
 //rotate:-15,//-15度角倾斜显示  
 formatter:function(val){//多余省略
  return val.length > 5 ? val.substr(0,4) + "..." : val;
 }
},
	         axisLine: {
	            //show: true,
	            lineStyle: {
	                type: 'solid',
	                color: '#3B526C',//下边线的颜色
	                width:'1'//坐标线的宽度
	            }
	        },
	        splitLine: {
	         	show: true,//垂直线
	            lineStyle:{
	                 color: '#3B526C'
	            }
	        }

   设置yaxis的type为category类型的,然后把要展示的10的X次方 放在data属性里实现指数倍增长

3.线条显示文字设置series中

label: {
	normal: {
	   show: true,
	   formatter: '{b}\n{d}%\n{c}(项)',
	   fontSize: 13
	}
}

4.工具栏toolbox

toolbox: {
	show: true,
	showTitle: false, // 隐藏默认文字,否则两者位置会重叠
	right: '22', //工具栏组件离容器右侧的距离
	feature: {
		dataView: { //列表
			show: true,
			readOnly: false
		},
		magicType: { //统计图
			show: true,
			type: ['line', 'bar'] //折线图/柱状
		},
		restore: { show: true }, //刷新
		saveAsImage: { show: true } //下载
	}
}

5.legend图例组件展现了不同系列的标记(symbol),颜色和名字。可以通过点击图例控制哪些系列不显示

legend: {
 left:55
},

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WebCsDn_TDCode

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值