|
@@ -163,7 +163,7 @@ let app = new Vue({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- handleShowTip(index) {
|
|
|
|
|
|
+ handleShowTip (index) {
|
|
this.showTip = true
|
|
this.showTip = true
|
|
this.tipNum = index
|
|
this.tipNum = index
|
|
},
|
|
},
|
|
@@ -556,7 +556,7 @@ let app = new Vue({
|
|
name: '全员劳动生产率同比变化',
|
|
name: '全员劳动生产率同比变化',
|
|
type: 'line',
|
|
type: 'line',
|
|
barWidth: 15,
|
|
barWidth: 15,
|
|
- yAxisIndex: 1,
|
|
|
|
|
|
+ // yAxisIndex: 1,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
@@ -654,7 +654,7 @@ let app = new Vue({
|
|
name: '人工成本利润率同比变化',
|
|
name: '人工成本利润率同比变化',
|
|
type: 'line',
|
|
type: 'line',
|
|
barWidth: 15,
|
|
barWidth: 15,
|
|
- yAxisIndex: 1,
|
|
|
|
|
|
+ // yAxisIndex: 1,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
@@ -939,7 +939,7 @@ let app = new Vue({
|
|
option.legend.show = true
|
|
option.legend.show = true
|
|
option.tooltip = {
|
|
option.tooltip = {
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
- formatter: '{a0}:{c0}'+ '%' + '<br/>' + '{a1}:{c1}' + '%'
|
|
|
|
|
|
+ formatter: '{a0}:{c0}' + '%' + '<br/>' + '{a1}:{c1}' + '%'
|
|
}
|
|
}
|
|
option.grid.right = '15%'
|
|
option.grid.right = '15%'
|
|
option.yAxis = [
|
|
option.yAxis = [
|
|
@@ -1140,6 +1140,7 @@ let app = new Vue({
|
|
{
|
|
{
|
|
name: '2022年累计招聘数',
|
|
name: '2022年累计招聘数',
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
|
+ yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
|
|
barWidth: 15,
|
|
barWidth: 15,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
@@ -1162,6 +1163,21 @@ let app = new Vue({
|
|
option.title.text = '各四级企业年利润与招聘情况分析'
|
|
option.title.text = '各四级企业年利润与招聘情况分析'
|
|
option.legend.data = ['2022年利润(万)', '2022年累计招聘数']
|
|
option.legend.data = ['2022年利润(万)', '2022年累计招聘数']
|
|
option.legend.show = true
|
|
option.legend.show = true
|
|
|
|
+ option.yAxis[0].max = function (value) {
|
|
|
|
+ if (Math.abs(value.max) > Math.abs(value.min)) {
|
|
|
|
+ return (Math.abs(value.max) * 1.2).toFixed(2);
|
|
|
|
+ } else {
|
|
|
|
+ return (Math.abs(value.min) * 1.2).toFixed(2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ option.yAxis[0].min = function (value) {
|
|
|
|
+ if (Math.abs(value.max) > Math.abs(value.min)) {
|
|
|
|
+ return (-Math.abs(value.max) * 1.2).toFixed(2);
|
|
|
|
+ } else {
|
|
|
|
+ return (-Math.abs(value.min) * 1.2).toFixed(2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
option.yAxis.push({
|
|
option.yAxis.push({
|
|
max: function (val) {
|
|
max: function (val) {
|
|
if (Math.abs(val.max) > Math.abs(val.min)) {
|
|
if (Math.abs(val.max) > Math.abs(val.min)) {
|
|
@@ -1183,6 +1199,13 @@ let app = new Vue({
|
|
axisLine: {
|
|
axisLine: {
|
|
show: false,
|
|
show: false,
|
|
},
|
|
},
|
|
|
|
+ axisLabel: {
|
|
|
|
+ show: true,
|
|
|
|
+ formatter: '{value}',
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: 'rgba(250,250,250,0.6)',
|
|
|
|
+ },
|
|
|
|
+ },
|
|
})
|
|
})
|
|
myChart.setOption(option)
|
|
myChart.setOption(option)
|
|
},
|
|
},
|
|
@@ -1437,10 +1460,10 @@ let app = new Vue({
|
|
}
|
|
}
|
|
option.yAxis[0].axisLabel = {
|
|
option.yAxis[0].axisLabel = {
|
|
show: true,
|
|
show: true,
|
|
- formatter: '{value} %',
|
|
|
|
- textStyle: {
|
|
|
|
- color: 'rgba(250,250,250,0.6)',
|
|
|
|
- },
|
|
|
|
|
|
+ formatter: '{value} %',
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: 'rgba(250,250,250,0.6)',
|
|
|
|
+ },
|
|
}
|
|
}
|
|
myChart.setOption(option)
|
|
myChart.setOption(option)
|
|
},
|
|
},
|
|
@@ -1478,10 +1501,10 @@ let app = new Vue({
|
|
}
|
|
}
|
|
option.yAxis[0].axisLabel = {
|
|
option.yAxis[0].axisLabel = {
|
|
show: true,
|
|
show: true,
|
|
- formatter: '{value} %',
|
|
|
|
- textStyle: {
|
|
|
|
- color: 'rgba(250,250,250,0.6)',
|
|
|
|
- },
|
|
|
|
|
|
+ formatter: '{value} %',
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: 'rgba(250,250,250,0.6)',
|
|
|
|
+ },
|
|
}
|
|
}
|
|
myChart.setOption(option)
|
|
myChart.setOption(option)
|
|
},
|
|
},
|