当前位置: 首页 > news >正文

2017网站建设报价方案免费特效素材网站

2017网站建设报价方案,免费特效素材网站,网站建设查看框架的源代码,ppt模板免费下载哪个网站好echarts地图的简单使用 文章说明核心源码效果展示源码下载 文章说明 主要介绍echarts地图组件的简单使用#xff0c;记录为文章#xff0c;供后续查阅使用 目前只是简单的示例#xff0c;然后还存在着一些小bug#xff0c;主要是首个Legend的点击会导致颜色全部不展示的问题… echarts地图的简单使用 文章说明核心源码效果展示源码下载 文章说明 主要介绍echarts地图组件的简单使用记录为文章供后续查阅使用 目前只是简单的示例然后还存在着一些小bug主要是首个Legend的点击会导致颜色全部不展示的问题以及世界地图的区域展示有一些小问题等待后续完善 核心源码 地图绘制组件 script setup import * as echarts from echarts; import china from /assets/china.json; import world from /assets/world.json; import {onBeforeMount, onMounted, reactive} from vue; import {getAreaList} from /assets/getAreaList; import {calculateColor} from /util;const data reactive({mapName: china,chinaAreaList: [],selectedChinaAreaList: [],worldAreaList: [],selectedWorldAreaList: [], });onBeforeMount(() {const {chinaAreaList, worldAreaList} getAreaList();data.chinaAreaList chinaAreaList;data.worldAreaList worldAreaList; });const mapList [{name: china,data: china,},{name: world,data: world,} ];let myChart;onMounted(() {for (let i 0; i mapList.length; i) {echarts.registerMap(mapList[i].name, mapList[i].data);}const chartDom document.getElementById(basic-chart);myChart echarts.init(chartDom);setOption();window.onresize () {myChart.resize();}; });const mapNameMap {china: 中国地图,world: 世界地图, }let min 0; let max 10000; let selectedAreaDataList [];function setOption() {let selectedAreaList [];if (data.mapName china) {selectedAreaList data.selectedChinaAreaList;} else if (data.mapName world) {selectedAreaList data.selectedWorldAreaList;}const series [];const colors [];const notSortArray [];for (let i 0; i selectedAreaList.length; i) {let selectedAreaData;for (let j 0; j selectedAreaDataList.length; j) {if (selectedAreaDataList[j].name selectedAreaList[i]) {selectedAreaData selectedAreaDataList[j];break;}}let value;if (selectedAreaData) {value selectedAreaData.value;} else {value Math.ceil(Math.random() * max);selectedAreaDataList.push({value: value,name: selectedAreaList[i],});}notSortArray.push({value: value,name: selectedAreaList[i],});}notSortArray.sort(function (o1, o2) {return o1.value - o2.value;});if (!notSortArray.length) {colors.push(#ffffff, #000000);}const legendNames [];for (let i 0; i notSortArray.length; i) {const color calculateColor(notSortArray[i].value, min, max);colors.push(color);const seriesItem {name: notSortArray[i].name,type: map,geoIndex: 0,data: [{name: notSortArray[i].name,value: notSortArray[i].value}],color: color,};series.push(seriesItem);legendNames.push(notSortArray[i].name);}myChart.setOption({title: {text: mapNameMap[data.mapName],left: center,},geo: {map: data.mapName,label: {show: false,},},legend: {orient: vertical,bottom: 50px,left: 50px,itemHeight: 10,itemWidth: 30,textStyle: {fontSize: 12,rich: {a: {verticalAlign: middle,},},padding: [2, 0, 0, 0],},data: legendNames},series: series,visualMap: {left: right,min: min,max: max,inRange: {color: colors},text: [High, Low],calculable: true},toolbox: {show: true,feature: {saveAsImage: {show: true}}},}, true); } /scripttemplatediv classcontainerdiv styleheight: 6rem; display: flex; align-items: center; justify-content: centerel-select v-modeldata.mapName stylewidth: 10rem; margin-right: 2rem changesetOptionel-option label中国地图 valuechina/el-option label世界地图 valueworld//el-selectel-select v-showdata.mapName china v-modeldata.selectedChinaAreaList collapse-tagscollapse-tags-tooltip filterable multiple placeholder请选择地区 stylewidth: 30remchangesetOptiontemplate v-foritem in data.chinaAreaList :keyitem.idel-option :labelitem.name :valueitem.name//template/el-selectel-select v-showdata.mapName world v-modeldata.selectedWorldAreaList collapse-tagscollapse-tags-tooltip filterable multiple placeholder请选择地区 stylewidth: 30remchangesetOptiontemplate v-foritem in data.worldAreaList :keyitem.idel-option :labelitem.name :valueitem.name//template/el-select/divdiv styleflex: 1div idbasic-chart classchart/div/div/div /templatestyle langscss * {margin: 0;padding: 0;box-sizing: border-box; }.container {width: 100vw;height: 100vh;display: flex;flex-direction: column; }.chart {width: 100%;height: 100%; } /style根据值生成颜色的工具函数 function hsvToRgb(h, s, v) {const f n {const k (n h / 60) % 6;return v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);};return [Math.round(f(5) * 255),Math.round(f(3) * 255),Math.round(f(1) * 255)]; }export function calculateColor(value, minValue, maxValue) {value Math.max(minValue, Math.min(maxValue, value));const factor (value - minValue) / (maxValue - minValue);const hue (factor * 360) % 360;const saturation 1 - factor;const valueV 1;const [r, g, b] hsvToRgb(hue, saturation, valueV);return rgb(${r}, ${g}, ${b}); }地图数据的下载可以在该网站下载较为全面的中国地图的数据DataV.GeoAtlas地理小工具系列 效果展示 中国地图 世界地图 源码下载 echarts地图组件的基本使用
文章转载自:
http://www.morning.bnrnb.cn.gov.cn.bnrnb.cn
http://www.morning.tqsgt.cn.gov.cn.tqsgt.cn
http://www.morning.vvdifactory.com.gov.cn.vvdifactory.com
http://www.morning.sbdqy.cn.gov.cn.sbdqy.cn
http://www.morning.mprtj.cn.gov.cn.mprtj.cn
http://www.morning.slnz.cn.gov.cn.slnz.cn
http://www.morning.gqcd.cn.gov.cn.gqcd.cn
http://www.morning.zkqjz.cn.gov.cn.zkqjz.cn
http://www.morning.gzzxlp.com.gov.cn.gzzxlp.com
http://www.morning.xxzjb.cn.gov.cn.xxzjb.cn
http://www.morning.bqdpy.cn.gov.cn.bqdpy.cn
http://www.morning.twdkt.cn.gov.cn.twdkt.cn
http://www.morning.yhxhq.cn.gov.cn.yhxhq.cn
http://www.morning.jjmrx.cn.gov.cn.jjmrx.cn
http://www.morning.dsmwy.cn.gov.cn.dsmwy.cn
http://www.morning.xnqjs.cn.gov.cn.xnqjs.cn
http://www.morning.kjgrg.cn.gov.cn.kjgrg.cn
http://www.morning.cwrnr.cn.gov.cn.cwrnr.cn
http://www.morning.nnrqg.cn.gov.cn.nnrqg.cn
http://www.morning.jpydf.cn.gov.cn.jpydf.cn
http://www.morning.rwmp.cn.gov.cn.rwmp.cn
http://www.morning.jqbpn.cn.gov.cn.jqbpn.cn
http://www.morning.pmlgr.cn.gov.cn.pmlgr.cn
http://www.morning.rtjhw.cn.gov.cn.rtjhw.cn
http://www.morning.zrgx.cn.gov.cn.zrgx.cn
http://www.morning.wrwcf.cn.gov.cn.wrwcf.cn
http://www.morning.ytmx.cn.gov.cn.ytmx.cn
http://www.morning.npbnc.cn.gov.cn.npbnc.cn
http://www.morning.rfljb.cn.gov.cn.rfljb.cn
http://www.morning.pmghz.cn.gov.cn.pmghz.cn
http://www.morning.jwrcz.cn.gov.cn.jwrcz.cn
http://www.morning.rkqzx.cn.gov.cn.rkqzx.cn
http://www.morning.mfnjk.cn.gov.cn.mfnjk.cn
http://www.morning.kggxj.cn.gov.cn.kggxj.cn
http://www.morning.qbzdj.cn.gov.cn.qbzdj.cn
http://www.morning.mxbks.cn.gov.cn.mxbks.cn
http://www.morning.znrgq.cn.gov.cn.znrgq.cn
http://www.morning.yrbq.cn.gov.cn.yrbq.cn
http://www.morning.wfttq.cn.gov.cn.wfttq.cn
http://www.morning.qgjxy.cn.gov.cn.qgjxy.cn
http://www.morning.txnqh.cn.gov.cn.txnqh.cn
http://www.morning.nqmdc.cn.gov.cn.nqmdc.cn
http://www.morning.kmqwp.cn.gov.cn.kmqwp.cn
http://www.morning.xhwty.cn.gov.cn.xhwty.cn
http://www.morning.qzzmc.cn.gov.cn.qzzmc.cn
http://www.morning.cyyhy.cn.gov.cn.cyyhy.cn
http://www.morning.ygwyt.cn.gov.cn.ygwyt.cn
http://www.morning.lcwhn.cn.gov.cn.lcwhn.cn
http://www.morning.jrksk.cn.gov.cn.jrksk.cn
http://www.morning.yfzld.cn.gov.cn.yfzld.cn
http://www.morning.wdpt.cn.gov.cn.wdpt.cn
http://www.morning.hdwjb.cn.gov.cn.hdwjb.cn
http://www.morning.bbyqz.cn.gov.cn.bbyqz.cn
http://www.morning.gsjfn.cn.gov.cn.gsjfn.cn
http://www.morning.hbkkc.cn.gov.cn.hbkkc.cn
http://www.morning.lydtr.cn.gov.cn.lydtr.cn
http://www.morning.lpmdy.cn.gov.cn.lpmdy.cn
http://www.morning.bmbnc.cn.gov.cn.bmbnc.cn
http://www.morning.xbdrc.cn.gov.cn.xbdrc.cn
http://www.morning.qwdqq.cn.gov.cn.qwdqq.cn
http://www.morning.wanjia-sd.com.gov.cn.wanjia-sd.com
http://www.morning.hjlsll.com.gov.cn.hjlsll.com
http://www.morning.gychx.cn.gov.cn.gychx.cn
http://www.morning.pqqhl.cn.gov.cn.pqqhl.cn
http://www.morning.jfqpc.cn.gov.cn.jfqpc.cn
http://www.morning.lhztj.cn.gov.cn.lhztj.cn
http://www.morning.kqzxk.cn.gov.cn.kqzxk.cn
http://www.morning.wtrjq.cn.gov.cn.wtrjq.cn
http://www.morning.mbrbg.cn.gov.cn.mbrbg.cn
http://www.morning.lkhfm.cn.gov.cn.lkhfm.cn
http://www.morning.gnhsg.cn.gov.cn.gnhsg.cn
http://www.morning.mlhfr.cn.gov.cn.mlhfr.cn
http://www.morning.mkyny.cn.gov.cn.mkyny.cn
http://www.morning.bxbnf.cn.gov.cn.bxbnf.cn
http://www.morning.wdlyt.cn.gov.cn.wdlyt.cn
http://www.morning.qlkzl.cn.gov.cn.qlkzl.cn
http://www.morning.krbjb.cn.gov.cn.krbjb.cn
http://www.morning.wwklf.cn.gov.cn.wwklf.cn
http://www.morning.thpns.cn.gov.cn.thpns.cn
http://www.morning.ngkng.cn.gov.cn.ngkng.cn
http://www.tj-hxxt.cn/news/248694.html

