qinpu-option.js 2.29 KB
export const qinpuOption = {
  // 鼠标放置时的提示框
  tooltip: {
    trigger: "item",
    formatter: "{b}<br/>{c} (分)",
  },
  // 可视化映射组件
  visualMap: {
    show: true,
    x: "left",
    y: "58%", // 设置左边提示的位置
    itemWidth: 10,
    itemHeight: 10,
    sspliList: [
      { start: 0, end: 20, label: "测试1", color: "#29A4D7" },
      { start: 20, end: 40, label: "测试2", color: "#DD970B" },
      { start: 40, end: 60, label: "测试3", color: "#E64B47" },
      { start: 60, end: 80, label: "测试4", color: "#E6C249" },
      { start: 80, end: 100, label: "测试5", color: "#B52621" },
    ],
    textStyle: {
      color: "#fff", // 文字颜色
    },
  },
  // 系列列表
  series: [
    {
      name: "青浦区",
      type: "map",
      mapType: "青浦区",
      // 设置每一块中的具体文字
      label: {
        normal: {
          show: true,
          formatter: function (params) {
            return params.name + "\n" + params.value;
          },
          textStyle: {
            fontWeight: "normal",
            fontSize: 12,
            color: "#fff",
          },
        },
      },
      // 设置每一块的颜色
      emphasis: {
        show: true,
        label: {
          textStyle: {
            color: "#fff",
          },
          itemStyle: {
            areaColor: "#CCC",
          },
        },
        itemStyle: {
          normal: {
            borderWidth: 0.5, // 边际线
            borderColor: "#fff", // 边际线颜色
          },
        },
      },
      data: [
        {
          name: "朱家角镇",
          value: [137.80,11, 217, 28, 284],
        },
        {
          name: "赵巷镇",
          value: [41.01 ,5 ,65 ,8 ,156],
        },
        {
          name: "徐泾镇",
          value: [38.55 ,10, 80, 9, 145],
        },
        {
          name: "华新镇",
          value: [47.49 ,2 ,36 ,19 ,228],
        },
        {
          name: "重固镇",
          value: [25.14, 2 ,31 ,8 ,112],
        },
        {
          name: "白鹤镇",
          value: [57.33, 3, 18 ,21, 324 ],
        },
        {
          name: "练塘镇",
          value: [92.90 ,4 ,31 ,25 ,407],
        },
        {
          name: "金泽镇",
          value: [108.42, 5, 54, 30, 424],
        },
      ],
    },
  ],
};