气泡地图支持动态数据

qianming 3 years ago
parent fdf1faf5f3
commit 01ffd0021d

@ -1,5 +1,5 @@
/* /*
*/ */
INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`, `item_name`, `item_value`, `item_extend`, `enabled`, `locale`, `remark`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('CHART_PROPERTIES', '地图地名', 'name', NULL, 1, 'zh', NULL, 10, 'admin', now(), 'admin', now(), 1); UPDATE `aj_report`.`gaea_dict_item` SET `dict_code` = 'CHART_PROPERTIES', `item_name` = '饼图/仪表盘/气泡地图name', `item_value` = 'name', `item_extend` = NULL, `enabled` = 1, `locale` = 'zh', `remark` = NULL, `sort` = 8, `create_by` = 'admin', `create_time` = '2021-04-29 10:48:43', `update_by` = 'admin', `update_time` = '2021-04-29 10:48:50', `version` = 1 WHERE `id` = 263;
INSERT INTO `aj_report`.`gaea_dict_item`(`dict_code`, `item_name`, `item_value`, `item_extend`, `enabled`, `locale`, `remark`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('CHART_PROPERTIES', '地图数值', 'value', NULL, 1, 'zh', NULL, 10, 'admin', now(), 'admin', now(), 1); UPDATE `aj_report`.`gaea_dict_item` SET `dict_code` = 'CHART_PROPERTIES', `item_name` = '饼图/仪表盘/气泡地图value', `item_value` = 'value', `item_extend` = NULL, `enabled` = 1, `locale` = 'zh', `remark` = NULL, `sort` = 9, `create_by` = 'admin', `create_time` = '2021-04-29 10:48:43', `update_by` = 'admin', `update_time` = '2021-04-29 10:48:50', `version` = 1 WHERE `id` = 264;

@ -156,7 +156,6 @@ export default {
} }
ananysicData["xAxis"] = xAxisList; ananysicData["xAxis"] = xAxisList;
ananysicData["series"] = series; ananysicData["series"] = series;
// console.log(ananysicData, '结果数据')
return ananysicData; return ananysicData;
}, },
// 饼图或者空心饼图或者漏斗图 // 饼图或者空心饼图或者漏斗图
@ -174,7 +173,6 @@ export default {
} }
ananysicData.push(obj); ananysicData.push(obj);
} }
// console.log(ananysicData, '结果数据')
return ananysicData; return ananysicData;
}, },
gaugeFn(chartProperties, data) { gaugeFn(chartProperties, data) {
@ -194,7 +192,6 @@ export default {
} }
ananysicData.push(obj); ananysicData.push(obj);
} }
// console.log(ananysicData, '结果数据')
return ananysicData[0]; return ananysicData[0];
}, },
widgettext(chartProperties, data) { widgettext(chartProperties, data) {
@ -204,7 +201,6 @@ export default {
for (const key in chartProperties) { for (const key in chartProperties) {
const value = chartProperties[key]; const value = chartProperties[key];
if (value === "name") { if (value === "name") {
//obj["name"] = data[i][key];
} else { } else {
obj["value"] = data[i][key]; obj["value"] = data[i][key];
} }

@ -5889,12 +5889,20 @@ const widgetTools = [
list: [ list: [
{ {
type: 'el-input-number', type: 'el-input-number',
label: '气泡大小', label: '最小半径',
name: 'fontAirSize', name: 'fontminSize4Pin',
required: false, required: false,
placeholder: '', placeholder: '',
value: 20, value: 20,
}, },
{
type: 'el-input-number',
label: '最大半径',
name: 'fontmaxSize4Pin',
required: false,
placeholder: '',
value: 100,
},
/*{ /*{
type: 'vue-color', type: 'vue-color',
label: '气泡颜色', label: '气泡颜色',

@ -403,7 +403,7 @@ export default {
editorOptions() { editorOptions() {
this.setOptionsTitle(); this.setOptionsTitle();
this.setOptionTextValue(); this.setOptionTextValue();
this.setOptionDataValue(); //this.setOptionDataValue();
this.setOptionsData(); this.setOptionsData();
this.setOptionAirSize(); this.setOptionAirSize();
this.setOptionMapBlocak(); this.setOptionMapBlocak();
@ -440,27 +440,6 @@ export default {
}; };
label['normal'] = normal; label['normal'] = normal;
}, },
setOptionDataValue() {
const optionsSetup = this.optionsSetup;
const label = this.options.series[1]['label'];
const normal = {
show: true,
color: '#fff',
fontWeight: 'bold',
position: 'inside',
formatter: function (para) {
return '{cnNum|' + para.data.value[2] + '}'
},
rich: {
cnNum: {
fontSize: optionsSetup.fontDataSize,
color: optionsSetup.fontDataColor,
fontWeight: optionsSetup.fontDataWeight,
}
}
};
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'];
@ -483,7 +462,8 @@ export default {
itemStyle['emphasis'] = emphasis; itemStyle['emphasis'] = emphasis;
}, },
setOptionAirSize() { setOptionAirSize() {
minSize4Pin = this.optionsSetup.fontAirSize maxSize4Pin = this.optionsSetup.fontmaxSize4Pin
minSize4Pin = this.optionsSetup.fontminSize4Pin
}, },
// //
setOptionsData() { setOptionsData() {
@ -496,10 +476,28 @@ export default {
); );
}, },
staticDataFn(val) { staticDataFn(val) {
const serise1 = this.options.series[1]; this.options.series[0]['data'] = val;
serise1['data'] = convertData(val) const optionsSetup = this.optionsSetup;
const serise = this.options.series[0]; const label = this.options.series[1]['label'];
serise['data'] = val const normal = {
show: true,
color: '#fff',
fontWeight: 'bold',
position: 'inside',
formatter: function (para) {
return '{cnNum|' + para.data.value[2] + '}'
},
rich: {
cnNum: {
fontSize: optionsSetup.fontDataSize,
color: optionsSetup.fontDataColor,
fontWeight: optionsSetup.fontDataWeight,
}
}
};
const data = convertData(val);
this.options.series[1]['data']=data
label['normal'] = normal
}, },
dynamicDataFn(val, refreshTime) { dynamicDataFn(val, refreshTime) {
if (!val) return; if (!val) return;
@ -519,11 +517,28 @@ export default {
}); });
}, },
renderingFn(val) { renderingFn(val) {
for (const key in this.options.series) { this.options.series[0]['data'] = val;
if (this.options.series[key].type == "china") { const optionsSetup = this.optionsSetup;
this.options.series[key].data = val; const label = this.options.series[1]['label'];
const normal = {
show: true,
color: '#fff',
fontWeight: 'bold',
position: 'inside',
formatter: function (para) {
return '{cnNum|' + para.data.value[2] + '}'
},
rich: {
cnNum: {
fontSize: optionsSetup.fontDataSize,
color: optionsSetup.fontDataColor,
fontWeight: optionsSetup.fontDataWeight,
} }
} }
};
const data = convertData(val);
this.options.series[1]['data']=data
label['normal'] = normal
} }
} }
}; };

Loading…
Cancel
Save