其他分享
首页 > 其他分享> > echarts不同图表的配置项解释【2】

echarts不同图表的配置项解释【2】

作者:互联网

地图

配置项

const myChart = echarts.init(document.querySelector(".demo"));
     //  1. 加载地图矢量数据
     $.getJSON(
       "https://geo.datav.aliyun.com/areas_v3/bound/220000_full.json",
       (res) => {
         // 2. 往全局echarts对象上注册map
         echarts.registerMap("chinaMap", res);
         myChart.setOption({
           // 3. geo配置项中配置type和map
           // 地理坐标系组件
           geo: {
             type: "map",
             map: "chinaMap",
             roam: true, // 是否可以鼠标或平移拖动
             label: {
               show: true, // 展示标签
             },
             zoom: 1.3, //初始化缩放比,
             center: [125.3245, 43.886841], // 设置地图中心点
           },
         });
       }
     );

效果图

标签:map,res,geo,配置,图表,type,true,echarts
来源: https://www.cnblogs.com/it774274680/p/16421059.html