|
|
|
@ -159,17 +159,17 @@ export class HomePageComponent implements OnInit {
|
|
|
|
|
label: { |
|
|
|
|
normal: { |
|
|
|
|
show: true, |
|
|
|
|
// formatter: function (dataObj) {
|
|
|
|
|
// const { dataIndex, value } = dataObj;
|
|
|
|
|
// let labelText = value;
|
|
|
|
|
formatter: function (dataObj) { |
|
|
|
|
const { dataIndex, value } = dataObj; |
|
|
|
|
let labelText = value; |
|
|
|
|
|
|
|
|
|
// labelText = '';
|
|
|
|
|
// if (dataIndex % 2 === 0) { // 每隔三个x坐标显示一个
|
|
|
|
|
// labelText = value;
|
|
|
|
|
// }
|
|
|
|
|
labelText = ''; |
|
|
|
|
if (dataIndex % 1 === 0) { // 每隔三个x坐标显示一个
|
|
|
|
|
labelText = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// return `${labelText}`
|
|
|
|
|
// }
|
|
|
|
|
return `${labelText}` |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
@ -331,7 +331,20 @@ export class HomePageComponent implements OnInit {
|
|
|
|
|
symbol: 'circle', |
|
|
|
|
symbolSize: 8, |
|
|
|
|
label: { |
|
|
|
|
show: true |
|
|
|
|
normal: { |
|
|
|
|
show: true, |
|
|
|
|
formatter: function (dataObj) { |
|
|
|
|
const { dataIndex, value } = dataObj; |
|
|
|
|
let labelText = value; |
|
|
|
|
|
|
|
|
|
labelText = ''; |
|
|
|
|
if (dataIndex % 1 === 0) { // 每隔三个x坐标显示一个
|
|
|
|
|
labelText = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return `${labelText}` |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
itemStyle: { |
|
|
|
|
color: '#fff', |
|
|
|
@ -496,6 +509,23 @@ export class HomePageComponent implements OnInit {
|
|
|
|
|
this.warningechartbarOption.xAxis.data = monthArr |
|
|
|
|
this.warningechartbarOption.series[0].data = valuedata |
|
|
|
|
this.warningechartbarOption.series[1].data = valuedata |
|
|
|
|
let xxx = valuedata.find(function (value, index, arr) { |
|
|
|
|
return value > 1000; |
|
|
|
|
}) |
|
|
|
|
if (xxx) { |
|
|
|
|
// console.log('xxxxxxxxxx')
|
|
|
|
|
this.warningechartbarOption.series[1].label.normal.formatter = function (dataObj) { |
|
|
|
|
const { dataIndex, value } = dataObj; |
|
|
|
|
let labelText = value; |
|
|
|
|
|
|
|
|
|
labelText = ''; |
|
|
|
|
if (dataIndex % 2 === 0) { // 每隔三个x坐标显示一个
|
|
|
|
|
labelText = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return `${labelText}` |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.warningechartbar.setOption(this.warningechartbarOption); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -526,6 +556,23 @@ export class HomePageComponent implements OnInit {
|
|
|
|
|
this.oilchartbarOption.xAxis.data = monthArr |
|
|
|
|
this.oilchartbarOption.series[0].data = valuedata |
|
|
|
|
this.oilchartbarOption.series[1].data = valuedata |
|
|
|
|
let xxx = valuedata.find(function (value, index, arr) { |
|
|
|
|
return value > 1000; |
|
|
|
|
}) |
|
|
|
|
if (xxx) { |
|
|
|
|
// console.log('xxxxxxxxxx')
|
|
|
|
|
this.warningechartbarOption.series[1].label.normal.formatter = function (dataObj) { |
|
|
|
|
const { dataIndex, value } = dataObj; |
|
|
|
|
let labelText = value; |
|
|
|
|
|
|
|
|
|
labelText = ''; |
|
|
|
|
if (dataIndex % 2 === 0) { // 每隔三个x坐标显示一个
|
|
|
|
|
labelText = value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return `${labelText}` |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.oilchartbar.setOption(this.oilchartbarOption); |
|
|
|
|
} |
|
|
|
|
//获取统计信息
|
|
|
|
|