首页 > 其他分享 >攀枝花市地铁线路图 EChart

攀枝花市地铁线路图 EChart

时间:2023-01-09 20:38:52浏览次数:46  
标签:15 EChart normal color 线路图 攀枝花市 offset true 1000


攀枝花市地铁线路图 EChart_html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- <meta name="renderer" content="webkit"> -->
<title>攀枝花市地铁线路图 echart</title>
<script src="./dist/echarts.min.js"></script>
<style lang="scss" scoped>
.div_vidio{ position:fixed; top:0;width:100%;height:100%;}
.column2{ width:100%;height:100%;}
.box02{width:100%;height:100%;display: flex;}
.piechart06{flex:1;}
</style>
</head>
<body>
<div class="div_vidio">
<div class="column2">
<div class="box02">
<div class="piechart06" id="linechart"></div>
</div>
</div>
</div>
</body><script>
var myChart = echarts.init(document.querySelector('#linechart'), "light")
var options = get_options()
myChart.setOption(options) function get_options(){
var data = [
{
name: "",
tooltip: {
formatter: "{b}: 19999<br />"
},
symbolSize: 0.1,
value: [855, 888],
x: 800,
y: 400,
fixed: true,
// draggable: false,
category: 1,
label: {
color: "red",
position: 'bottom',
fontSize: 24,
fontWeight: 1000
},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},

//地铁一号线,站点间X轴坐标相差50,Y轴坐标相同
{
name: "森林公园",
tooltip: {
formatter: "{b}: 19999<br />"
},
symbol: 'circle',
symbolSize: [25, 25],
value: [5, 1000],
x: 800,
y: 400,
fixed: true,
// draggable: false,
category: 1,
label: {
color: "#FFF",
position: 'bottom',
},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "上木路",
x: 1000,
y: 1000,
value: [130, 830],
fixed: true,
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#fff",
position: 'bottom',
},
category: 1,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "自贸园",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'top',
},
value: [180, 600],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
}, {
name: "八桥",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'top',
},
value: [280, 600],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},

{
name: "枣园",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'top',
},
value: [380, 600],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "汉城路",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'bottom',
},
value: [430, 600],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "开运街",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'top',
},
value: [480, 600],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},

{
name: "玉祥门",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'top',
},
value: [580, 600],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "洒金桥",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'bottom',
},
value: [630, 520],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "北大街",
symbol: 'circle',
symbolSize: [20, 20],
label: {
color: "#efefef",
position: 'top',
},
value: [680, 520],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
offset: 0,
color: "#FF1493"
},
{
offset: 1,
color: "#0000FF"
}
])
}
}
},
{
name: "五路口",
symbol: 'circle',
symbolSize: [20, 20],
label: {
color: "#efefef",
position: 'bottom',
},
value: [750, 520],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
offset: 0,
color: "#FF1493"
},
{
offset: 1,
color: "#0000FF"
}
])
}
}
},

{
name: "康复路",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'bottom',
},
value: [830, 520],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "通久门",
symbol: 'circle',
symbolSize: [20, 20],
label: {
color: "#efefef",
position: 'top',
},
value: [880, 520],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 1, 0, [{
offset: 0,
color: "#FF1493"
},
{
offset: 1,
color: "#0000FF"
}
])
}
}
},
{
name: "万年路",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'bottom',
},
value: [950, 520],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "长乐坡",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'top',
},
value: [950, 320],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
}, {
name: "半坡",
symbol: 'circle',
symbolSize: [15, 15],
label: {
color: "#efefef",
position: 'top',
},
value: [950, 150],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},
{
name: "纺织城",
symbol: 'circle',
symbolSize: [25, 25],
label: {
color: "#efefef",
position: 'bottom',
},
value: [1050, 50],
x: 1000,
y: 1000,
fixed: true,
category: 2,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "#157eff"
},
{
offset: 1,
color: "#35c2ff"
}
])
}
}
},

