国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

echart 圖表添加數(shù)據(jù)分析功能,(右上控制選擇)

這篇具有很好參考價(jià)值的文章主要介紹了echart 圖表添加數(shù)據(jù)分析功能,(右上控制選擇)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

echart 圖表添加數(shù)據(jù)分析功能,可區(qū)域選擇數(shù)據(jù),右上按鈕,控制echart行為

    chart.on('globalcursortaken', onGlobalcursortaken); //綁定事件
    chart.off("brushSelected");//解綁事件處理函數(shù)
    chart.on('brushSelected', renderBrushed);

echart 圖表添加數(shù)據(jù)分析功能,(右上控制選擇),數(shù)據(jù)分析,javascript,前端文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-677467.html

   getBarDev2(eIndex, eTimeArr, eSeriesArr, eSensorId, eDeviceId, eDeviceType) {
        //console.log('EEEEEEE', eIndex, eTimeArr, eSeriesArr, eSensorId, eDeviceId, eDeviceType)
        this.$refs.chart.removeAttribute('_echarts_instance_')
        const chart = this.$echarts.init(this.$refs.chart, 'light')
        var option;
        option = {
          title: {
            text: eSensorId + " : " + eDeviceId,
            textStyle: {
              //文字顏色
              color: '#fff',
            }
          },
          textStyle: {
            color: '#fff',//'red',字體顏色
          },
          legend: {
            textStyle: {
              //文字顏色
              color: '#fff',
            }
          },
          tooltip: {
            trigger: 'axis',
            show: true,
            formatter: (params) => {
              var listData = params
              var list = []
              var listItem = ''
              var html = ''
              html += '<span>' + listData[0].name + '<span><br>'
              for (var i = 0; i < listData.length; i++) {
                html += '<i style="display: inline-block;width: 10px;height: 10px;background: ' +
                  listData[i].color +
                  ';margin-right: 5px;border-radius: 50%;}"></i><span style="width:70px; display:inline-block;">' +
                  listData[i].seriesName +
                  ': ' +
                  listData[i].data +
                  '</span><br>'
              }
              list.push(html)
              listItem = list.join('<br>')
              return '<div class="showBox">' + listItem + '</div>'
            }
          },
          grid: {
            left: '3%',
            right: '4%',
            // bottom: '5%',
            // containLabel: true
          },
          xAxis: {
            type: 'category',
            boundaryGap: false,
            data: eTimeArr,
            axisLabel: {
              textStyle: {
                color: "#2afcfd",
              },
            },
            axisLine: {
              lineStyle: {
                color: ["#2afcfd"],
                width: 0,
                type: "dashed",
              },
            },
            splitLine: {
              show: true,
              lineStyle: {
                color: ["#315070"],
                width: 1,
                type: "dashed",
              },
            },
          },
          yAxis: {
            type: 'value',
            min: 'dataMin',
            max: "dataMax",
            axisLabel: {
              textStyle: {
                color: "#fff",
              },
              boundaryGap: [0, '100%']
            },
            axisLine: {
              lineStyle: {
                onZero: false,
                color: ["#859fce"],
                // width: 0,
                // type: "dashed",
              },
            },
            splitLine: {
              show: true,
              lineStyle: {
                color: ["#315070"],
                width: 1,
                type: "dashed",
              },
            },
          },
          dataZoom: [
            {
              type: 'slider',
              show: true,
              xAxisIndex: [0],
              bottom: "auto",
            }
          ],
          toolbox: {
            feature: {
              brush: {
                title: {
                  lineX: '數(shù)據(jù)分析'
                }
              },
              //自定義關(guān)閉按鈕
              myClear: {
                show: true,
                title: '退出分析',
                icon: 'path://M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2',
                onclick: function () {
                  //brush狀態(tài)
                  chart.dispatchAction({
                    type: 'takeGlobalCursor'
                  });
                  //清除選區(qū)
                  chart.dispatchAction({
                    type: 'brush',
                    areas: []
                  });
                }
              },
            }
          },
          brush: {
            toolbox: ['lineX'],
            xAxisIndex: 0,
            throttleType: 'debounce',
            throttleDelay: 600,
            //『?jiǎn)螕羟宄羞x框』
            removeOnClick: false
          },

          series: eSeriesArr
        };
        chart.setOption(option, true)

        //brush狀態(tài)事件
        chart.on('globalcursortaken', onGlobalcursortaken);
        function onGlobalcursortaken(params) {
          //可以根據(jù) params.brushOption.brushType = false 來(lái)判斷是否退出刷選狀態(tài)。此處無(wú)論進(jìn)入或者退出狀態(tài)都清空選取即可
          chart.dispatchAction({
            type: 'brush',
            areas: []
          });
        }

        chart.off("brushSelected");//解綁事件處理函數(shù)(可根據(jù)情況而定是否需要,這里我這邊會(huì)重繪幾次表,所以需要解綁事件處理函數(shù))。
        chart.on('brushSelected', renderBrushed);

        function renderBrushed(params) {

          // console.log('renderBrushed', params);
          var brushed = [];
          var brushComponent = params.batch[0];
          var selArea = params.batch[0].areas[0] ? params.batch[0].areas[0].coordRange : ''

          var selIdxs = []
          var selTimes = []
          var selDatas = []
          for (var sIdx = selArea[0]; sIdx <= selArea[1]; sIdx++) {
            selIdxs.push(sIdx)
            selTimes.push(eTimeArr[sIdx])
          }

          eSeriesArr.forEach((e, i) => {
            var obj = {
              name: e.name,
              data: []
            }
            selDatas.push(obj)
            selIdxs.forEach(item => {
              selDatas[i].data.push(e.data[item])
            });
          });

          // console.log('selTimes', selTimes)
          // console.log('selDatas', selDatas)

          //最大值,最小值,最大相鄰差,最大差值
          // var paramsArr = params.batch[0].selected
          // console.log('paramsArr', paramsArr)

          selDatas.forEach((e, i) => {
            e['startTime'] = selTimes[0]
            e['endTime'] = selTimes[selTimes.length - 1]
            e['maxVal'] = Math.max(...e.data)
            e['minVal'] = Math.min(...e.data)
            e['maxGap'] = maximumGap(e.data)
            e['maxDiff'] = maximunDiff(e.data)
          });

          // console.log('selDatas', selDatas)
          // console.log('params', params)

          if (selIdxs.length > 0) {
            chart.setOption({
              tooltip: {
                show: true,
                formatter: function (params) {
                  selDatas.forEach((e, i) => {
                    params.forEach((pe, pi) => {
                      if (e.name == pe.seriesName) {
                        e['color'] = pe.color
                      }
                    });
                  });

                  var list = []
                  var listItem = ''
                  var html = ''
                  html += '<span>' + selDatas[0].startTime + '~' + selDatas[0].endTime + '<span><br>'
                  selDatas.forEach((e, i) => {
                    if (e.color) {
                      html +=
                        "<div style='font-size: 14px; font-weight:bold;'>" +
                        "<div class='yuan' style='width: 12px;height: 12px;background: #ffffff;border-radius: 50%;display: inline-block;border: 3px solid " + e.color + "; '></div>" +
                        " 曲線: <span>" + e.name + "</span>" +
                        "</div>" +
                        "<p style='font-size: 12px;'>最大值: " + e.maxVal + "; 最小值: " + e.minVal + "</p>" +
                        "<p style='font-size: 12px;'>最大相鄰差: " + e.maxGap + "; 最大差值: " + e.maxDiff + "</p>"
                    }
                  });
                  list.push(html)
                  listItem = list.join('<br>')
                  return '<div style="margin: 0px 10px 10px 10px; ">' + listItem + '</div>'
                },
              }
            });
          } else {
            chart.setOption({
              tooltip: {
                show: true,
                formatter: (params) => {
                  var listData = params
                  var list = []
                  var listItem = ''
                  var html = ''
                  html += '<span>' + listData[0].name + '<span><br>'
                  for (var i = 0; i < listData.length; i++) {
                    html += '<i style="display: inline-block;width: 10px;height: 10px;background: ' +
                      listData[i].color +
                      ';margin-right: 5px;border-radius: 50%;}"></i><span style="width:70px; display:inline-block;">' +
                      listData[i].seriesName +
                      ': ' +
                      listData[i].data +
                      '</span><br>'
                  }
                  list.push(html)
                  listItem = list.join('<br>')
                  return '<div class="showBox">' + listItem + '</div>'
                }
              }
            });
          }

          function maximumGap(nums) {
            if (nums) {
              if (nums.length < 2) return 0
              nums.sort((a, b) => a - b)
              let max = nums[1] - nums[0]
              for (let i = 0; i < nums.length - 1; i++) {
                max = Math.max(max, nums[i + 1] - nums[i])
              }
              return max.toFixed(2)
            }
          }

          function maximunDiff(arr) {
            var max = Math.max.apply(null, arr);
            var min = Math.min.apply(null, arr);
            return (max - min).toFixed(2);
          }
          // brushSelected over 
        }
        //over
      },


