日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

echarts地图的基本使用配置

發(fā)布時間:2023/12/10 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 echarts地图的基本使用配置 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一、空氣質(zhì)量圖

代碼和配置如下:

<template><div class="box"><div id="map"></div></div> </template><script>import china from 'echarts/map/js/china.js' export default {data(){return {}},mounted(){this.mapFn()},methods:{mapFn(){// 基于準(zhǔn)備好的dom,初始化echarts實(shí)例var mapChart = this.$echarts.init(document.getElementById('map'));mapChart.setOption({backgroundColor: '#404a59', //背景顏色title: {text: '全國主要城市空氣質(zhì)量',subtext: 'data from PM25.in',sublink: 'http://www.pm25.in',x:'center',},legend: { //圖例組件。orient: 'vertical',y: 'bottom',x:'right',data:['pm2.5'],textStyle: {color: '#fff'}},//是視覺映射組件,用于進(jìn)行『視覺編碼』,也就是將數(shù)據(jù)映射到視覺元素(視覺通道)。visualMap: {min: 0, //最小值max: 600, //最大值calculable: true, //是否顯示拖拽用的手柄(手柄能拖拽調(diào)整選中范圍)。inRange: {color: ['#4cb0dd', '#2d79ad', '#265da0'] //顏色},textStyle: {color: '#fff'},},// 提示框,鼠標(biāo)移入tooltip:{show:true, //鼠標(biāo)移入是否觸發(fā)數(shù)據(jù)trigger: 'item', //出發(fā)方式formatter:'{b}-銷售數(shù)量:{c}'},//配置地圖的數(shù)據(jù),并且顯示series:[{name:'地圖',type: 'map', //地圖種類map: 'china', //地圖類型。data:[{name: '北京',value: Math.round(Math.random()*500)},{name: '天津',value: Math.round(Math.random()*500)},{name: '上海',value: Math.round(Math.random()*500)},{name: '重慶',value: Math.round(Math.random()*500)},{name: '河北',value: Math.round(Math.random()*500)},{name: '河南',value: Math.round(Math.random()*500)},{name: '云南',value: Math.round(Math.random()*500)},{name: '遼寧',value: Math.round(Math.random()*500)},{name: '黑龍江',value: Math.round(Math.random()*500)},{name: '湖南',value: Math.round(Math.random()*500)},{name: '安徽',value: Math.round(Math.random()*500)},{name: '山東',value: Math.round(Math.random()*500)},{name: '新疆',value: Math.round(Math.random()*500)},{name: '江蘇',value: Math.round(Math.random()*500)},{name: '浙江',value: Math.round(Math.random()*500)},{name: '江西',value: Math.round(Math.random()*500)},{name: '湖北',value: Math.round(Math.random()*500)},{name: '廣西',value: Math.round(Math.random()*500)},{name: '甘肅',value: Math.round(Math.random()*500)},{name: '山西',value: Math.round(Math.random()*500)},{name: '內(nèi)蒙古',value: Math.round(Math.random()*500)},{name: '陜西',value: Math.round(Math.random()*500)},{name: '吉林',value: Math.round(Math.random()*500)},{name: '福建',value: Math.round(Math.random()*500)},{name: '貴州',value: Math.round(Math.random()*500)},{name: '廣東',value: Math.round(Math.random()*500)},{name: '青海',value: Math.round(Math.random()*500)},{name: '西藏',value: Math.round(Math.random()*500)},{name: '四川',value: Math.round(Math.random()*500)},{name: '寧夏',value: Math.round(Math.random()*500)},{name: '海南',value: Math.round(Math.random()*500)},{name: '臺灣',value: Math.round(Math.random()*500)},{name: '香港',value: Math.round(Math.random()*500)},{name: '澳門',value: Math.round(Math.random()*500)},{name: '南海諸島',value: Math.round(Math.random()*500)}],itemStyle: { //地圖區(qū)域的多邊形 圖形樣式。emphasis:{ //高亮狀態(tài)下的樣試label:{show:true,}}},zoom:1,//放大比例label: { //圖形上的文本標(biāo)簽,可用于說明圖形的一些數(shù)據(jù)信息show:true,},},{type:'scatter',showEffectOn: 'render',//配置什么時候顯示特效coordinateSystem:'geo',//該系列使用的坐標(biāo)系symbolSize:10,//標(biāo)記的大小data:[{name: '宜昌', value: [111.3,30.7,130]},],zlevel:99999},]})}} } </script><style scoped> .box{margin-top:20px; } #map{width:1200px;height:720px; } </style>

 

二、散點(diǎn)圖。geo

代碼和配置:

<template><div class="box"><div id="chart"></div></div> </template><script> import china from 'echarts/map/js/china.js' export default {mounted(){this.mYChart()},methods:{mYChart(){var mapChart = this.$echarts.init(document.getElementById('chart'));mapChart.setOption({backgroundColor: '#404a59',title: {text: '主標(biāo)題',subtext: '副標(biāo)題',sublink: 'http://www.pm25.in',left: 'center'},//地理坐標(biāo)系組件用于地圖的繪制,支持在地理坐標(biāo)系上繪制散點(diǎn)圖,線集。//要顯示散點(diǎn)圖,必須填寫這個配置geo:{show:true,roam: true, //是否允許鼠標(biāo)滾動放大,縮小map:'china',label: { //圖形上的文本標(biāo)簽,可用于說明圖形的一些數(shù)據(jù)信息show:true, //是否顯示文本color:'#CCC', //文本顏色},itemStyle: { //地圖區(qū)域的多邊形 圖形樣式。 默認(rèn)樣試。areaColor: '#323c48', //地圖區(qū)域的顏色。borderColor: '#111', //邊框線},emphasis:{ //高亮狀態(tài)下的多邊形和標(biāo)簽樣式。label:{ //文本color: '#ADA',},itemStyle:{ //區(qū)域areaColor: '#F60'}},data:[{name: '北京',value: Math.round(Math.random()*500)},{name: '天津',value: Math.round(Math.random()*500)},{name: '上海',value: Math.round(Math.random()*500)},{name: '重慶',value: Math.round(Math.random()*500)},{name: '河北',value: Math.round(Math.random()*500)},{name: '河南',value: Math.round(Math.random()*500)},{name: '云南',value: Math.round(Math.random()*500)},{name: '遼寧',value: Math.round(Math.random()*500)},{name: '黑龍江',value: Math.round(Math.random()*500)},{name: '湖南',value: Math.round(Math.random()*500)},{name: '安徽',value: Math.round(Math.random()*500)},{name: '山東',value: Math.round(Math.random()*500)},{name: '新疆',value: Math.round(Math.random()*500)},{name: '江蘇',value: Math.round(Math.random()*500)},{name: '浙江',value: Math.round(Math.random()*500)},{name: '江西',value: Math.round(Math.random()*500)},{name: '湖北',value: Math.round(Math.random()*500)},{name: '廣西',value: Math.round(Math.random()*500)},{name: '甘肅',value: Math.round(Math.random()*500)},{name: '山西',value: Math.round(Math.random()*500)},{name: '內(nèi)蒙古',value: Math.round(Math.random()*500)},{name: '陜西',value: Math.round(Math.random()*500)},{name: '吉林',value: Math.round(Math.random()*500)},{name: '福建',value: Math.round(Math.random()*500)},{name: '貴州',value: Math.round(Math.random()*500)},{name: '廣東',value: Math.round(Math.random()*500)},{name: '青海',value: Math.round(Math.random()*500)},{name: '西藏',value: Math.round(Math.random()*500)},{name: '四川',value: Math.round(Math.random()*500)},{name: '寧夏',value: Math.round(Math.random()*500)},{name: '海南',value: Math.round(Math.random()*500)},{name: '臺灣',value: Math.round(Math.random()*500)},{name: '香港',value: Math.round(Math.random()*500)},{name: '澳門',value: Math.round(Math.random()*500)},{name: '南海諸島',value: Math.round(Math.random()*500)}],},tooltip:{show:true,},//是視覺映射組件,用于進(jìn)行『視覺編碼』,也就是將數(shù)據(jù)映射到視覺元素(視覺通道)。visualMap: {min: 0, //最小值max: 600, //最大值calculable: true, //是否顯示拖拽用的手柄(手柄能拖拽調(diào)整選中范圍)。inRange: {color: ['#e83e5e','#fb2a08', '#d6f628'] //顏色},textStyle: {color: '#fff'},},series:[{type:'effectScatter', //樣試coordinateSystem:'geo', //該系列使用的坐標(biāo)系data:[ //數(shù)據(jù){name: '宜昌', value: [111.3,30.7,330]},{name: '信陽', value: [114.089435,32.167686,440]},{name: '北京', value: [116.422586,39.921549,560]}],itemStyle: { //樣試。normal:{ //默認(rèn)樣試color: '#d6f628' }},label: {normal: {formatter: '{b}',position: 'right',show: true}},//標(biāo)記的大小,可以設(shè)置數(shù)組或者函數(shù)返回值的形式symbolSize: function (val) {return val[2] / 25;}, rippleEffect: { //漣漪特效相關(guān)配置。brushType: 'stroke' //波紋的繪制方式},hoverAnimation: true, //鼠標(biāo)移入放大圓}]}),mapChart.on('click',function(data){console.log(data)})}} } </script><style scoped> .box{margin-top:30px; } #chart{width: 1000px;height: 620px; } </style>

 

三、vue里面使用。bmap 百度地圖

<template><div class="bxo"><div id="bmap"></div></div> </template><script> import bmap from 'echarts/extension/bmap/bmap.js' export default {data(){return{}},mounted(){this.bmapFn()console.log("加載")}, methods:{bmapFn(){var mapChart = this.$echarts.init(document.getElementById('bmap'));mapChart.setOption({title:{text:'地圖s'},bmap: {center: [116.307698, 40.056975], // 中心位置坐標(biāo)zoom: 5, // 地圖縮放比例roam: true, // 開啟用戶縮放mapStyle: {styleJson: [{ //地圖樣試'featureType': 'water','elementType': 'all','stylers': {'color': '#d1d1d1'}}, {'featureType': 'land','elementType': 'all','stylers': {'color': '#f3f3f3'}}, {'featureType': 'railway','elementType': 'all','stylers': {'visibility': 'off'}}, {'featureType': 'highway','elementType': 'all','stylers': {'color': '#fdfdfd'}}, {'featureType': 'highway','elementType': 'labels','stylers': {'visibility': 'off'}}, {'featureType': 'arterial','elementType': 'geometry','stylers': {'color': '#fefefe'}}, {'featureType': 'arterial','elementType': 'geometry.fill','stylers': {'color': '#fefefe'}}, {'featureType': 'poi','elementType': 'all','stylers': {'visibility': 'off'}}, {'featureType': 'green','elementType': 'all','stylers': {'visibility': 'off'}}, {'featureType': 'subway','elementType': 'all','stylers': {'visibility': 'off'}}, {'featureType': 'manmade','elementType': 'all','stylers': {'color': '#d1d1d1'}}, {'featureType': 'local','elementType': 'all','stylers': {'color': '#d1d1d1'}}, {'featureType': 'arterial','elementType': 'labels','stylers': {'visibility': 'off'}}, {'featureType': 'boundary','elementType': 'all','stylers': {'color': '#fefefe'}}, {'featureType': 'building','elementType': 'all','stylers': {'color': '#d1d1d1'}}, {'featureType': 'label','elementType': 'labels.text.fill','stylers': {'color': '#999999'}}]}}})}} } </script><style scoped> .box{margin-top:20px; } #bmap{width: 1000px;height: 620px; } </style>

  

轉(zhuǎn)載于:https://www.cnblogs.com/chengxiang123/p/10108062.html

總結(jié)

以上是生活随笔為你收集整理的echarts地图的基本使用配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 丰满人妻熟妇乱偷人无码 | 中文字幕欧美专区 | 91日日| 日韩欧美大陆 | 丝袜诱惑一区二区 | 最近中文字幕在线观看 | 黄色精品在线观看 | 久操亚洲 | 性欧美18一19内谢 | 综合久久久久久 | 美日韩在线视频 | 亚洲一区二区精品在线 | 粉嫩av懂色av蜜臀av分享 | 成年人黄色大全 | 精品视频一二三 | 午夜爱爱网站 | 国产无码日韩精品 | 精品少妇3p| 相亲对象是问题学生动漫免费观看 | 小视频在线免费观看 | 男生和女生差差的视频 | 国产精品96久久久久久 | 亚洲天堂网在线视频 | 国产91色在线 | 青青免费视频 | 一本色道久久hezyo无码 | 在线岛国| 97超碰人人模人人人爽人人爱 | 国产麻豆天美果冻无码视频 | 国产精品短视频 | 欧美视频一区二区在线观看 | 青青青在线 | 欧美国产日韩一区二区三区 | av网站黄色 | 影音先锋精品 | 国产丝袜美腿一区二区三区 | 亚州av在线播放 | 亚洲精品一品 | 国产精品一区一区三区 | 乳色吐息在线看 | 男女无套免费视频网站动漫 | 日韩一级伦理片 | 国产精品三级视频 | 另一种灿烂生活 | 91av手机在线 | 激情久久久久久久 | 初高中福利视频网站 | 日韩精品免费视频 | 嘿咻视频在线观看 | 在线香蕉视频 | 亚洲国产高清在线 | 国产一区欧美日韩 | 欧美黑人又粗又大高潮喷水 | 欧美日韩视频在线观看一区 | 天堂一区在线观看 | 伊人亚洲影院 | 日韩国产欧美精品 | 五月婷婷激情综合网 | av观看网站 | 三级视频黄色 | 被绑在床强摁做开腿呻吟 | 中文字幕三级视频 | 爱爱动态图 | 亚洲免费高清视频 | 射射射综合网 | 91av免费看| 国产精品成人免费 | 日本两性视频 | 丁香六月综合 | 午夜两性视频 | 久久午夜激情 | 久久亚洲少妇 | 久久天天东北熟女毛茸茸 | 天天色天天爱 | 日本青青草 | 亚洲精品www久久久久久广东 | 97精品人人a片免费看 | 天堂在线| 原来神马电影免费高清完整版动漫 | 欧美激情影院 | 欧美在线一二 | 国产欧美一区二区三区精华液好吗 | 伦理片一区二区 | 日韩天堂av| 超碰在线亚洲 | 视频在线免费观看 | 国产视频www | 张柏芝亚洲一区二区三区 | 韩国午夜av | 婷婷色婷婷 | 五月婷综合网 | 男女网站视频 | 美女高潮黄又色高清视频免费 | 黄黄的网站 | 福利片在线观看 | 欧美丰满老熟妇xxxxx性 | 久久久久久久久久久国产 | 欧美巨乳在线 | 国产免费又黄又爽又色毛 |