Browse Source

原材料需求差异分析折线图功能优化

test
wangxy 3 years ago
parent
commit
2f4393a30a
1 changed files with 32 additions and 39 deletions
  1. +32
    -39
      src/views/plant/materialAnalysis/chart/commonLineChart.vue

+ 32
- 39
src/views/plant/materialAnalysis/chart/commonLineChart.vue View File

@ -1,13 +1,10 @@
<template>
<div style="height:250px;width:100%;margin-top: 30px;" />
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
const animationDuration = 3000
export default {
props: {
dataList: {
@ -49,44 +46,40 @@ export default {
let receivableArray = []
this.xDataArray = []
this.seriesArray = []
if (newValue.length > 0) {
if (currentValue && currentValue.SortKeys) {
this.xDataArray = currentValue.SortKeys
this.maxValue = currentValue.PeriodOnPeriodUpperLimit
this.minValue = currentValue.PeriodOverPeriodLowerLimit
}
if (currentValue && currentValue.SortKeys) {
this.xDataArray = currentValue.SortKeys
this.maxValue = currentValue.PeriodOnPeriodUpperLimit
this.minValue = currentValue.PeriodOverPeriodLowerLimit
}
newValue.forEach(el => {
receivableArray = []
this.xDataArray.forEach(elChild => {
receivableArray.push(el.Item[elChild])
})
this.seriesArray.push({
type: 'line',
data: receivableArray,
markLine: {
data: [
{
name: '预警上限值',
yAxis: this.maxValue,
label: {
formatter: '{b}',
position: 'end'
}
},
{
name: '预警下限值',
yAxis: this.minValue,
label: {
formatter: '{b}',
position: 'end'
}
receivableArray = []
this.xDataArray.forEach(elChild => {
receivableArray.push(currentValue.Item[elChild])
})
this.seriesArray.push({
type: 'line',
data: receivableArray,
markLine: {
data: [
{
name: '预警上限值',
yAxis: this.maxValue,
label: {
formatter: '{b}',
position: 'end'
}
]
},
animationDuration
})
})
},
{
name: '预警下限值',
yAxis: this.minValue,
label: {
formatter: '{b}',
position: 'end'
}
}
]
},
animationDuration
})
this.initChart()
},
deep: true


Loading…
Cancel
Save