欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue echarts實(shí)現(xiàn)柱狀圖動(dòng)態(tài)展示

 更新時(shí)間:2021年09月05日 16:43:23   作者:咖啡有點(diǎn)酷  
這篇文章主要為大家詳細(xì)介紹了vue echarts實(shí)現(xiàn)柱狀圖動(dòng)態(tài)展示,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue echarts實(shí)現(xiàn)柱狀圖動(dòng)態(tài)展示的具體代碼,供大家參考,具體內(nèi)容如下

輪播圖形式展現(xiàn)

<template>
  <div class="dan">
    <div id="scalesize" :style="{width: '100%', height: '100%'}"></div>
  </div>
</template>
<script>
import echarts from "echarts";
export default {
  data() {
    return {
      texts: 111
    };
  },
  mounted() {
    this.drawLine();
  },
  methods: {
    drawLine() {
      // 基于準(zhǔn)備好的dom,初始化echarts實(shí)例
      let myChart = this.$echarts.init(document.getElementById("scalesize"));
      var fanfa = [
        {
          name: "育苗基地",
          type: "bar",
          barWidth: "15%",
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#fccb05"
                },
                {
                  offset: 1,
                  color: "#f5804d"
                }
              ]),
              barBorderRadius: 12
            }
          },
          data: [100, 120, 160, 180, 220, 400]
        },
        {
          name: "種植基地",
          type: "bar",
          barWidth: "15%",
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#8bd46e"
                },
                {
                  offset: 1,
                  color: "#09bcb7"
                }
              ]),
              barBorderRadius: 11
            }
          },
          data: [270, 320, 420, 650, 821,907]
        },
        {
          name: "托管面積",
          type: "bar",
          barWidth: "15%",
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#248ff7"
                },
                {
                  offset: 1,
                  color: "#6851f1"
                }
              ]),
              barBorderRadius: 11
            }
          },
          data: [140, 180, 215, 320, 396, 520]
        },
        {
          name: "聯(lián)建基地",
          type: "bar",
          barWidth: "15%",
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#B88080"
                },
                {
                  offset: 1,
                  color: "#983A3A"
                }
              ]),
              barBorderRadius: 11
            }
          },
          data: [140, 180, 215, 320, 396, 420]
        }
      ];
      myChart.setOption({
        tooltip: {
          trigger: "axis",
          axisPointer: {
            // 坐標(biāo)軸指示器,坐標(biāo)軸觸發(fā)有效
            type: "shadow" // 默認(rèn)為直線,可選為:'line' | 'shadow'
          }
        },
        grid: {
          left: "2%",
          right: "4%",
          bottom: "14%",
          top: "16%",
          containLabel: true
        },
        legend: {
          data: ["育苗基地", "種植基地", "托管面積", "聯(lián)建基地"],
          right: 10,
          top: 12,
          textStyle: {
            color: "#fff"
          },
          itemWidth: 12,
          itemHeight: 10
          // itemGap: 35
        },
        xAxis: {
          type: "category",
          data: [
            "2014",
            "2015",
            "2016",
            "2017",
            "2018",
            "2019"
          ],
          axisLine: {
            lineStyle: {
              color: "white"
            }
          },
          axisLabel: {
            // interval: 0,
            // rotate: 40,
            textStyle: {
              fontFamily: "Microsoft YaHei"
            }
          }
        },
        yAxis: {
          type: "value",
          axisLine: {
            show: false,
            lineStyle: {
              color: "white"
            }
          },
          splitLine: {
            show: true,
            lineStyle: {
              color: "rgba(255,255,255,0.3)"
            }
          },
          axisLabel: {}
        },
        dataZoom: [
          {
            show: true,
            height: 12,
            xAxisIndex: [0],
            bottom: "8%",
            handleIcon:
              "path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z",
            handleSize: "110%",
            handleStyle: {
              color: "#d3dee5"
            },
            textStyle: {
              color: "#fff"
            },
            borderColor: "#90979c"
          },
          {
            type: "inside",
            show: true,
            height: 15,
            start: 1,
            end: 35
          }
        ],
        series: fanfa
      });
      let app = {
        currentIndex: -1
      };
      setInterval(function() {
        let dataLen = fanfa[1].data.length;
        // 取消之前高亮的圖形
        myChart.dispatchAction({
          type: "downplay",
          seriesIndex: 0,
          dataIndex: app.currentIndex
        });
        app.currentIndex = (app.currentIndex + 1) % dataLen;
        //console.log(app.currentIndex);
        // 高亮當(dāng)前圖形
        myChart.dispatchAction({
          type: "highlight",
          seriesIndex: 0,
          dataIndex: app.currentIndex
        });
        // 顯示 tooltip
        myChart.dispatchAction({
          type: "showTip",
          seriesIndex: 0,
          dataIndex: app.currentIndex
        });
      }, 1000);
      window.onresize = myChart.resize;
    }
  }
};
</script>
<style lang="less" scoped>
.dan {
  height: 90%;
}
</style>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue2.0 element-ui中el-select選擇器無(wú)法顯示選中的內(nèi)容(解決方法)

    vue2.0 element-ui中el-select選擇器無(wú)法顯示選中的內(nèi)容(解決方法)

    這篇文章主要介紹了vue2.0 element-ui中的el-select選擇器無(wú)法顯示選中的內(nèi)容,在文中小編使用的是element-ui V2.2.3。具體解決方法及示例代碼大家參考下本文
    2018-08-08
  • 快速了解vue-cli 3.0 新特性

    快速了解vue-cli 3.0 新特性

    vue-cli 是 vue 官方團(tuán)隊(duì)推出的一款快速開發(fā) vue 項(xiàng)目的構(gòu)建工具,具有開箱即用并且提供簡(jiǎn)潔的自定義配置等功能。這篇文章主要介紹了快速了解vue-cli 3.0 新特性,需要的朋友可以參考下
    2018-02-02
  • element日期選擇器el-date-picker樣式圖文詳解

    element日期選擇器el-date-picker樣式圖文詳解

    最近寫的項(xiàng)目里面有一個(gè)功能是日期選擇功能,第一反應(yīng)是使用element里面的el-date-picker組件,下面這篇文章主要給大家介紹了關(guān)于element日期選擇器el-date-picker樣式的相關(guān)資料,需要的朋友可以參考下
    2022-09-09
  • 解決vue項(xiàng)目運(yùn)行出現(xiàn)warnings?potentially?fixable?with?the?`--fix`?option的報(bào)錯(cuò)問題

    解決vue項(xiàng)目運(yùn)行出現(xiàn)warnings?potentially?fixable?with?the?`--fix

    這篇文章主要介紹了解決vue項(xiàng)目運(yùn)行出現(xiàn)warnings?potentially?fixable?with?the?`--fix`?option的報(bào)錯(cuò)問題,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧
    2021-11-11
  • vue項(xiàng)目中?jsconfig.json概念及使用步驟

    vue項(xiàng)目中?jsconfig.json概念及使用步驟

    這篇文章主要介紹了vue項(xiàng)目中?jsconfig.json是什么,本文僅僅簡(jiǎn)單介紹了?jsconfig?.json?的一些基本配置,而?jsconfig?.json提供了大量能使我們快速便捷提高代碼效率的方法,需要的朋友可以參考下
    2022-07-07
  • vue3.0中使用element的完整步驟

    vue3.0中使用element的完整步驟

    這篇文章主要給大家介紹了關(guān)于vue3.0中使用element的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-03-03
  • vue.js利用Object.defineProperty實(shí)現(xiàn)雙向綁定

    vue.js利用Object.defineProperty實(shí)現(xiàn)雙向綁定

    這篇文章主要為大家詳細(xì)介紹了vue.js利用Object.defineProperty實(shí)現(xiàn)雙向綁定,幫大家解析神秘的Object.defineProperty方法
    2017-03-03
  • vue.js學(xué)習(xí)之UI組件開發(fā)教程

    vue.js學(xué)習(xí)之UI組件開發(fā)教程

    前端開發(fā)中,隨著業(yè)務(wù)的增多,出于效率的考慮,我們對(duì)于組件化開發(fā)的需求也越來(lái)越迫切。下面這篇文章主要給大家介紹了關(guān)于vue.js之UI組件開發(fā)的相關(guān)資料,文中介紹的非常詳細(xì),需要的朋友們下面來(lái)一起看看吧。
    2017-07-07
  • vue中安裝使用cesium方式(親測(cè)可用)

    vue中安裝使用cesium方式(親測(cè)可用)

    這篇文章主要介紹了vue中安裝使用cesium方式(親測(cè)可用),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-04-04
  • vue插件及修改ip啟動(dòng)端口解析

    vue插件及修改ip啟動(dòng)端口解析

    這篇文章主要為大家介紹了vue插件及修改ip啟動(dòng)端口的解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步早日升職加薪
    2022-04-04

最新評(píng)論