目录
代码
let that = this;
if (
that.myChart1 != null &&
that.myChart1 != "" &&
that.myChart1 != undefined
) {
that.myChart1.dispose(); //销毁
}
var chartDom = document.getElementById("mapChart");
that.myChart1 = that.$echarts.init(chartDom);
var option;
let serdata = [];
let params = {
type: "FeatureCollection",
features: [],
};
this.mapData.features.forEach((item) => {
params.features.push({
type: "Feature",
geometry: {
coordinates: [item.geometry.coordinates],
type: "MultiPolygon",
},
properties: {
name: item.properties.xzqhmc,
value: item.properties.zongmianji,
},
});
serdata.push({
name: item.properties.xzqhmc,
value: item.