zoukankan      html  css  js  c++  java
  • ECharts 地图实现

    ECharts 地图实现

      var myChart = echarts.init(document.getElementById('jyyddt_echarts'));
        myChart.showLoading();

      //$.get第一个参数,引入json文件 $.get('../../statics/jslib/echarts/json/jilin.json', function (geoJson) { myChart.hideLoading(); echarts.registerMap('jilin', geoJson); myChart.setOption(option = { title: { text: '吉林各地市州', subtext: '副标题', textStyle: {//主标题文本样式 fontSize: 40 }, subtextStyle: {//副标题文本样式 fontSize: 20 } }, geo: { map: 'jilin', // roam: true, //是否支持拖动 itemStyle: { normal: { borderColor: '#4b9b9c', borderWidth: 6 //设置外层边框 } } }, series: [ { type: 'map', // roam: true, //是否支持拖动 mapType: 'jilin', geoIndex: 1, aspectScale: 0.75, //长宽比 showLegendSymbol: false, // 存在legend时显示 label: { normal: { show: true, textStyle: { fontSize: 22, color: '#333' } }, emphasis: {//对应的鼠标悬浮效果 show: true, textStyle: { fontSize: 30, color: "#333" } } }, itemStyle: { normal: { label: { show: true }, borderWidth: 1 } }, data: [ { name: '长春市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#3496c2', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '吉林市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#65a16f', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '四平市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#3496c2', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '辽源市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#3496c2', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '通化市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#65a16f', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '白山市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#65a16f', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '松原市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#3496c2', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '白城市', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#3496c2', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } }, { name: '延边朝鲜族自治州', itemStyle: { normal: { // areaColor: 'rgba(0,0,0,0)', borderColor: '#65a16f', borderWidth: 1 }, emphasis: { areaColor: 'rgba(0,0,0,0)', borderWidth: 3 } } } ] } ] }); });

      

  • 相关阅读:
    MARKY一下。
    从一个git仓库拷贝到另一个git仓库
    Git:四、连接GitHub远程仓库
    木门工厂木门、门套、套线公式和算法
    设计模式之代理模式
    2018年软件开发状态报告
    产品研发流程与周期(非原创)
    软件工程师的核心竞争力
    linux下安装redis安装使用
    8 个 Tips 让你更好的进行 Code Review
  • 原文地址:https://www.cnblogs.com/Michelle20180227/p/12539847.html
Copyright © 2011-2022 走看看