Browse Source

efAnalysisdataVisualization eleFire.js 韩正义 commit at 2020-10-10

韩正义 4 năm trước cách đây
mục cha
commit
a734cbc4c6
1 tập tin đã thay đổi với 146 bổ sung0 xóa
  1. 146 0
      efAnalysisdataVisualization/externalJs/eleFire.js

+ 146 - 0
efAnalysisdataVisualization/externalJs/eleFire.js

@@ -281,3 +281,149 @@ function getListData(queryParam = {}) {
             // 折线图定制 (数据离散率挖掘)
             (function() {
 
+                let dispersion_rate = result.RESULT[0].dispersion_rate;
+
+                // 结论数据渲染
+                var items = '';
+                var conclusion = dispersion_rate.conclusion
+                for (x in conclusion) {
+                    xIndex = x.substr(x.length - 1, 1);
+                    items += `<p>${xIndex}、${conclusion[x]}</p>`
+                }
+                $('.divergence .summaryDetail').html(items);
+
+                // 三相电压
+                let a = [];
+                let b = [];
+                let c = [];
+                let d = [];
+                let voltage = dispersion_rate.voltage;
+                voltage.forEach(function(item, index) {
+                    a.push(item.variance)
+                    b.push(item.standard_deviation)
+                    c.push(item.average_value)
+                    d.push(item.data_time)
+                });
+
+                // 三相电流
+                let a2 = [];
+                let b2 = [];
+                let c2 = [];
+                let d2 = [];
+                let electric_current = dispersion_rate.electric_current;
+                electric_current.forEach(function(item, index) {
+                    a2.push(item.variance)
+                    b2.push(item.standard_deviation)
+                    c2.push(item.average_value)
+                    d2.push(item.data_time)
+                });
+
+                // 三相温度
+                let a3 = [];
+                let b3 = [];
+                let c3 = [];
+                let d3 = [];
+                let temperature = dispersion_rate.temperature;
+                temperature.forEach(function(item, index) {
+                    a3.push(item.variance)
+                    b3.push(item.standard_deviation)
+                    c3.push(item.average_value)
+                    d3.push(item.data_time)
+                });
+
+                //  漏电电流
+                let a4 = [];
+                let b4 = [];
+                let c4 = [];
+                let d4 = [];
+                let leakage_current = dispersion_rate.leakage_current;
+                leakage_current.forEach(function(item, index) {
+                    a4.push(item.variance)
+                    b4.push(item.standard_deviation)
+                    c4.push(item.average_value)
+                    d4.push(item.data_time)
+                });
+
+                var sortData = [{
+                        sortName: "三相电压",
+                        data: [a, b, c, d]
+                    },
+                    {
+                        sortName: "三相电流",
+                        data: [a2, b2, c2, d2]
+                    },
+                    {
+                        sortName: "三相温度",
+                        data: [a3, b3, c3, d3]
+                    }, {
+                        sortName: "漏电电流",
+                        data: [a4, b4, c4, d4]
+                    },
+                ];
+
+                var xData = function() {
+                    var data = [];
+                    for (var i = 1; i < leakage_current.length + 1; i++) {
+                        data.push(i);
+                    }
+                    return data;
+                }();
+
+                // 1. 实例化对象
+                var myChart = echarts.init(document.querySelector(".divergence .chart"));
+                // 2.指定配置
+                var option = {
+
+                    color: [{
+                            colorStops: [{
+                                offset: 0,
+                                color: '#F9860C' // 0% 处的颜色
+                            }, {
+                                offset: 1,
+                                color: '#fff' // 100% 处的颜色
+                            }],
+                        },
+
+                        {
+
+                            colorStops: [{
+                                offset: 0,
+                                color: '#07E1F1' // 0% 处的颜色
+                            }, {
+                                offset: 1,
+                                color: '#0456CB' // 100% 处的颜色
+                            }],
+
+                        },
+
+                        {
+
+                            colorStops: [{
+                                offset: 0,
+                                color: '#11F90C' // 0% 处的颜色
+                            }, {
+                                offset: 1,
+                                color: '#3FC713' // 100% 处的颜色
+                            }],
+
+                        }
+
+                    ],
+                    tooltip: {
+                        trigger: "axis",
+                        textStyle: {
+                            align: 'left' //图例左对齐
+                        },
+                        backgroundColor: '#12DFE0',
+                        formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:{b}'
+                    },
+                    legend: {
+                        // 如果series 对象有name 值,则 legend可以不用写data
+                        itemGap: 20,
+                        itemHeight: 2,
+                        itemWidth: 15,
+                        icon: 'rect',
+                        textStyle: {
+                            color: "#fff"
+                        },
+                        top: "bottom",