You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/04/22 00:50:21 UTC

[GitHub] [echarts] ItsMisa commented on issue #14734: https://ecomfe.github.io/echarts-issue-helper/

ItsMisa commented on issue #14734:
URL: https://github.com/apache/echarts/issues/14734#issuecomment-824457641


   import * as echarts from "echarts";
   import nameMap from "./nameMap";
   import mapJSON from "./map.json";
   const chart = echarts.init(document.getElementById("app"));
   
   const data = [
     { name: "中国", value: [10000, 10000, 50000] },
     { name: "美国", value: [10000, 10000, 50000] }
   ];
   echarts.registerMap("world", mapJSON);
   chart.setOption({
     backgroundColor: "#404a59",
     title: {
       text: "地区分布",
       textStyle: {
         color: "#ffffff"
       }
     },
     visualMap: {
       min: 0,
       max: 50000,
       left: "left",
       top: "bottom",
       text: ["高", "低"],
       dimension: 2,
       textStyle: {
         color: "#ddd"
       },
       inRange: {
         color: ["lightskyblue", "yellow", "orangered", "red"]
       },
       calculable: false
     },
     series: [
       {
         name: "全球地区客户分布",
         type: "map",
         id: "map",
         map: "world", // 自定义扩展图表类型
         roam: true,
         nameMap,
         data: data,
         label: {
           show: true,
           fontWeight: 500,
           fontSize: 16,
           formatter: function (params) {
             if (params.data) {
               return params.data.name;
             }
             return "";
           }
         },
         emphasis: {
           label: {
             show: true,
             formatter: (params) => {
               return params.name;
             }
           }
         }
         // itemStyle: {
         // },
       }
     ]
   });
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org