|
|
@ -8,42 +8,41 @@ import echarts from "echarts";
|
|
|
|
import "../../../../../../../node_modules/echarts/map/js/china.js";
|
|
|
|
import "../../../../../../../node_modules/echarts/map/js/china.js";
|
|
|
|
//https://www.makeapie.com/editor.html?c=x2yaz6dfRw
|
|
|
|
//https://www.makeapie.com/editor.html?c=x2yaz6dfRw
|
|
|
|
//https://www.makeapie.com/editor.html?c=xMpGBbTEKU
|
|
|
|
//https://www.makeapie.com/editor.html?c=xMpGBbTEKU
|
|
|
|
var geoCoordMap = {
|
|
|
|
let geoCoordMap = {
|
|
|
|
'台湾': [121.5135, 25.0308],
|
|
|
|
台湾: [121.5135, 25.0308],
|
|
|
|
'黑龙江': [127.9688, 45.368],
|
|
|
|
黑龙江: [127.9688, 45.368],
|
|
|
|
'内蒙古': [110.3467, 41.4899],
|
|
|
|
内蒙古: [110.3467, 41.4899],
|
|
|
|
"吉林": [125.8154, 44.2584],
|
|
|
|
吉林: [125.8154, 44.2584],
|
|
|
|
'北京': [116.4551, 40.2539],
|
|
|
|
北京: [116.4551, 40.2539],
|
|
|
|
"辽宁": [123.1238, 42.1216],
|
|
|
|
辽宁: [123.1238, 42.1216],
|
|
|
|
"河北": [114.4995, 38.1006],
|
|
|
|
河北: [114.4995, 38.1006],
|
|
|
|
"天津": [117.4219, 39.4189],
|
|
|
|
天津: [117.4219, 39.4189],
|
|
|
|
"山西": [112.3352, 37.9413],
|
|
|
|
山西: [112.3352, 37.9413],
|
|
|
|
"陕西": [109.1162, 34.2004],
|
|
|
|
陕西: [109.1162, 34.2004],
|
|
|
|
"甘肃": [103.5901, 36.3043],
|
|
|
|
甘肃: [103.5901, 36.3043],
|
|
|
|
"宁夏": [106.3586, 38.1775],
|
|
|
|
宁夏: [106.3586, 38.1775],
|
|
|
|
"青海": [101.4038, 36.8207],
|
|
|
|
青海: [101.4038, 36.8207],
|
|
|
|
"新疆": [87.9236, 43.5883],
|
|
|
|
新疆: [87.9236, 43.5883],
|
|
|
|
"西藏": [91.11, 29.97],
|
|
|
|
西藏: [91.11, 29.97],
|
|
|
|
"四川": [103.9526, 30.7617],
|
|
|
|
四川: [103.9526, 30.7617],
|
|
|
|
"重庆": [108.384366, 30.439702],
|
|
|
|
重庆: [108.384366, 30.439702],
|
|
|
|
"山东": [117.1582, 36.8701],
|
|
|
|
山东: [117.1582, 36.8701],
|
|
|
|
"河南": [113.4668, 34.6234],
|
|
|
|
河南: [113.4668, 34.6234],
|
|
|
|
"江苏": [118.8062, 31.9208],
|
|
|
|
江苏: [118.8062, 31.9208],
|
|
|
|
"安徽": [117.29, 32.0581],
|
|
|
|
安徽: [117.29, 32.0581],
|
|
|
|
"湖北": [114.3896, 30.6628],
|
|
|
|
湖北: [114.3896, 30.6628],
|
|
|
|
"浙江": [119.5313, 29.8773],
|
|
|
|
浙江: [119.5313, 29.8773],
|
|
|
|
"福建": [119.4543, 25.9222],
|
|
|
|
福建: [119.4543, 25.9222],
|
|
|
|
"江西": [116.0046, 28.6633],
|
|
|
|
江西: [116.0046, 28.6633],
|
|
|
|
"湖南": [113.0823, 28.2568],
|
|
|
|
湖南: [113.0823, 28.2568],
|
|
|
|
"贵州": [106.6992, 26.7682],
|
|
|
|
贵州: [106.6992, 26.7682],
|
|
|
|
"云南": [102.9199, 25.4663],
|
|
|
|
云南: [102.9199, 25.4663],
|
|
|
|
"广东": [113.12244, 23.009505],
|
|
|
|
广东: [113.12244, 23.009505],
|
|
|
|
"广西": [108.479, 23.1152],
|
|
|
|
广西: [108.479, 23.1152],
|
|
|
|
"海南": [110.3893, 19.8516],
|
|
|
|
海南: [110.3893, 19.8516],
|
|
|
|
'上海': [121.4648, 31.2891],
|
|
|
|
上海: [121.4648, 31.2891]
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var data = [
|
|
|
|
let data = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "南海诸岛",
|
|
|
|
name: "南海诸岛",
|
|
|
|
value: 1
|
|
|
|
value: 1
|
|
|
@ -183,12 +182,12 @@ var data = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "澳门",
|
|
|
|
name: "澳门",
|
|
|
|
value: 9
|
|
|
|
value: 9
|
|
|
|
},
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
var convertData = function (data) {
|
|
|
|
let convertData = function(data) {
|
|
|
|
var res = [];
|
|
|
|
let res = [];
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
var geoCoord = geoCoordMap[data[i].name];
|
|
|
|
let geoCoord = geoCoordMap[data[i].name];
|
|
|
|
if (geoCoord) {
|
|
|
|
if (geoCoord) {
|
|
|
|
res.push({
|
|
|
|
res.push({
|
|
|
|
name: data[i].name,
|
|
|
|
name: data[i].name,
|
|
|
@ -198,9 +197,9 @@ var convertData = function (data) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var max = 6000,
|
|
|
|
let max = 6000,
|
|
|
|
min = 10;
|
|
|
|
min = 10;
|
|
|
|
var maxSize4Pin = 100,
|
|
|
|
let maxSize4Pin = 100,
|
|
|
|
minSize4Pin = 20;
|
|
|
|
minSize4Pin = 20;
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
@ -217,14 +216,26 @@ export default {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
formatter: function(params) {
|
|
|
|
formatter: function(params) {
|
|
|
|
if (params.value.length > 1) {
|
|
|
|
if (params.value.length > 1) {
|
|
|
|
return ' ' + params.name + ' ' + params.value[2] + ' ';
|
|
|
|
return (
|
|
|
|
|
|
|
|
" " +
|
|
|
|
|
|
|
|
params.name +
|
|
|
|
|
|
|
|
" " +
|
|
|
|
|
|
|
|
params.value[2] +
|
|
|
|
|
|
|
|
" "
|
|
|
|
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return ' ' + params.name + ' ' + params.value + ' ';
|
|
|
|
return (
|
|
|
|
|
|
|
|
" " +
|
|
|
|
|
|
|
|
params.name +
|
|
|
|
|
|
|
|
" " +
|
|
|
|
|
|
|
|
params.value +
|
|
|
|
|
|
|
|
" "
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
geo: {
|
|
|
|
geo: {
|
|
|
|
map: 'china',
|
|
|
|
map: "china",
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
roam: false,
|
|
|
|
roam: false,
|
|
|
|
label: {
|
|
|
|
label: {
|
|
|
@ -235,15 +246,25 @@ export default {
|
|
|
|
layoutSize: "80%",
|
|
|
|
layoutSize: "80%",
|
|
|
|
itemStyle: {
|
|
|
|
itemStyle: {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
|
borderColor: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
borderColor: new echarts.graphic.LinearGradient(
|
|
|
|
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
|
|
|
|
0,
|
|
|
|
|
|
|
|
1,
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: '#00F6FF'
|
|
|
|
color: "#00F6FF"
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 1,
|
|
|
|
offset: 1,
|
|
|
|
color: '#53D9FF'
|
|
|
|
color: "#53D9FF"
|
|
|
|
}], false),
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
),
|
|
|
|
borderWidth: 3,
|
|
|
|
borderWidth: 3,
|
|
|
|
shadowColor: 'rgba(10,76,139,1)',
|
|
|
|
shadowColor: "rgba(10,76,139,1)",
|
|
|
|
shadowOffsetY: 0,
|
|
|
|
shadowOffsetY: 0,
|
|
|
|
shadowBlur: 60
|
|
|
|
shadowBlur: 60
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -251,19 +272,20 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type: 'map',
|
|
|
|
type: "map",
|
|
|
|
map: 'china',
|
|
|
|
map: "china",
|
|
|
|
aspectScale: 0.75,
|
|
|
|
aspectScale: 0.75,
|
|
|
|
label: {
|
|
|
|
label: {
|
|
|
|
normal: {//调整数值
|
|
|
|
normal: {
|
|
|
|
position: 'right',
|
|
|
|
//调整数值
|
|
|
|
|
|
|
|
position: "right",
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
color: '#53D9FF',
|
|
|
|
color: "#53D9FF",
|
|
|
|
fontSize: 20
|
|
|
|
fontSize: 20
|
|
|
|
},
|
|
|
|
},
|
|
|
|
emphasis: {
|
|
|
|
emphasis: {
|
|
|
|
show: true,
|
|
|
|
show: true
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemStyle: {
|
|
|
|
itemStyle: {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
@ -273,16 +295,19 @@ export default {
|
|
|
|
y: 0,
|
|
|
|
y: 0,
|
|
|
|
x2: 0,
|
|
|
|
x2: 0,
|
|
|
|
y2: 1,
|
|
|
|
y2: 1,
|
|
|
|
colorStops: [{
|
|
|
|
colorStops: [
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: '#073684' // 0% 处的颜色
|
|
|
|
color: "#073684" // 0% 处的颜色
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 1,
|
|
|
|
offset: 1,
|
|
|
|
color: '#061E3D' // 100% 处的颜色
|
|
|
|
color: "#061E3D" // 100% 处的颜色
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
borderColor: '#215495',
|
|
|
|
borderColor: "#215495",
|
|
|
|
borderWidth: 1,
|
|
|
|
borderWidth: 1
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//鼠标放置颜色加深
|
|
|
|
//鼠标放置颜色加深
|
|
|
|
emphasis: {
|
|
|
|
emphasis: {
|
|
|
@ -291,81 +316,93 @@ export default {
|
|
|
|
y: 0,
|
|
|
|
y: 0,
|
|
|
|
x2: 0,
|
|
|
|
x2: 0,
|
|
|
|
y2: 1,
|
|
|
|
y2: 1,
|
|
|
|
colorStops: [{
|
|
|
|
colorStops: [
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: '#073684' // 0% 处的颜色
|
|
|
|
color: "#073684" // 0% 处的颜色
|
|
|
|
}, {
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: '#2B91B7' // 100% 处的颜色
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
|
|
color: "#2B91B7" // 100% 处的颜色
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: data,
|
|
|
|
data: data
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type: 'effectScatter',
|
|
|
|
type: "effectScatter",
|
|
|
|
coordinateSystem: 'geo',
|
|
|
|
coordinateSystem: "geo",
|
|
|
|
rippleEffect: {
|
|
|
|
rippleEffect: {
|
|
|
|
brushType: 'stroke'
|
|
|
|
brushType: "stroke"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
showEffectOn: 'render',
|
|
|
|
showEffectOn: "render",
|
|
|
|
itemStyle: {
|
|
|
|
itemStyle: {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
|
//气泡颜色
|
|
|
|
//气泡颜色
|
|
|
|
color: {
|
|
|
|
color: {
|
|
|
|
type: 'radial',
|
|
|
|
type: "radial",
|
|
|
|
x: 0.5,
|
|
|
|
x: 0.5,
|
|
|
|
y: 0.5,
|
|
|
|
y: 0.5,
|
|
|
|
r: 0.5,
|
|
|
|
r: 0.5,
|
|
|
|
colorStops: [{
|
|
|
|
colorStops: [
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: 'rgba(5,80,151,0.2)'
|
|
|
|
color: "rgba(5,80,151,0.2)"
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 0.8,
|
|
|
|
offset: 0.8,
|
|
|
|
color: 'rgba(5,80,151,0.8)'
|
|
|
|
color: "rgba(5,80,151,0.8)"
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 1,
|
|
|
|
offset: 1,
|
|
|
|
color: 'rgba(0,108,255,0.7)'
|
|
|
|
color: "rgba(0,108,255,0.7)"
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
global: false
|
|
|
|
global: false
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
label: {
|
|
|
|
label: {
|
|
|
|
normal: {
|
|
|
|
normal: {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
color: '#fff',
|
|
|
|
color: "#fff",
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontWeight: "bold",
|
|
|
|
position: 'inside',
|
|
|
|
position: "inside",
|
|
|
|
formatter: function(para) {
|
|
|
|
formatter: function(para) {
|
|
|
|
return '{cnNum|' + para.data.value[2] + '}'
|
|
|
|
return "{cnNum|" + para.data.value[2] + "}";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rich: {
|
|
|
|
rich: {
|
|
|
|
cnNum: {
|
|
|
|
cnNum: {
|
|
|
|
fontSize: 13,
|
|
|
|
fontSize: 13,
|
|
|
|
color: '#D4EEFF',
|
|
|
|
color: "#D4EEFF"
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
symbol: "circle",
|
|
|
|
symbol: 'circle',
|
|
|
|
|
|
|
|
symbolSize: function(val) {
|
|
|
|
symbolSize: function(val) {
|
|
|
|
if (val[2] == 0) {
|
|
|
|
if (val[2] == 0) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
;
|
|
|
|
return (
|
|
|
|
return ((maxSize4Pin - minSize4Pin) / (max - min)) * val[2] + (maxSize4Pin - ((maxSize4Pin - minSize4Pin) / (max - min)) * max) * 1.2;
|
|
|
|
((maxSize4Pin - minSize4Pin) / (max - min)) * val[2] +
|
|
|
|
|
|
|
|
(maxSize4Pin -
|
|
|
|
|
|
|
|
((maxSize4Pin - minSize4Pin) / (max - min)) * max) *
|
|
|
|
|
|
|
|
1.2
|
|
|
|
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: convertData(data),
|
|
|
|
data: convertData(data),
|
|
|
|
zlevel: 1,
|
|
|
|
zlevel: 1
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
optionsStyle: {}, // 样式
|
|
|
|
optionsStyle: {}, // 样式
|
|
|
|
optionsData: {}, // 数据
|
|
|
|
optionsData: {}, // 数据
|
|
|
|
optionsCollapse: {}, // 图标属性
|
|
|
|
optionsCollapse: {}, // 图标属性
|
|
|
|
optionsSetup: {}
|
|
|
|
optionsSetup: {}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
styleObj() {
|
|
|
|
styleObj() {
|
|
|
@ -430,19 +467,19 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setOptionTextValue() {
|
|
|
|
setOptionTextValue() {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const label = this.options.series[0]['label'];
|
|
|
|
const label = this.options.series[0]["label"];
|
|
|
|
const normal = {
|
|
|
|
const normal = {
|
|
|
|
position: 'right',
|
|
|
|
position: "right",
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
color: optionsSetup.fontTextColor,
|
|
|
|
color: optionsSetup.fontTextColor,
|
|
|
|
fontSize: optionsSetup.fontTextSize,
|
|
|
|
fontSize: optionsSetup.fontTextSize,
|
|
|
|
fontWeight: optionsSetup.fontTextWeight,
|
|
|
|
fontWeight: optionsSetup.fontTextWeight
|
|
|
|
};
|
|
|
|
};
|
|
|
|
label['normal'] = normal;
|
|
|
|
label["normal"] = normal;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setOptionMapBlocak() {
|
|
|
|
setOptionMapBlocak() {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const itemStyle = this.options.series[0]['itemStyle'];
|
|
|
|
const itemStyle = this.options.series[0]["itemStyle"];
|
|
|
|
const normal = {
|
|
|
|
const normal = {
|
|
|
|
//地图块颜色
|
|
|
|
//地图块颜色
|
|
|
|
areaColor: {
|
|
|
|
areaColor: {
|
|
|
@ -450,16 +487,19 @@ export default {
|
|
|
|
y: 0,
|
|
|
|
y: 0,
|
|
|
|
x2: 0,
|
|
|
|
x2: 0,
|
|
|
|
y2: 1,
|
|
|
|
y2: 1,
|
|
|
|
colorStops: [{
|
|
|
|
colorStops: [
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: optionsSetup.font0PreColor // 0% 处的颜色
|
|
|
|
color: optionsSetup.font0PreColor // 0% 处的颜色
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 1,
|
|
|
|
offset: 1,
|
|
|
|
color: optionsSetup.font100PreColor // 100% 处的颜色
|
|
|
|
color: optionsSetup.font100PreColor // 100% 处的颜色
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
borderColor: '#215495',
|
|
|
|
borderColor: "#215495",
|
|
|
|
borderWidth: 1,
|
|
|
|
borderWidth: 1
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//鼠标放置颜色加深
|
|
|
|
//鼠标放置颜色加深
|
|
|
|
const emphasis = {
|
|
|
|
const emphasis = {
|
|
|
@ -468,55 +508,55 @@ export default {
|
|
|
|
y: 0,
|
|
|
|
y: 0,
|
|
|
|
x2: 0,
|
|
|
|
x2: 0,
|
|
|
|
y2: 1,
|
|
|
|
y2: 1,
|
|
|
|
colorStops: [{
|
|
|
|
colorStops: [
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 0,
|
|
|
|
offset: 0,
|
|
|
|
color: '#073684' // 0% 处的颜色
|
|
|
|
color: "#073684" // 0% 处的颜色
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
offset: 1,
|
|
|
|
offset: 1,
|
|
|
|
color: optionsSetup.fontHighlightColor // 100% 处的颜色
|
|
|
|
color: optionsSetup.fontHighlightColor // 100% 处的颜色
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
itemStyle['normal'] = normal;
|
|
|
|
itemStyle["normal"] = normal;
|
|
|
|
itemStyle['emphasis'] = emphasis;
|
|
|
|
itemStyle["emphasis"] = emphasis;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setOptionAirSize() {
|
|
|
|
setOptionAirSize() {
|
|
|
|
maxSize4Pin = this.optionsSetup.fontmaxSize4Pin
|
|
|
|
maxSize4Pin = this.optionsSetup.fontmaxSize4Pin;
|
|
|
|
minSize4Pin = this.optionsSetup.fontminSize4Pin
|
|
|
|
minSize4Pin = this.optionsSetup.fontminSize4Pin;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//数据解析
|
|
|
|
//数据解析
|
|
|
|
setOptionsData() {
|
|
|
|
setOptionsData() {
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
|
const optionsData = this.optionsData; // 数据类型 静态 or 动态
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|
optionsData.dataType == "staticData"
|
|
|
|
? this.staticDataFn(optionsData.staticData)
|
|
|
|
? this.staticDataFn(optionsData.staticData)
|
|
|
|
: this.dynamicDataFn(
|
|
|
|
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
|
|
|
|
optionsData.dynamicData,
|
|
|
|
|
|
|
|
optionsData.refreshTime
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
staticDataFn(val) {
|
|
|
|
staticDataFn(val) {
|
|
|
|
this.options.series[0]['data'] = val;
|
|
|
|
this.options.series[0]["data"] = val;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const label = this.options.series[1]['label'];
|
|
|
|
const label = this.options.series[1]["label"];
|
|
|
|
const normal = {
|
|
|
|
const normal = {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
color: '#fff',
|
|
|
|
color: "#fff",
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontWeight: "bold",
|
|
|
|
position: 'inside',
|
|
|
|
position: "inside",
|
|
|
|
formatter: function(para) {
|
|
|
|
formatter: function(para) {
|
|
|
|
return '{cnNum|' + para.data.value[2] + '}'
|
|
|
|
return "{cnNum|" + para.data.value[2] + "}";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rich: {
|
|
|
|
rich: {
|
|
|
|
cnNum: {
|
|
|
|
cnNum: {
|
|
|
|
fontSize: optionsSetup.fontDataSize,
|
|
|
|
fontSize: optionsSetup.fontDataSize,
|
|
|
|
color: optionsSetup.fontDataColor,
|
|
|
|
color: optionsSetup.fontDataColor,
|
|
|
|
fontWeight: optionsSetup.fontDataWeight,
|
|
|
|
fontWeight: optionsSetup.fontDataWeight
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const data = convertData(val);
|
|
|
|
const data = convertData(val);
|
|
|
|
this.options.series[1]['data']=data
|
|
|
|
this.options.series[1]["data"] = data;
|
|
|
|
label['normal'] = normal
|
|
|
|
label["normal"] = normal;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
dynamicDataFn(val, refreshTime) {
|
|
|
|
dynamicDataFn(val, refreshTime) {
|
|
|
|
if (!val) return;
|
|
|
|
if (!val) return;
|
|
|
@ -536,28 +576,28 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
renderingFn(val) {
|
|
|
|
renderingFn(val) {
|
|
|
|
this.options.series[0]['data'] = val;
|
|
|
|
this.options.series[0]["data"] = val;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const label = this.options.series[1]['label'];
|
|
|
|
const label = this.options.series[1]["label"];
|
|
|
|
const normal = {
|
|
|
|
const normal = {
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
color: '#fff',
|
|
|
|
color: "#fff",
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontWeight: "bold",
|
|
|
|
position: 'inside',
|
|
|
|
position: "inside",
|
|
|
|
formatter: function(para) {
|
|
|
|
formatter: function(para) {
|
|
|
|
return '{cnNum|' + para.data.value[2] + '}'
|
|
|
|
return "{cnNum|" + para.data.value[2] + "}";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rich: {
|
|
|
|
rich: {
|
|
|
|
cnNum: {
|
|
|
|
cnNum: {
|
|
|
|
fontSize: optionsSetup.fontDataSize,
|
|
|
|
fontSize: optionsSetup.fontDataSize,
|
|
|
|
color: optionsSetup.fontDataColor,
|
|
|
|
color: optionsSetup.fontDataColor,
|
|
|
|
fontWeight: optionsSetup.fontDataWeight,
|
|
|
|
fontWeight: optionsSetup.fontDataWeight
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const data = convertData(val);
|
|
|
|
const data = convertData(val);
|
|
|
|
this.options.series[1]['data']=data
|
|
|
|
this.options.series[1]["data"] = data;
|
|
|
|
label['normal'] = normal
|
|
|
|
label["normal"] = normal;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|