现在是有三个柱状图和三个折线图,柱状图的数据和折线图的数据要一一对应,但是写出来之后,折线图的小点有点偏移。如果只写一个柱状和一个折线就不会有这个问题。所以,多个对应的,小点偏移是因为什么?
series: [{
name: '流入',
type: 'bar',
data: [49, 73, 92, 56, 77, 56, 42, 36, 60, 64],
barWidth: 10,
barGap: 0, //柱间距离
label: { //图形上的文本标签
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 12,
},
},
},
itemStyle: { //图形样式
normal: {
barBorderRadius: [5, 5, 0, 0],
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 1,
color: 'rgba(127, 128, 225, 0.7)'
}, {
offset: 0.9,
color: 'rgba(72, 73, 181, 0.7)'
}, {
offset: 0.31,
color: 'rgba(0, 208, 208, 0.7)'
}, {
offset: 0.15,
color: 'rgba(0, 208, 208, 0.7)'
}, {
offset: 0,
color: 'rgba(104, 253, 255, 0.7)'
}], false),
},
},
},
{
name: '流出',
type: 'bar',
data: [29, 50, 44, 27, 57, 46, 12, 27, 48, 60],
barWidth: 10,
barGap: 0.2, //柱间距离
label: { //图形上的文本标签
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 12,
},
},
},
itemStyle: { //图形样式
normal: {
barBorderRadius: [5, 5, 0, 0],
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 1,
color: 'rgba(127, 128, 225, 0.7)'
}, {
offset: 0.9,
color: 'rgba(72, 73, 181, 0.7)'
}, {
offset: 0.25,
color: 'rgba(226, 99, 74, 0.7)'
}, {
offset: 0,
color: 'rgba(253, 200, 106, 0.7)'
}], false),
},
},
},
{
name: '流出1',
type: 'bar',
data: [19, 40, 34, 37, 47, 56, 22, 17, 58, 70],
barWidth: 10,
barGap: 0.2, //柱间距离
label: { //图形上的文本标签
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 12,
},
},
},
itemStyle: { //图形样式
normal: {
barBorderRadius: [5, 5, 0, 0],
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 1,
color: 'rgba(127, 128, 225, 0.7)'
}, {
offset: 0.9,
color: 'rgba(72, 73, 181, 0.7)'
}, {
offset: 0.25,
color: 'rgba(226, 99, 74, 0.7)'
}, {
offset: 0,
color: 'rgba(253, 200, 106, 0.7)'
}], false),
},
},
},
{
name: "背影",
type: "line",
smooth: true, //平滑曲线显示
showAllSymbol: false, //显示所有图形。
symbol: "circle", //标记的图形为实心圆
symbolSize: 10,
lineStyle: {
width: 2
},
itemStyle: {
//折线拐点标志的样式
color: "#058cff"
},
// areaStyle: {
// color: "rgba(0, 151, 251, 0.1)"
// },
data: [49, 73, 92, 56, 77, 56, 42, 36, 60, 64],
z: 5
},
{
name: "背影1",
type: "line",
smooth: true, //平滑曲线显示
showAllSymbol: false, //显示所有图形。
symbol: "circle", //标记的图形为实心圆
symbolSize: 10,
lineStyle: {
width: 2
},
itemStyle: {
//折线拐点标志的样式
color: "#058cff"
},
data: [29, 50, 44, 27, 57, 46, 12, 27, 48, 60],
z: 5
},
{
name: "背影2",
type: "line",
smooth: true, //平滑曲线显示
showAllSymbol: false, //显示所有图形。
symbol: "circle", //标记的图形为实心圆
symbolSize: 10,
lineStyle: {
width: 2
},
itemStyle: {
//折线拐点标志的样式
color: "#058cff"
},
data: [19, 40, 34, 37, 47, 56, 22, 17, 58, 70],
z: 5
},
],
dataZoom: [{
type: "slider",
show: false,
xAxisIndex: [0],
endValue: 4,
startValue: 0
}]