Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the function of selecting and displaying seats in engine Room by Vue ECharts

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces Vue ECharts how to achieve cabin seat selection display function related knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that after reading this Vue ECharts how to achieve engine room seat selection display function article will have a harvest, let's take a look.

Var ROOT_PATH = 'https://cdn.jsdelivr.net/gh/apache/echarts-website@asf-site/examples';var chartDom = document.getElementById (' main'); var myChart = echarts.init (chartDom); var option;$.get (ROOT_PATH +'/ data/asset/geo/flight-seats.svg', function (svg) {echarts.registerMap ('flight-seats', {svg: svg})) Const takenSeatNames = ['26E', '26D', '26C', '25D', '23C', '21A', '20F'] Option = {tooltip: {}, geo: {map: 'flight-seats', roam: true, selectedMode:' multiple', layoutCenter: ['50%,'50%], layoutSize:'95%, tooltip: {show: true}, itemStyle: {color:'# fff'} Emphasis: {itemStyle: {color: undefined, borderColor: 'green', borderWidth: 2}, label: {show: false}}, select: {itemStyle: {color:' green'}, label: {show: false TextBorderColor:'# fff', textBorderWidth: 2}}, regions: makeTakenRegions (takenSeatNames)}} Function makeTakenRegions (takenSeatNames) {var regions = []; for (var I = 0; I

< takenSeatNames.length; i++) { regions.push({ name: takenSeatNames[i], silent: true, itemStyle: { color: '#bf0e08' }, emphasis: { itemStyle: { borderColor: '#aaa', borderWidth: 1 } }, select: { itemStyle: { color: '#bf0e08' } } }); } return regions; } myChart.setOption(option); // Get selected seats. myChart.on('geoselectchanged', function (params) { const selectedNames = params.allSelected[0].name.slice(); // Remove taken seats. for (var i = selectedNames.length - 1; i >

= 0; if -) {if (takenSeatNames.indexOf (selectedNams [I]) > = 0) {selectedNames.splice (I, 1);}} console.log ('selected', selectedNames);});}); option & & myChart.setOption (option); this is the end of the article on "how to realize the cabin seat selection and display function in Vue ECharts". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to achieve cabin seat selection and display function in Vue ECharts". If you want to learn more, you are welcome to follow the industry information channel.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report