This article shares the specific code of vue+echarts to realize the progress bar histogram for your reference. The specific content is as follows The effect diagram is as follows Code: <template> <div class="content-page"> <div class="tab-content"> <div id="myChart1"></div> </div> </div> </template> <script> import * as echarts from 'echarts'; export default { data() { return { option: { color: ["#157ef5"], // Set the color of the bar chart textStyle: { color: "#828282" }, tooltip: { trigger: "axis", axisPointer: type: "line" } }, grid: { left: "3%", right: "4%", bottom: "3%", containLabel: true }, xAxis: type: "value", // Set the x-axis to display several segments min: 0, max: 100, interval: 50, axisTick: { show: false }, axisLine: { lineStyle: color: "transparent" } } }, yAxis: { type: "category", data: ["Financial Revenue", "Headquarters Economy"], axisTick: { show: false }, axisLine: { lineStyle: color: "#e0e0e0" } }, inside: true, textStyle: { color: "#000" } }, series: [ { type: "bar", itemStyle: { color: "#f1f1f1", // Define the background color of the column borderRadius: [0, 10, 10, 0] // Define the rounded corners of the background column}, barGap: "-100%", //Important steps to set column overlap data: [100, 100], animation: false, // Turn off animation effect barWidth: "22px", // Set the column width}, { type: "bar", data: [65, 75], barWidth: "22px", barGap: "-100%", //Important steps to set column overlap itemStyle: { borderRadius:[0, 10, 10, 0], // Define the rounded corners of the column color: function(params) { var colorList = ['#3C90EB', '#B573F4', '#F9B341', '#F9B341', '#91c7ae']; return colorList[params.dataIndex] } }, } ] } } }, mounted() { this.getChartData(); }, methods: { getChartData() { let myChart1 = echarts.init(document.querySelector("#myChart1")); myChart1.setOption(this.option); // Set the chart initialization data setTimeout(function() { window.onresize = function() { myChart1.resize(); // The chart adapts to the window size}; }, 200); } } } </script> <style lang="less" scoped> #myChart1 { width: 600px; height: 400px; } </style> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to deploy Tencent Cloud Server from scratch
>>: Alibaba Cloud domain name and IP binding steps and methods
MySQL official website download address: https://...
When I was at work today, the business side asked...
Table of contents 1. Parent components and child ...
1. Environmental Preparation CentOS Linux release...
1. Normal background blur Code: <Style> htm...
Whether it is a corporate website, a personal blo...
Preface Recently, due to work reasons, I was work...
Later, I also added how to use Jupyter Notebook i...
Nginx hides version number In a production enviro...
Clicking to switch pictures is very common in lif...
Table of contents Zabbix monitors Nginx Zabbix mo...
This rookie encountered such a problem when he ju...
Table of contents Observer Pattern Vue pass value...
I searched on Baidu. . Some people say to use the...
Table of contents 1. What is the use of provide/i...