123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <div style="width: 100%;height: 100%">
- <div id="rpcharts"></div>
- </div>
- </template>
- <script>
- import resize from '../../../../components/Charts/mixins/resize'
- import echarts from 'echarts'
- import cc from '../../../../components/curvecolors'
- export default {
- mixins: [resize],
- watch: {
- drawData: {
- handler(newValue, oldValue) {
- console.log(newValue)
- this.draw(newValue.times, newValue.realValueDatas,newValue.ableValueDatas,newValue.theoryValueDatas,newValue.referencePowerByMeasuringDatas,newValue.referencePowerBySampleDatas,newValue.ablePowerByMeasuringDatas,newValue.ablePowerBySampleDatas,newValue.displayKyLl,newValue.cap)
- },
- deep: true
- },
- resizeKey: function (newQuestion, oldQuestion) {
- if (this.chart != null) {
- this.chart.resize();
- }
- }
- },
- props: {
- drawData: {
- type: Object,
- },
- resizeKey: {
- type: Number
- }
- },
- data() {
- return {
- chart: null,
- }
- },
- mounted() {
- },
- beforeDestroy() {
- if (!this.chart) {
- return
- }
- this.chart.dispose()
- this.chart = null
- },
- methods: {
- draw(timeaxis, realpower,ablepower,theorypower,referencePowerByMeasuringpower,referencePowerBySamplepower,ablePowerByMeasuringe,ablePowerBySample,displayKyLl,cap) {
- console.log(referencePowerByMeasuringpower)
- console.log(ablePowerByMeasuringe)
- this.chart = echarts.init(document.getElementById('rpcharts'))
- var option = {
- backgroundColor: 'transparent',
- title: {
- top: 20,
- text: '实际功率实时查询',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- color: '#000000'
- },
- left: '1%'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#000000'
- }
- }
- },
- legend: {
- top: 20,
- icon: 'rect',
- itemWidth: 14,
- itemHeight: 5,
- itemGap: 13,
- data: ['实际功率'],
- right: '4%',
- textStyle: {
- fontSize: 12,
- color: '#000000'
- }
- },
- dataZoom: [{
- show: true,
- realtime: true,
- start: 0,
- end: 100,
- left: "15%",
- right: "15%",
- textStyle: {
- color: "#000000"
- }
- }, {
- type: 'inside'
- }],
- grid: {
- top: 100,
- left: '2%',
- right: '2%',
- bottom: '10%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {
- lineStyle: {
- color: "#000000"
- }
- },
- data: timeaxis
- }],
- yAxis: [{
- type: 'value',
- name: '(MW)',
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#000000'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14
- }
- },
- splitLine: {
- lineStyle: {
- color: '#57617B'
- }
- }
- }],
- series: [{
- name: '实际功率',
- type: 'line',
- smooth: false,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- itemStyle: {
- normal: {
- color: cc.sj,
- borderColor: 'rgba(219,50,51,0.2)',
- borderWidth: 12
- }
- },
- data: realpower
- }]
- }
- option.yAxis[0].max = cap
- if(displayKyLl == 1){
- // option.legend.data = ['实际功率','可用功率','理论功率','参照理论功率(测风、测光法)','参照理论功率(样板机法)','参照可用功率(测风、测光法)','参照可用功率(样板机法)']
- option.legend.data = ['实际功率','可用功率','理论功率']
- option.series.push({
- name: '可用功率',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- // areaStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- // offset: 0,
- // color: 'rgba(219, 50, 51, 0.3)'
- // }, {
- // offset: 0.8,
- // color: 'rgba(219, 50, 51, 0)'
- // }], false),
- // shadowColor: 'rgba(0, 0, 0, 0.1)',
- // shadowBlur: 10
- // }
- // },
- itemStyle: {
- normal: {
- color: cc.kygl,
- borderColor: 'rgba(219,50,51,0.2)',
- borderWidth: 12
- }
- },
- data: ablepower
- },{
- name: '理论功率',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- // areaStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- // offset: 0,
- // color: 'rgba(219, 50, 51, 0.3)'
- // }, {
- // offset: 0.8,
- // color: 'rgba(219, 50, 51, 0)'
- // }], false),
- // shadowColor: 'rgba(0, 0, 0, 0.1)',
- // shadowBlur: 10
- // }
- // },
- itemStyle: {
- normal: {
- color: cc.llgl,
- borderColor: 'rgba(219,50,51,0.2)',
- borderWidth: 12
- }
- },
- data: theorypower
- }
- // {
- // name: '参照理论功率(测风、测光法)',
- // type: 'line',
- // smooth: true,
- // symbol: 'circle',
- // symbolSize: 5,
- // showSymbol: false,
- // lineStyle: {
- // normal: {
- // width: 2
- // }
- // },
- // areaStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- // offset: 0,
- // color: 'rgba(219, 50, 51, 0.3)'
- // }, {
- // offset: 0.8,
- // color: 'rgba(219, 50, 51, 0)'
- // }], false),
- // shadowColor: 'rgba(0, 0, 0, 0.1)',
- // shadowBlur: 10
- // }
- // },
- // itemStyle: {
- // normal: {
- //
- // color: cc.cfgf,
- // borderColor: 'rgba(219,50,51,0.2)',
- // borderWidth: 12
- // }
- // },
- // data: referencePowerByMeasuringpower
- // },{
- // name: '参照理论功率(样板机法)',
- // type: 'line',
- // smooth: true,
- // symbol: 'circle',
- // symbolSize: 5,
- // showSymbol: false,
- // lineStyle: {
- // normal: {
- // width: 2
- // }
- // },
- // areaStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- // offset: 0,
- // color: 'rgba(219, 50, 51, 0.3)'
- // }, {
- // offset: 0.8,
- // color: 'rgba(219, 50, 51, 0)'
- // }], false),
- // shadowColor: 'rgba(0, 0, 0, 0.1)',
- // shadowBlur: 10
- // }
- // },
- // itemStyle: {
- // normal: {
- //
- // color: cc.ybjf,
- // borderColor: 'rgba(219,50,51,0.2)',
- // borderWidth: 12
- // }
- // },
- // data: referencePowerBySamplepower
- // },{
- // name: '参照可用功率(测风、测光法)',
- // type: 'line',
- // smooth: true,
- // symbol: 'circle',
- // symbolSize: 5,
- // showSymbol: false,
- // lineStyle: {
- // normal: {
- // width: 2
- // }
- // },
- // areaStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- // offset: 0,
- // color: 'rgba(219, 50, 51, 0.3)'
- // }, {
- // offset: 0.8,
- // color: 'rgba(219, 50, 51, 0)'
- // }], false),
- // shadowColor: 'rgba(0, 0, 0, 0.1)',
- // shadowBlur: 10
- // }
- // },
- // itemStyle: {
- // normal: {
- // color: cc.kycfgf,
- // borderColor: 'rgba(219,50,51,0.2)',
- // borderWidth: 12
- // }
- // },
- // data: ablePowerByMeasuringe
- // },{
- // name: '参照可用功率(样板机法)',
- // type: 'line',
- // smooth: true,
- // symbol: 'circle',
- // symbolSize: 5,
- // showSymbol: false,
- // lineStyle: {
- // normal: {
- // width: 2
- // }
- // },
- // areaStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- // offset: 0,
- // color: 'rgba(219, 50, 51, 0.3)'
- // }, {
- // offset: 0.8,
- // color: 'rgba(219, 50, 51, 0)'
- // }], false),
- // shadowColor: 'rgba(0, 0, 0, 0.1)',
- // shadowBlur: 10
- // }
- // },
- // itemStyle: {
- // normal: {
- // color: cc.kyybjf,
- // borderColor: 'rgba(219,50,51,0.2)',
- // borderWidth: 12
- // }
- // },
- // data: ablePowerBySample
- // }
- )
- }
- this.chart.setOption(option,true)
- },
- }
- }
- </script>
- <style scoped>
- #rpcharts {
- width: 100%;
- height: calc(80vh - 50px);
- }
- </style>
|