|
@@ -164,7 +164,7 @@ let app = new Vue({
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleShowTip(index) {
|
|
|
+ handleShowTip (index) {
|
|
|
this.showTip = true
|
|
|
this.tipNum = index
|
|
|
},
|
|
@@ -557,7 +557,7 @@ let app = new Vue({
|
|
|
name: '全员劳动生产率同比变化',
|
|
|
type: 'line',
|
|
|
barWidth: 15,
|
|
|
- yAxisIndex: 1,
|
|
|
+ // yAxisIndex: 1,
|
|
|
itemStyle: {
|
|
|
normal: {
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
@@ -655,7 +655,7 @@ let app = new Vue({
|
|
|
name: '人工成本利润率同比变化',
|
|
|
type: 'line',
|
|
|
barWidth: 15,
|
|
|
- yAxisIndex: 1,
|
|
|
+ // yAxisIndex: 1,
|
|
|
itemStyle: {
|
|
|
normal: {
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
@@ -1140,6 +1140,7 @@ let app = new Vue({
|
|
|
},
|
|
|
{
|
|
|
name: '2022年累计招聘数',
|
|
|
+ yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
|
|
|
type: 'bar',
|
|
|
barWidth: 15,
|
|
|
itemStyle: {
|
|
@@ -1163,6 +1164,21 @@ let app = new Vue({
|
|
|
option.title.text = '各三级企业年利润与招聘情况分析'
|
|
|
option.legend.data = ['2022年利润(万)', '2022年累计招聘数']
|
|
|
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({
|
|
|
splitLine: {
|
|
|
show: false,
|
|
@@ -1170,6 +1186,28 @@ let app = new Vue({
|
|
|
axisLine: {
|
|
|
show: false,
|
|
|
},
|
|
|
+ axisLabel: {
|
|
|
+ show: true,
|
|
|
+ formatter: '{value}',
|
|
|
+ textStyle: {
|
|
|
+ color: 'rgba(250,250,250,0.6)',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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 = [
|
|
|
// {
|
|
@@ -1455,10 +1493,10 @@ let app = new Vue({
|
|
|
}
|
|
|
option.yAxis[0].axisLabel = {
|
|
|
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)
|
|
|
},
|
|
@@ -1496,10 +1534,10 @@ let app = new Vue({
|
|
|
}
|
|
|
option.yAxis[0].axisLabel = {
|
|
|
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)
|
|
|
},
|