摘要:北京遼寧上海河北浙江廣東山西天津吉林陜西麗江麗江設置北京遼寧上海河北浙江廣東山西天津吉林陜西初始化
//originLines.js
let locatePoint = [
{
name: "北京", position: [116.407526, 39.904030]
},
{
name: "遼寧", position: [123.429440, 41.835441]
},
{
name: "上海", position: [121.473701, 31.230416]
},
{
name: "河北", position: [114.468664, 38.037057]
},
{
name: "浙江", position: [120.152791, 30.267446]
},
{
name: "廣東", position: [113.266530, 23.132191]
},
{
name: "山西", position: [112.562398, 37.873531]
},
{
name: "天津", position: [117.200983, 39.084158]
},
{
name: "吉林", position: [125.325990, 43.896536]
},
{
name: "陜西", position: [108.954239, 34.265472]
},
{
name: "麗江", position: [100.233026,26.872108]
},
]
let option = {
color:["#14f7fe"],
geo:{
map:"china"
},
series:[
{ type:"lines", coordinateSystem:"geo", effect:{ period: 6, show: true, symbolSize: 3, trailLength: 0.7, }, lineStyle:{ normal:{ color:"#14f2fb", curveness: 0.2, opacity: 0.6, width: 0 } }, data:[] }, { type:"lines", coordinateSystem:"geo", effect:{ period: 6, show: true, symbolSize: 15, trailLength: 0, symbol: "path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z", }, lineStyle:{ normal:{ color:"#14f2fb", curveness: 0.2, opacity: 0.6, width: 1 } }, data:[] }, { type:"effectScatter", coordinateSystem:"geo", symbolSize:6, label:{ normal:{ formatter:"{b}", show:true, position:"right" } }, itemStyle:{ color:"#14f2fb" }, data:[] },
]
}
function processData(data) {
let pointSize = 60
let linesData = data.map(item => ({
coords:[ getPosition(item[0]), getPosition(item[1]) ], fromName:item[0], toName:item[1]
}))
let scatterData = data.map(item => ({
name:item[0], value:[...getPosition(item[0]),pointSize]
}))
scatterData.push({name:data0,value:...getPosition(data[0),pointSize]})
option.series[0].data = linesData;
option.series[1].data = linesData;
option.series[2].data = scatterData;
}
function getPosition(name) {
return locatePoint.find(item => item.name == name).position
}
function getOption(data) {
let tmpData = data.map(item => [item.name,"麗江"]);
processData(tmpData);
return option;
}
export default getOption
import flyLine from "./echarts/originLines"
//html dom
return { originData:[ { name:"北京", value:11703 }, { name:"遼寧", value:11703 }, { name:"上海", value:11703 }, { name:"河北", value:11703 }, { name:"浙江", value:11703 }, { name:"廣東", value:11703 }, { name:"山西", value:11703 }, { name:"天津", value:11703 }, { name:"吉林", value:11703 }, { name:"陜西", value:11703 } ], }
}
//echarts dom 初始化
this.originLines = this.echarts.init(document.getElementById("originLines"),"default");
let option = this.flyLine(this.originData);
this.originLines.setOption(option)
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/54184.html
摘要:北京遼寧上海河北浙江廣東山西天津吉林陜西麗江麗江設置北京遼寧上海河北浙江廣東山西天津吉林陜西初始化 showImg(https://segmentfault.com/img/bVbuXLd?w=644&h=429);//originLines.js let locatePoint = [ { name: 北京, position: [116.407526, 39.904030] },...
摘要:請原諒我以下所有截圖中都是使用的中文,有些地方翻譯略顯生硬。本來系統是使用的英文,奈何領導要求中文呀。時間字段的表示時間屬性必須勾選上一般會時間列默認勾選。可根據來排查問題所在,并且系統為用戶提供版的查詢工具來操作數據庫。Superset簡介 Superset是一個受Apache軟件基金會支持的處于孵化階段的企業級數據可視化web項目。具有以下特點: 內含豐富的數據圖表樣式 支持多種數據源...
摘要:再網上參考了一篇文章小程序實現頁面轉化圖片并保存到相冊根據這篇文章的內容,修改源碼,針對安卓機型寫了兼容的配置,如果你的頁面只有一個圖表,就完全可以成功轉換了,如果是多個請修改的源碼,方法選擇就可以了。 最近做的小程序項目在echarts合成圖片的時候遇到了一些問題,綜合了很多網友的經驗,在此分享一下我的經歷,如有錯誤,歡迎指正。 1.在小程序中引入echarts組件請參考 echa...
閱讀 1896·2021-11-24 09:39
閱讀 2133·2021-09-22 15:50
閱讀 1990·2021-09-22 14:57
閱讀 698·2021-07-28 00:13
閱讀 1063·2019-08-30 15:54
閱讀 2355·2019-08-30 15:52
閱讀 2686·2019-08-30 13:07
閱讀 3786·2019-08-30 11:27