到了這里,關(guān)于echart 圖表添加數(shù)據(jù)分析功能,(右上控制選擇)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 可視化圖表組件之股票數(shù)據(jù)分析應(yīng)用

    可視化圖表組件之股票數(shù)據(jù)分析應(yīng)用

    股市是市場(chǎng)經(jīng)濟(jì)的必然產(chǎn)物,在一個(gè)國(guó)家的金融領(lǐng)域之中有著舉足輕重的地位。在過(guò)去,人們對(duì)于市場(chǎng)走勢(shì)的把握主要依賴于經(jīng)驗(yàn)和直覺(jué),往往容易受到主觀因素的影響,導(dǎo)致決策上出現(xiàn)偏差。如今,通過(guò)數(shù)據(jù)可視化呈現(xiàn),便可將歷年數(shù)據(jù)和市場(chǎng)情報(bào)進(jìn)行深度挖掘、分析,從

    2024年02月07日
    瀏覽(32)
  • 大數(shù)據(jù)分析工具Power BI(十三):制作占比分析圖表

    大數(shù)據(jù)分析工具Power BI(十三):制作占比分析圖表

    文章目錄 制作占比分析圖表 一、餅圖 二、環(huán)形圖 三、樹(shù)狀圖

    2023年04月18日
    瀏覽(24)
  • 《PySpark大數(shù)據(jù)分析實(shí)戰(zhàn)》-26.數(shù)據(jù)可視化圖表Seaborn介紹

    《PySpark大數(shù)據(jù)分析實(shí)戰(zhàn)》-26.數(shù)據(jù)可視化圖表Seaborn介紹

    ?? 博主簡(jiǎn)介 ?? 作者簡(jiǎn)介:大家好,我是wux_labs。?? 熱衷于各種主流技術(shù),熱愛(ài)數(shù)據(jù)科學(xué)、機(jī)器學(xué)習(xí)、云計(jì)算、人工智能。 通過(guò)了TiDB數(shù)據(jù)庫(kù)專員(PCTA)、TiDB數(shù)據(jù)庫(kù)專家(PCTP)、TiDB數(shù)據(jù)庫(kù)認(rèn)證SQL開(kāi)發(fā)專家(PCSD)認(rèn)證。 通過(guò)了微軟Azure開(kāi)發(fā)人員、Azure數(shù)據(jù)工程師、Azure解決

    2024年01月21日
    瀏覽(50)
  • 《PySpark大數(shù)據(jù)分析實(shí)戰(zhàn)》-27.數(shù)據(jù)可視化圖表Pyecharts介紹

    《PySpark大數(shù)據(jù)分析實(shí)戰(zhàn)》-27.數(shù)據(jù)可視化圖表Pyecharts介紹

    ?? 博主簡(jiǎn)介 ?? 作者簡(jiǎn)介:大家好,我是wux_labs。?? 熱衷于各種主流技術(shù),熱愛(ài)數(shù)據(jù)科學(xué)、機(jī)器學(xué)習(xí)、云計(jì)算、人工智能。 通過(guò)了TiDB數(shù)據(jù)庫(kù)專員(PCTA)、TiDB數(shù)據(jù)庫(kù)專家(PCTP)、TiDB數(shù)據(jù)庫(kù)認(rèn)證SQL開(kāi)發(fā)專家(PCSD)認(rèn)證。 通過(guò)了微軟Azure開(kāi)發(fā)人員、Azure數(shù)據(jù)工程師、Azure解決

    2024年01月24日
    瀏覽(28)
  • 用Python實(shí)現(xiàn)創(chuàng)建十二星座數(shù)據(jù)分析圖表

    用Python實(shí)現(xiàn)創(chuàng)建十二星座數(shù)據(jù)分析圖表

    下面小編提供的代碼中,您已經(jīng)將 pie.render() 注釋掉,并使用了 pie.render_to_file(\\\'十二星座.svg\\\') 來(lái)將餅狀圖渲染到一個(gè)名為 十二星座.svg 的文件中。這是一個(gè)正確的做法,如果您想在文件中保存圖表而不是在瀏覽器中顯示它。 成功創(chuàng)建圖表: 問(wèn)題分析: 要確保代碼能夠正常工

    2024年02月21日
    瀏覽(15)
  • 圖表數(shù)據(jù)分析怎么做,舉實(shí)例給你說(shuō)清楚

    圖表數(shù)據(jù)分析怎么做,舉實(shí)例給你說(shuō)清楚

    現(xiàn)在工作離不開(kāi)圖表數(shù)據(jù)分析,但是圖表數(shù)據(jù)分析卻容易出錯(cuò)。而且容易出現(xiàn)錯(cuò)誤的地方不是在對(duì)數(shù)據(jù)的處理上,而是在對(duì)圖表的選擇上。 ? 要正確的做好圖表數(shù)據(jù)分析就要選擇合適的圖表再進(jìn)行分析。下面跟大家說(shuō)說(shuō)怎么解決這個(gè)難題,做好圖表數(shù)據(jù)分析: 廢話不多說(shuō),

    2024年02月05日
    瀏覽(25)
  • 圖撲可視化圖表組件之股票數(shù)據(jù)分析應(yīng)用

    圖撲可視化圖表組件之股票數(shù)據(jù)分析應(yīng)用

    股市是市場(chǎng)經(jīng)濟(jì)的必然產(chǎn)物,在一個(gè)國(guó)家的金融領(lǐng)域之中有著舉足輕重的地位。在過(guò)去,人們對(duì)于市場(chǎng)走勢(shì)的把握主要依賴于經(jīng)驗(yàn)和直覺(jué),往往容易受到主觀因素的影響,導(dǎo)致決策上出現(xiàn)偏差。如今,通過(guò)數(shù)據(jù)可視化呈現(xiàn),便可將歷年數(shù)據(jù)和市場(chǎng)情報(bào)進(jìn)行深度挖掘、分析,從

    2024年02月07日
    瀏覽(23)
  • 構(gòu)建數(shù)字工廠丨數(shù)據(jù)分析與圖表視圖模型的配置用法

    摘要: 本期結(jié)合示例,詳細(xì)介紹華為云數(shù)字工廠平臺(tái)的數(shù)據(jù)分析模型和數(shù)據(jù)圖表視圖模型的配置用法。 本文分享自華為云社區(qū)《數(shù)字工廠深入淺出系列(六):數(shù)據(jù)分析與圖表視圖模型的配置用法》,作者:云起MAE 。 華為云數(shù)字工廠平臺(tái)基于“數(shù)據(jù)與業(yè)務(wù)一體化”理念,提

    2024年02月11日
    瀏覽(16)
  • 數(shù)據(jù)分析基礎(chǔ)-Excel圖表的美化操作(按照教程一步步操作)

    數(shù)據(jù)分析基礎(chǔ)-Excel圖表的美化操作(按照教程一步步操作)

    包含月份和對(duì)應(yīng)的銷量和產(chǎn)量。 時(shí)間 銷量 產(chǎn)量 1月 60 72 2月 38 67 3月 28 34 4月 58 68 5月 67 59 6月 72 35 7月 61 42 8月 24 31 9月 55 67 10月 24 35 11月 12 21 12月 26 45 1、刪除多余元素 ? 2、弱化次要元素 ? 對(duì)于可以弱化的元素,應(yīng)盡量調(diào)整,使其不搶眼。 ?3、添加缺少的元素 ? ? ?4、調(diào)整

    2024年02月14日
    瀏覽(25)
  • 微博數(shù)據(jù)可視化分析:利用Python構(gòu)建信息圖表展示話題熱度

    微博數(shù)據(jù)可視化分析:利用Python構(gòu)建信息圖表展示話題熱度

    1. 引言 隨著社交媒體的迅速發(fā)展,微博已成為人們交流觀點(diǎn)、表達(dá)情感的重要平臺(tái)之一。微博評(píng)論數(shù)據(jù)蘊(yùn)含著豐富的信息,通過(guò)對(duì)這些數(shù)據(jù)進(jìn)行分析和可視化,我們可以深入了解用戶對(duì)特定話題的關(guān)注程度和情感傾向。本文將介紹如何利用Python進(jìn)行微博評(píng)論數(shù)據(jù)的準(zhǔn)備、探索

    2024年02月20日
    瀏覽(35)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包