提交 15963586 authored 作者: liujq23's avatar liujq23

暂存

上级 71d717e6
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -397,116 +397,6 @@ export function getMapOption() { ...@@ -397,116 +397,6 @@ export function getMapOption() {
color: 'rgba(255, 77, 79, 1)' color: 'rgba(255, 77, 79, 1)'
} }
} }
}, {
name: '个人会员数量',
type: 'map',
geoIndex: 0,
tooltip: {
show: false
},
data: [{
name: '北京',
value: 2256
}, {
name: '天津',
value: 744
}, {
name: '上海',
value: 578
}, {
name: '重庆',
value: 806
}, {
name: '河北',
value: 432
}, {
name: '河南',
value: 590
}, {
name: '云南',
value: 132
}, {
name: '辽宁',
value: 487
}, {
name: '黑龙江',
value: 336
}, {
name: '湖南',
value: 295
}, {
name: '安徽',
value: 398
}, {
name: '山东',
value: 1055
}, {
name: '新疆',
value: 201
}, {
name: '江苏',
value: 795
}, {
name: '浙江',
value: 655
}, {
name: '江西',
value: 311
}, {
name: '湖北',
value: 993
}, {
name: '广西',
value: 261
}, {
name: '甘肃',
value: 349
}, {
name: '山西',
value: 273
}, {
name: '内蒙古',
value: 343
}, {
name: '陕西',
value: 319
}, {
name: '吉林',
value: 325
}, {
name: '福建',
value: 317
}, {
name: '贵州',
value: 275
}, {
name: '广东',
value: 1000
}, {
name: '青海',
value: 97
}, {
name: '西藏',
value: 18
}, {
name: '四川',
value: 601
}, {
name: '宁夏',
value: 126
}, {
name: '海南',
value: 186
}, {
name: '台湾',
value: 0
}, {
name: '香港',
value: 11
}, {
name: '澳门',
value: 0
}]
}] }]
}; };
return option return option
......
差异被折叠。
import * as echarts from "echarts"; import * as echarts from "echarts";
const getPieChart = (number, current, total) => { import worldJson from '@/assets/json/world.json'
import _ from "lodash";
export function getPieChart(number, current, total) {
const option = { const option = {
// 图表标题可置于中心,模拟居中文字的一部分 // 图表标题可置于中心,模拟居中文字的一部分
title: { title: {
...@@ -67,12 +69,136 @@ const getPieChart = (number, current, total) => { ...@@ -67,12 +69,136 @@ const getPieChart = (number, current, total) => {
}; };
return option return option
} }
const setChart = (option, chartDom) => { export function setChart(option, chartDom) {
let chart = echarts.init(chartDom); let chart = echarts.init(chartDom);
chart.setOption(option); chart.setOption(option);
return chart; return chart;
}; };
export { export function getMapOption(data,levelMap) {
getPieChart, echarts.registerMap('world', worldJson);
setChart function convertData(data) {
let res = [];
_.each(data, (item1) => {
_.each(item1.children, (item) => {
res.push({
name: item1.name,
value: item.position.concat(item.level),
itemStyle: {
color: levelMap[item.level].color[0],
borderColor: levelMap[item.level].color[1]
}
});
})
})
return res;
}
let option = {
tooltip: {
show: false
},
// visualMap: {
// type: 'piecewise', // 可选:'continuous' (连续型) 或 'piecewise' (分段型)[citation:2]
// dimension: 2, // 指定使用数据的第3个维度(即上面数据中的等级值)进行映射
// min: 1, // 映射范围最小值
// max: 5, // 映射范围最大值
// // 定义分段区间和颜色
// show: false,
// pieces: [
// {
// min: 1,
// max: 1,
// label: '特别重大风险',
// color: 'rgba(255, 77, 79, 1)'
// }, // 绿色
// {
// min: 2,
// max: 2,
// label: '重大风险',
// color: 'rgba(255, 169, 64, 1)'
// },
// {
// min: 3,
// max: 3,
// label: '较大风险',
// color: 'rgba(250, 219, 20, 1)'
// },
// {
// min: 4,
// max: 4,
// label: '一般风险',
// color: 'rgba(64, 150, 255, 1)'
// },
// {
// min: 5,
// max: 5,
// label: '几乎无风险',
// color: 'rgba(54, 207, 201, 1)'
// },
// ],
// orient: 'horizontal',
// left: 'center',
// top: 0
// },
geo: {
map: 'world',
roam: true,
// 地图尺寸为容器宽高较小值的80%
zoom: 1.5,
center: [31.614149450443932, 20.978078159827206],
// scaleLimit:{
// max:'1.2',
// min:'0.7'
// },
label: {
normal: {
show: false,
textStyle: {
color: 'rgba(0,0,0,0.6)'
}
}
},
itemStyle: {
areaColor: 'rgba(231, 243, 255, 1)', // 设置所有区域的默认填充色[citation:8]
borderColor: 'rgb(5, 95, 194)', // 设置边界线颜色[citation:8]
borderWidth: 1 // 设置边界线宽度[citation:8]
},
},
// backgroundColor: 'rgba(0,51,102, 1)',
series: [{
type: 'scatter',
coordinateSystem: 'geo',
data: convertData(data),
symbolSize: 10,
symbolRotate: 0,
symbolOffset: ['50%', '-100%'],
tooltip: {
show: true
},
label: {
normal: {
formatter: '{a}',
position: 'top',
show: false,
textStyle: {
color: '#000000',
fontSize: 16
}
},
emphasis: {
show: false
}
},
itemStyle: {
normal: {
borderWidth: 4,
borderColor: 'rgba(255, 163, 158, 1)',
color: 'rgba(255, 77, 79, 1)'
}
}
}]
};
return option
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论