tsg-web/src/views/sz/pxjlgl/options.js

117 lines
2.7 KiB
JavaScript
Raw Normal View History

2024-09-24 16:52:53 +08:00
export default function options() {
var dataGDP = [900, 500, 1632.33, 1100, 400]
var dataGrowth = [2, 2.1, 3, 2.5, 2.1]
var xAxisData = ['2019年', '2020年', '2021年', '2022年', '2023年']
return {
animation: true,
tooltip: {
trigger: 'axis',
},
grid: {
top: '15%',
bottom: '15%',
right: '8%',
left: '7%',
},
legend: {
show: true,
left: "10%",
top: "-1%",
itemWidth: 11,
itemHeight: 10,
},
xAxis: {
data:xAxisData,
axisLine: {
show: true // 隐藏X轴轴线
},
axisTick: {
show: true // 隐藏X轴轴线
},
axisLabel: {
show: true,
margin: 14,
}
},
yAxis: [
{
type: 'value',
offset: 10,
axisTick: {
show: false
},
axisLine: {
show: false,
},
axisLabel: {
show: true,
margin: 0,
fontSize: 18,
}
},
{
type: 'value',
name: '(%)',
offset: 10,
nameTextStyle: {
color: 'rgba(255,255,255,0.5)',
fontSize: '12px'
},
axisTick: {
show: false
},
axisLine: {
show: false,
},
axisLabel: {
show: true,
fontSize: 18,
formatter: '{value}%'
}
}
],
series: [
{
name: '计划期数',
type: 'bar',
barWidth: 25,
data: dataGDP,
itemStyle:{
color:"#6295fa"
}
},
{
name: '实际期数',
type: 'bar',
barWidth: 25,
data: dataGDP,
itemStyle:{
color:"#62daab"
}
},
{
name: '完成率',
type: 'line',
yAxisIndex: 1,
showSymbol:false,
smooth: false, // 平滑曲线显示
lineStyle: {
width: 2,
color: '#5d7092'
},
itemStyle: {
color: '#5d7092',
shadowColor: '#5d7092',
shadowBlur: 10,
borderColor: '#5d7092',
borderWidth: 2
},
data: dataGrowth,
}
]
}
}