How to use echarts to add units to the y-axis and x-axis
y-axis each unit scale plus unit usage
yAxis: [
{
type: 'value',
axisLabel: {
formatter: '{value} 单'},
}
],
Set the unit at the top of the y-axis
Use title to illustrate the meaning of the y-axis data:
option = {
title: {
text: 订单来源分析+ '(单位为:单)',
x: 'center'
},
The other is
yAxis: [
{
//单位
name: '单',
type: 'value',
}
],
x axis add unit
xAxis: [
{
name: '辆', //关键代码
nameTextStyle: {
//关键代码
padding: [30, 0, 0, -30],
},
type: 'category',
data: ['优酷','公共','小程序'],
axisLabel: {
interval: 0,
rotate: 28,//倾斜度
},
axisTick: {
alignWithLabel: true
}
}
],