//地铁三号线 //地铁四号线
];
var option = ({
title: {
text: '郑州地铁线路图',
textStyle: {
color: 'white',
fontSize: 20
},
x: 'center',
top: 10
},
//不设置背景颜色就是透明色
backgroundColor: '#000',
xAxis: {
show: false,
min: 0,
max: 1200,
// type: "value",
//开启x轴坐标
axisPointer: {
show: true
},
},
yAxis: {
show: false,
min: 0,
max: 1200,
// type: "value",
//开启y轴坐标
axisPointer: {
show: true
},
},
tooltip: {},
// legend: {
// show: false
// },
series: [{
type: "graph",
zlevel: 5,
draggable: false,
coordinateSystem: "cartesian2d", //使用二维的直角坐标系(也称笛卡尔坐标系) // edgeSymbolSize: [0, 8], //边两端的标记大小,可以是一个数组分别指定两端,也可以是单个统一指定
// edgeLabel: {
// normal: {
// textStyle: {
// fontSize: 60
// }
// }
// },
symbol: "rect",
symbolOffset: ["15%", 0], label: {
normal: {
show: true
}
},
data: data,
links: [{
source: "森林公园",
target: "上木路"
// lineStyle: {
// normal: {
// color: "#12b5d0",
//
// }
// }
},

{
source: "上木路",
target: "自贸园",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "自贸园",
target: "八桥",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "八桥",
target: "枣园",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
}, {
source: "枣园",
target: "汉城路",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "汉城路",
target: "开运街",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "开运街",
target: "玉祥门",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},

{
source: "玉祥门",
target: "洒金桥",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "洒金桥",
target: "北大街",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "北大街",
target: "五路口",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "五路口",
target: "康复路",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
}, {
source: "康复路",
target: "通久门",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "通久门",
target: "万年路",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "万年路",
target: "长乐坡",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},
{
source: "长乐坡",
target: "半坡",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},

{
source: "半坡",
target: "纺织城",
lineStyle: {
normal: {
// color: "#12b5d0",
}
}
},


],
lineStyle: {
normal: {
opacity: 0.6, //线条透明度
color: "#53B5EA",
curveness: 0, //站点间连线曲度,0表示直线
width: 10 //线条宽度
}
}
},
{
type: "lines",
coordinateSystem: "cartesian2d",
z: 1,
zlevel: 7,
animation: true,
effect: {
show: true,
period: 5,
trailLength: 0.71,
symbolSize: 14,
symbol: "circle",
loop: true,
color: 'yellow'
// color: "rgba(55,155,255,0.5)"
},
lineStyle: {
normal: {
// color: "green",
width: 0,
curveness: 0 //动画线路的曲度
}
}
,
//data: [{ //一号线
//coords: [
//[5, 600],
//[1000, 900],
//[1130, 600]
//]
// },
//{ //二号线
// coords: [
// [680, 50],
// [680, 1050]
// ]
//},
// { //三号线
// coords: [
// [280, 350],
// [1040, 1080]
// ]
// }
//]
},
]
}); return option;
}
</script>
</html>

标签:15,EChart,normal,color,线路图,攀枝花市,offset,true,1000
From: https://blog.51cto.com/u_14650780/5998726

相关文章

  • Echarts做仪表图-含HTML直接保存加个JS文件就可以用
    <!DOCTYPEhtml><html><head><metacharset="utf-8"><title>echarts</title><!--引入echarts.js--><scriptsrc="echarts.js"></script></head><bodyst......
  • 数据可视化|啥是pyecharts?
    数据可视化,是关于数据视觉表现形式的科学技术研究。通过某种概要形式抽提出数据的关键信息,包括相应信息单位的各种属性和变量。基本的数据可视化流程如下所示,分为工具的选取......
  • echarts tooltip pie {b}展示不全
    echartstooltippie{b}展示不全tooltip:{show:true,trigger:'item',formatter:'{b}:{c}{d}%'},原因:后端......
  • vue 使用echarts
    0.在vue内使用echarts可使用v-echart这个魔改版本,完全是可用的,但不在本次叙述范畴1.首先安装 npminstallecharts--save或者yarnaddecharts2.先上结论 ......
  • 8.2echarts展示数据
    ​ Echarts快速使用  <!DOCTYPEhtml><htmlstyle="height:100%"><head><metacharset="utf-8"><scripttype="text/javascript"src="js/......
  • 8.1echarts的引入
    认识Echarts ApacheECharts是一个正在由Apache孵化器赞助的Apache开源基金会孵化的项目。官方网址:https://echarts.apache.org/zh/index.html2018年3月份,全球著名......
  • 8.1echarts的引入
    认识Echarts ApacheECharts是一个正在由Apache孵化器赞助的Apache开源基金会孵化的项目。官方网址:https://echarts.apache.org/zh/index.html2018年3月份,全球著名......
  • 8.2echarts展示数据
    ​ Echarts快速使用  <!DOCTYPEhtml><htmlstyle="height:100%"><head><metacharset="utf-8"><scripttype="text/javascript"src="js/......
  • echarts 中的legend 配置
    legend:{show:true,//是否显示图例type:'category',//'plain':普通图例。缺省就是普通图例;'scroll':可滚动翻页的图例。当图例数量较多时可以使用......
  • 数据可视化大屏Echarts高级开发散点图实战案例分析(地图扩展插件bmap.min.js、散点图、
    系列文章目录​​燃,拿来即用!Echarts动态排名柱状图(自适应电脑和手机端)​​​​漏刻有时数据可视化Echarts组件开发(27):盒须图(箱线图)前后端php交互的实战案例​​​​漏......