Browse Source

waterAnalysisDataVisualization water.js 李欣儒 commit at 2021-03-30

李欣儒 4 years ago
parent
commit
b9588211b9
1 changed files with 97 additions and 0 deletions
  1. 97 0
      waterAnalysisDataVisualization/externalJs/water.js

+ 97 - 0
waterAnalysisDataVisualization/externalJs/water.js

@@ -1672,3 +1672,100 @@ function getListData(queryParam = {}) {
                                             {
                                                 offset: 0.8,
                                                 color: "rgba(255,156,0, 0.3)"
+                                            }
+                                        ],
+                                        false
+                                    ),
+                                    shadowColor: "rgba(0, 0, 0, 0.1)"
+                                }
+                            },
+                            data: sortData[0].data[0]
+                        },
+                        {
+                            symbol: "none",
+                            name: "消防栓",
+                            type: "line",
+                            smooth: true,
+                            areaStyle: {
+                                normal: {
+                                    color: new echarts.graphic.LinearGradient(
+                                        0,
+                                        0,
+                                        0,
+                                        1, [{
+                                                offset: 0,
+                                                color: "rgba(0,150,255,0.5)"
+                                            },
+                                            {
+                                                offset: 0.8,
+                                                color: "rgba(0,150,255, 0.1)"
+                                            }
+                                        ],
+                                        false
+                                    ),
+                                    shadowColor: "rgba(0, 0, 0, 0.1)"
+                                }
+                            },
+
+                            data: sortData[0].data[1]
+                        }
+                    ]
+                };
+
+                myChart.setOption(option);
+                var img1 = document.getElementById('deviceLinkChart2_img');
+                setTimeout(function() {
+                    img1.src = myChart.getDataURL();
+                }, 1000)
+
+            })();
+
+
+            //数据波动关联
+
+            let data_fluctuation = result.RESULT[0].data_fluctuation;
+
+            // 结论数据渲染
+            var items = '';
+            var conclusion = data_fluctuation.conclusion
+            for (x in conclusion) {
+                xIndex = x.substr(x.length - 1, 1);
+                items += `<div>${xIndex}、${conclusion[x]}</div>`
+            }
+            $('.exportBox .data_fluctuation .summaryDetail').html(items);
+
+            // 数据波动关联
+            (function() {
+
+                let position = [];
+                let before_fluctuation = [];
+                let after_fluctuation = [];
+                let volatility_data = data_fluctuation.volatility_data;
+                volatility_data.forEach(function(item, index) {
+
+                    //楼层
+                    position.push(item.position)
+
+                    //开始值
+                    before_fluctuation.push(item.before_fluctuation)
+
+                    //结束值
+                    after_fluctuation.push(item.after_fluctuation)
+                });
+                // 1. 实例化对象
+                var myChart = echarts.init(document.querySelector("#dataChangeChart1"));
+                var xData = position;
+                // 2.指定配置
+                var option = {
+                    backgroundColor: 'transparent',
+                    color: ['rgba(0,150,255,.5)', 'rgba(255,156,0,.5)'],
+                    tooltip: {
+                        backgroundColor: '#12DFE0',
+                        //提示框组件
+                        trigger: 'axis',
+                        formatter: '{a0}: {c0}<br />{a1}: {c1}<br />时间:' + chooseTime + '',
+                        axisPointer: {
+                            type: 'shadow',
+                        },
+                        textStyle: {
+                            fontStyle: 'normal',