|
@@ -721,6 +721,7 @@ let app = new Vue({
|
|
|
let myChart = echarts.init(this.$refs['echartC1'])
|
|
|
let option = {
|
|
|
..._.cloneDeep(this.commonOption),
|
|
|
+ color: ['#69c0ff'],
|
|
|
series: [
|
|
|
{
|
|
|
name: '全员劳动生产率(万/人)',
|
|
@@ -732,18 +733,36 @@ let app = new Vue({
|
|
|
symbolSize: 8, //标记的大小
|
|
|
smooth: false,
|
|
|
itemStyle: {
|
|
|
- //折线拐点标志的样式
|
|
|
- color: '#B889EA',
|
|
|
- borderColor: '#B889EA',
|
|
|
- width: 2,
|
|
|
- shadowColor: '#B889EA',
|
|
|
- shadowBlur: 4,
|
|
|
+ color: params => {
|
|
|
+ if (params.value < 0 && dataC1[1][params.dataIndex] < 0) {
|
|
|
+ return 'red'
|
|
|
+ } else if (params.value < 0) {
|
|
|
+ return 'yellow'
|
|
|
+ } else {
|
|
|
+ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: '#69c0ff',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: '#082550',
|
|
|
+ },
|
|
|
+ ])
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
lineStyle: {
|
|
|
color: '#B889EA',
|
|
|
width: 2,
|
|
|
},
|
|
|
data: dataC1[0],
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '全员劳动生产率同比变化',
|
|
|
+ yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
|
|
|
+ type: 'line',
|
|
|
markLine: {
|
|
|
data: [
|
|
|
{
|
|
@@ -775,11 +794,6 @@ let app = new Vue({
|
|
|
distance: [20, 8],
|
|
|
},
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- name: '全员劳动生产率同比变化',
|
|
|
- yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
|
|
|
- type: 'line',
|
|
|
itemStyle: {
|
|
|
normal: {
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
@@ -831,6 +845,7 @@ let app = new Vue({
|
|
|
let myChart = echarts.init(this.$refs['echartC2'])
|
|
|
let option = {
|
|
|
..._.cloneDeep(this.commonOption),
|
|
|
+ color: ['#69c0ff'],
|
|
|
series: [
|
|
|
{
|
|
|
name: '人工成本利润率同比变化',
|
|
@@ -861,17 +876,23 @@ let app = new Vue({
|
|
|
type: 'bar',
|
|
|
barWidth: 15,
|
|
|
itemStyle: {
|
|
|
- normal: {
|
|
|
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
- {
|
|
|
- offset: 0,
|
|
|
- color: '#69c0ff',
|
|
|
- },
|
|
|
- {
|
|
|
- offset: 1,
|
|
|
- color: '#082550',
|
|
|
- },
|
|
|
- ]),
|
|
|
+ color: params => {
|
|
|
+ if (params.value < 0 && dataC2[1][params.dataIndex] < 0) {
|
|
|
+ return 'red'
|
|
|
+ } else if (params.value < 0) {
|
|
|
+ return 'yellow'
|
|
|
+ } else {
|
|
|
+ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: '#69c0ff',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: '#082550',
|
|
|
+ },
|
|
|
+ ])
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
data: dataC2[1],
|