The color of echarts map3D area is set separately

Renderings:

accomplish:

I used map3D. I tried geo3d before because the version problem is not easy to control (the font color on the map can’t be set)

Just add the name and color of the area you want to color in the data of the series. This effect achieves legendless shading.

  series: [
      {
        type: "map3D", // 系列类型
        name: "map3D", // 系列名称
        map: "yuhang", // 地图类型。
        
        data: [
          { name: "鸬鸟镇", itemStyle: { color: "#fef436" } },
          { name: "仁和街道",  itemStyle: { color: "#fc0d1b" } },
          { name: "余杭街道",  itemStyle: { color: "#188dfb" } }
        ]
      }
  ]

Attach the official api, path: GL configuration=>series=>type:map3D=>data

If you want to achieve the effect of the legend label on the left, you can try the label attribute in data. Referring to the 2D map, I tried to set the value in the data, and then wrote the following code in the option (that is, the same level as the series), and changed the start and end to the value in the data, and then set the color, so that there will be a legend . Just provide ideas, if you need to try it yourself.

dataRange: {
      splitList: [{ start: 1, end: 1, color: "#fef436" }]
    }

Guess you like

Origin blog.csdn.net/m0_46550764/article/details/122203007