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ewH5jyZAkEfPo1ybAEHaC8h/NAGCPHoe5doECNJeQP6jCRDk0fMo1yZAkPYC8h9NgCCPnke5NgGCtBeQ/2gCBHn0PMq1CfQF+evH39oQ5CPwLQIfPn7++RVCL/3r0VeC3SKwQIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCNAkBp6wQsECLKwko41AgSpoRe8QIAgCyvpWCPwL13uj8kp4fIEAAAAAElFTkSuQmCC'
var chartData = {
timelineData: ['2018', '2019', '2020', '2021'], // 变量名修改
seriesData: [
{
xdata: ['批发零售', '制造业', '商务服务', '居民服务'],
ydata: [3,4,5,6],
status: [up, up, down, down]
}, // 2018
{
xdata: ['批发零售', '制造业', '商务服务', '居民服务'],
ydata: [13,24,15,26],
status: [down, up, up, down]
}, // 2019
{
xdata: ['批发零售', '制造业', '商务服务', '居民服务'],
ydata: [3,4,5,6],
status: [up, down, up, down]
}, // 2020
{
xdata: ['批发零售', '制造业', '商务服务', '居民服务'],
ydata: [33,24,35,56],
status: [up, down, down, up]
} // 2021
]
}
var optionVal = chartData.seriesData.map((item, index) => {
return {
// title: {
// text: this.chartData.timelineData[index] + '年'
// },
xAxis: {
data: item.xdata
},
tooltip: {},
series: [
{
name: "",
type: 'pictorialBar',
symbol: function(data,params){
return item.status[params.dataIndex]
},
symbolSize: [20, 30],
symbolOffset: [0, -40],
color:'orange',
symbolPosition: 'end',
label: {
show: true,
position: "top",
formatter: function(params){
return item.ydata[params.dataIndex]
},
fontSize: 30,
fontWeight: 'bold',
color: '#34DCFF'
},
data: item.ydata
},
{
type: 'bar',
data: item.ydata,
barWidth: 60,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1, // 从上到下变浅
[
{ offset: 0, color: '#2d57f8' },
{ offset: 1, color: '#4498f0' }
], false
),
opacity: 1
}
}
}
]
}
})
option = {
baseOption: {
timeline: {
data: chartData.timelineData,
axisType: 'category',
autoPlay: true,
playInterval: 1500,
},
title: {
text: '',
right: '2%',
bottom: '8%',
textStyle: {
fontSize: 50,
color: '#000'
}
},
xAxis: {
type: 'category'
},
yAxis: {
type: 'value'
}
},
options: optionVal
}