相关文章:

  • 互联网站管理工作细则买外链
  • 外贸建站效果阿里云网站域名绑定
  • 网站开发负责人是什么职位wordpress注册的用户不是vip
  • 怎么开发手机网站微信页面设计网站
  • 头像设计制作网站wordpress+相亲主题
  • 顶尖网站设计代运营主要做什么
  • 爱站网长尾关键词思科网站建设配置站点dns服务
  • 乡村网站建设输入解析wordpress
  • 系统开发和网站开发济南高端网站建设价格
  • 杭州市做网站的公司小程序开发教程免费
  • 网站系统改教程义乌网站建设制作
  • 网站建设化学图片济南最新消息今天
  • 宁波网站推广电脑网站与手机的区别是什么
  • 福建省住房城乡和城乡建设厅网站网站模板颜色
  • 奉贤建设机械网站制作wordpress 文章内容
  • 长沙网站优化指导深圳网站开发公司
  • 单位建网站做网站需要买什么东西
  • 弹簧机 东莞网站建设人才招聘网站建设
  • 做网站空间和服务器的如何做设计网站页面设计
  • 上海网站开发有限公司好搜seo软件
  • 无锡网站seo报价天元建设集团有限公司单位性质
  • 烟台开发区住房和建设局网站展示型网站重点
  • 做go富集的网站江苏建设信息网
  • php网站后台模板下载删负面的网站
  • 网站建设方案说wordpress文章的使用
  • 网站换新域名怎么做类似知乎的网站
  • 阿里巴巴做实商网站的条件wordpress 修改文章
  • asp作业做购物网站代码网页界面制作步骤
  • 自己做的网站怎么维护自己的服务器 做网站
  • 贵州成品网站小白 宝塔 wordpress