axisLabel: {
interval: 0,
formatter: function(value) {
//x轴的文字改为竖版显示
var str = value.split("");
return str.join("\n");
},
textStyle: {
fontSize: 12,
color: '#ccc'
},
},
整体代码如下 :
option = {
backgroundColor: "#1A1835",
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
textStyle: {
color: "#fff"
}
},
},
grid: {
borderWidth: 0,
top: 140,
bottom: 95,
textStyle: {
color: "#fff"
}
},
legend: {
x: '46%',
top: '11%',
textStyle: {
color: '#90979c',
},
data: ['A', 'B']
},
calculable: true,
xAxis: [{
type: "category",
axisLabel: {
interval: 0,
formatter: function(value) {
//x轴的文字改为竖版显示
var str = value.split("");
return str.join("\n");
},
textStyle: {
fontSize: 12,
color: '#ccc'
},
},
data: ['制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他', '制造业', '建筑业', '农林牧渔', '房地产', '金融业', '居民服务及其他'],
}],
yAxis: [{
type: "value",
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: "rgba(204,187,225,0.5)",
}
},
}],
series: [{
name: "A",
type: "effectScatter",
symbolSize: [5, 5],
rippleEffect: {
period: 1,
scale: 8,
brushType: 'fill'
},
itemStyle: {
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
offset: 0,
color: '#FAFF52'
}, {
offset: 1,
color: '#1A1835'
}])
},
markPoint: {
label: {
normal: {
textStyle: {
color: '#fff'
}
}
},
data: [{
type: 'max',
name: '最大值',
}, {
type: 'min',
name: '最小值'
}]
},
data: [
59, 17, 55, 61, 29, 33, 34, 35, 28, 29, 27, 20, 55, 10, 49,
33, 44, 28, 22, 33, 36, 33, 22, 20, 19, 25, 10, 29, 24, 28
],
}, {
name: "B",
type: "effectScatter",
symbolSize: [5, 5],
rippleEffect: {
period: 1,
scale: 8,
brushType: 'fill'
},
itemStyle: {
// color: "#c257F6",
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
offset: 0,
color: '#C357F6'
}, {
offset: 1,
color: '#1A1835'
}])
},
markPoint: {
label: {
normal: {
textStyle: {
color: '#fff'
}
}
},
data: [{
type: 'max',
name: '最大值',
}, {
type: 'min',
name: '最小值'
}]
},
data: [
21, 36, 29, 38, 35, 34, 35, 38, 55, 43, 19, 43, 54, 35, 48, 37,
34, 39, 38, 35, 40, 43, 54, 32, 42, 32, 38, 35, 33, 65, 42
]
}, ]
}