In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the "bar chart dynamic effect code sharing realized by vue echarts". In the daily operation, I believe that many people have doubts about the bar chart dynamic effect code sharing realized by vue echarts. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "bar chart dynamic effect code sharing realized by vue echarts". Next, please follow the editor to study!
In this paper, an example is given to share the specific code of vue echarts to realize the dynamic display of histogram for your reference. The details are as follows.
Show in the form of roulette graph
Import echarts from "echarts"; export default {data () {return {texts: 111};}, mounted () {this.drawLine ();}, methods: {drawLine () {/ / based on the prepared dom, initialize echarts instance let myChart = this.$echarts.init (document.getElementById ("scalesize")) Var fanfa = [{name: "Seedling Base", 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: [100120160180220 Name: "planting Base", 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,821907]} {name: "managed area", 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: [140180215320396 {name: "Joint Base", 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: [140180215320396 420]}] MyChart.setOption ({tooltip: {trigger: "axis", axisPointer: {/ / axis indicator, axis trigger valid type: "shadow" / / defaults to straight line Optional: 'line' |' shadow'}}, grid: {left: "2%", right: "4%", bottom: "14%", top: "16%", containLabel: true}, legend: {data: ["Seedling Base", "planting Base" "hosting area", "Joint Construction Base"], 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", axisLabel: {} DataZoom: [{show: true, height: 12, xAxisIndex: [0], bottom: "8%", handleIcon: "path://M306.1413c0,2.2-1.8, 4, 4, 4, 59.8, 4, 4V200.8c0, 2.2, 4, 4, 8, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8, 4, 4, 8, 4, 4, 4, 8, 8, 4, 4V200.8c0, 4, 4, 4, 8, 8, 4, 4, 4, 4, 8, 8, 4, 4, 8, 8, 4, 4, 4, 4, 4, 4, 8, 8, 4, 4, 8, 8, 4, 4, 4, 4, 8, 8, 4, 4, 8, 8, 4, 4, 4, 8, 8, 4, 4, 4, 8, 8, 4, 4, 4, 8, 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; / / unhighlight myChart.dispatchAction ({type: "downplay", seriesIndex: 0, dataIndex: app.currentIndex}); app.currentIndex = (app.currentIndex + 1)% dataLen / / console.log (app.currentIndex); / / highlight the current drawing myChart.dispatchAction ({type: "highlight", seriesIndex: 0, dataIndex: app.currentIndex}); / / display tooltip myChart.dispatchAction ({type: "showTip", seriesIndex: 0, dataIndex: app.currentIndex}) }, 1000); _ window.onresize = myChart.resize;}; .dan {height: 90%;} at this point, the study on "code sharing of bar chart dynamic effects for vue echarts implementation" is over. I hope to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.