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
Firewall A firewall is a set of rules. When a pac...
<br />Reading is a very important part of th...
1. First, prepare VS2019 and MySQL database. Both...
Table of contents Block-level functions Directly ...
Case 1: Last submission and no push Execute the f...
Table of contents rc.local method chkconfig metho...
Table of contents 1. What is a template string? 2...
Page domain relationship: The main page a.html bel...
In summary: 1. Consider performance when designin...
Table of contents Overview Checking setTimeout() ...
Table of contents Introduction Four characteristi...
** Detailed graphic instructions for installing y...
Redux is a data state management plug-in. When us...
A reader contacted me and asked why there were pr...
Table of contents Installation Steps Environment ...