成都地铁人流量动态监测

描述:当前是关于Echarts图表中的 示例。
 
            var stations = [ {name: '韦家碾',
x: 109.55,
y: -769.35,
itemStyle: { borderColor: '#EE1822', color: 'white' }, label: {rotate: 120},
category: '1号线' },
{ name: '升仙湖',
x: 109.55,
y: -669.35,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '火车北站',
x: -28.95,
y: -522.6,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '人民北路',
x: -28.95,
y: -411.6,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '文殊院',
x: -96.55,
y: -314.6,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '骡马市',
x: -170.8,
y: -240.6,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '天府广场',
x: -170.8,
y: -170.5,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '锦江宾馆',
x: -170.8,
y: -78.5,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '华西坝',
x: -170.8,
y: -5.95,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '省体育馆',
x: -170.8,
y: 69,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '倪家桥',
x: -170.8,
y: 120.15,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '桐梓林',
x: -170.8,
y: 181.7,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '火车南站',
x: -170.8,
y: 238.6,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '高新',
x: -229.85,
y: 380,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '金融城',
x: -229.85,
y: 453,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '孵化园',
x: -229.85,
y: 515.25,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '锦城广场',
x: -195.85,
y: 585.25,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '世纪城',
x: -161.85,
y: 645.5,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '天府三街',
x: -161.85,
y: 720,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '天府五街',
x: -161.85,
y: 795,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '华府大道',
x: -161.85,
y: 870,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '四河',
x: -161.85,
y: 945,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '广都',
x: -121.85,
y: 978,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '五根松',
x: -81.85,
y: 1018,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '华阳',
x: -161.85,
y: 1018,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '海昌路',
x: -161.85,
y: 1068,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '广福',
x: -161.85,
y: 1118,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '红石公园',
x: -161.85,
y: 1168,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '麓湖',
x: -161.85,
y: 1218,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '武汉路',
x: -161.85,
y: 1268,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '天府公园',
x: -161.85,
y: 1318,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '西博城',
x: -161.85,
y: 1368,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '广州路',
x: -161.85,
y: 1418,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '兴隆湖',
x: -161.85,
y: 1468,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '科学城',
x: -161.85,
y: 1518,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线' },
{ name: '犀浦',
x: -785.35,
y: -965,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '天河路',
x: -745.35,
y: -915,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '百草路',
x: -705.35,
y: -865,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '金周路',
x: -665.35,
y: -815,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '金科北路',
x: -620.35,
y: -765,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '迎宾大道',
x: -580.35,
y: -715,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '茶店子客运站',
x: -540.35,
y: -660,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '羊犀立交',
x: -591.35,
y: -516.3,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '一品天下',
x: -529.6,
y: -452.7,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '蜀汉路东',
x: -453.8,
y: -370,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '白果林',
x: -398.2,
y: -308.45,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '中医大省医院',
x: -352.5,
y: -258.95,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '通惠门',
x: -287.85,
y: -207.25,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '人民公园',
x: -224.5,
y: -188.6,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '春熙路',
x: -34,
y: -140,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '东门大桥',
x: 35.5,
y: -124.6,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '牛王庙',
x: 113.5,
y: -104.1,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '牛市口',
x: 196.15,
y: -82.6,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '东大路',
x: 227.7,
y: -62.95,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '塔子山公园',
x: 270.7,
y: -44.65,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '成都东客站',
x: 318.7,
y: -44.2,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '成渝立交',
x: 359.2,
y: 5.8,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '惠王陵',
x: 434.7,
y: 97.8,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '洪河',
x: 474.7,
y: 147,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '成都行政学院',
x: 519.7,
y: 200,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '大面铺',
x: 582.7,
y: 200,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '连山坡',
x: 648.7,
y: 200,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '界牌',
x: 715.7,
y: 200,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '书房',
x: 784.7,
y: 200,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '龙平路',
x: 850.7,
y: 200,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '龙泉驿',
x: 918.7,
y: 200,
itemStyle: { borderColor: '#85C73F', color: 'white' },
category: '2号线' },
{ name: '太平园',
x: -528,
y: 238.6,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '红牌楼',
x: -430,
y: 69,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '高升桥',
x: -345,
y: 69,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '衣冠庙',
x: -239,
y: 69,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '磨子桥',
x: -34,
y: 69,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '新南门',
x: -34,
y: -62,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '市二医院',
x: 2,
y: -193,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '红星桥',
x: 66,
y: -290,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '前锋路',
x: 123,
y: -377,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '李家沱',
x: 124,
y: -444,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '驷马桥',
x: 195,
y: -524,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '昭觉寺南路',
x: 242,
y: -575,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '动物园',
x: 292,
y: -632,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '熊猫大道',
x: 340,
y: -686,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '军区总医院',
x: 389,
y: -742,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '3号线' },
{ name: '马厂坝',
x: -894.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '凤凰大街',
x: -975.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '涌泉',
x: -1045.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '光华公园',
x: -1106.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '南熏大道',
x: -1170.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '凤溪河',
x: -1236.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '杨柳河',
x: -1299.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '万盛',
x: -1368.5,
y: -260.7,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '非遗博览园',
x: -820,
y: -262,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '蔡桥',
x: -724,
y: -262,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '中坝',
x: -664,
y: -262,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '成都西站',
x: -604,
y: -261,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '清江西路',
x: -560,
y: -260,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '文化宫',
x: -530,
y: -260,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '西南财大',
x: -456.5,
y: -260,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '草堂北路',
x: -394.5,
y: -259,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '宽窄巷子',
x: -258,
y: -242,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '太升南路',
x: -82,
y: -216,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '玉双路',
x: 124,
y: -160,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '双桥路',
x: 192,
y: -141,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '万年场',
x: 255,
y: -131,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '槐树店',
x: 319.2,
y: -110.8,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '来龙',
x: 480.2,
y: -98.8,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '十陵',
x: 552.2,
y: -97.8,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '成都大学',
x: 621.2,
y: -97.8,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '明蜀王陵',
x: 683.2,
y: -97.8,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '西河',
x: 745.2,
y: -97.8,
itemStyle: { borderColor: '#4E2C8D', color: 'white' },
category: '4号线' },
{ name: '簇锦',
x: -580.6,
y: 333.9,
itemStyle: { borderColor: '#B8A8CF', color: 'white' },
category: '10号线' },
{ name: '华兴',
x: -624.6,
y: 408.9,
itemStyle: { borderColor: '#B8A8CF', color: 'white' },
category: '10号线' },
{ name: '金花',
x: -731.1,
y: 482.4,
itemStyle: { borderColor: '#B8A8CF', color: 'white' },
category: '10号线' },
{ name: '双流机场1航站楼',
x: -839.6,
y: 562,
itemStyle: { borderColor: '#B8A8CF', color: 'white' },
category: '10号线' },
{ name: '双流机场2航站楼',
x: -882.9,
y: 654.2,
itemStyle: { borderColor: '#B8A8CF', color: 'white' },
category: '10号线' },
{ name: '高朋大道',
x: -445.8,
y: 238.6,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '神仙树',
x: -353.5,
y: 238.6,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '三瓦窑',
x: -52.3,
y: 238.6,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '琉璃场',
x: 56.7,
y: 184.9,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '四川师大',
x: 176.3,
y: 128.6,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '狮子山',
x: 258.6,
y: 88.4,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '大观',
x: 318.4,
y: 59.7,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '迎晖路',
x: 319.3,
y: -80.6,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '双店路',
x: 319.6,
y: -201.9,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '崔家店',
x: 319.6,
y: -288.9,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '理工大学',
x: 318.6,
y: -368.7,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '二仙桥',
x: 318.6,
y: -453.4,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '八里庄',
x: 318.1,
y: -522.3,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '府青路',
x: 254.2,
y: -522.3,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '北站西二路',
x: -92.3,
y: -523,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '九里堤',
x: -173.6,
y: -523.3,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '西南交大',
x: -258.5,
y: -523.3,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '花照壁',
x: -335.1,
y: -523.3,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '茶店子',
x: -409.6,
y: -523.7,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '金沙博物馆',
x: -529.8,
y: -349.9,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '东坡路',
x: -529.7,
y: -150.3,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '龙爪堰',
x: -529.7,
y: -43.3,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' },
{ name: '武侯大道',
x: -529.7,
y: 75.6,
itemStyle: { borderColor: '#F26F1F', color: 'white' },
category: '7号线' } ]

var links = [ 
    { source: '韦家碾', target: '升仙湖', lineStyle: { color: '#EE1822' } },
{ source: '升仙湖',
  target: '火车北站',
  lineStyle: { color: '#EE1822' } },
{ source: '火车北站',
  target: '人民北路',
  lineStyle: { color: '#EE1822' } },
{ source: '人民北路',
  target: '文殊院',
  lineStyle: { color: '#EE1822' } },
{ source: '文殊院', target: '骡马市', lineStyle: { color: '#EE1822' } },
{ source: '骡马市',
  target: '天府广场',
  lineStyle: { color: '#EE1822' } },
{ source: '天府广场',
  target: '锦江宾馆',
  lineStyle: { color: '#EE1822' } },
{ source: '锦江宾馆',
  target: '华西坝',
  lineStyle: { color: '#EE1822' } },
{ source: '华西坝',
  target: '省体育馆',
  lineStyle: { color: '#EE1822' } },
{ source: '省体育馆',
  target: '倪家桥',
  lineStyle: { color: '#EE1822' } },
{ source: '倪家桥', target: '桐梓林', lineStyle: { color: '#EE1822' } },
{ source: '桐梓林',
  target: '火车南站',
  lineStyle: { color: '#EE1822' } },
{ source: '火车南站', target: '高新', lineStyle: { color: '#EE1822' } },
{ source: '高新', target: '金融城', lineStyle: { color: '#EE1822' } },
{ source: '金融城', target: '孵化园', lineStyle: { color: '#EE1822' } },
{ source: '孵化园',
  target: '锦城广场',
  lineStyle: { color: '#EE1822' } },
{ source: '锦城广场',
  target: '世纪城',
  lineStyle: { color: '#EE1822' } },
{ source: '世纪城',
  target: '天府三街',
  lineStyle: { color: '#EE1822' } },
{ source: '天府三街',
  target: '天府五街',
  lineStyle: { color: '#EE1822' } },
{ source: '天府五街',
  target: '华府大道',
  lineStyle: { color: '#EE1822' } },
{ source: '华府大道', target: '四河', lineStyle: { color: '#EE1822' } },
{ source: '四河', target: '广都', lineStyle: { color: '#EE1822' } },
{ source: '广都', target: '五根松', lineStyle: { color: '#EE1822' } },
{ source: '韦家碾', target: '升仙湖', lineStyle: { color: '#EE1822' } },
{ source: '升仙湖',
  target: '火车北站',
  lineStyle: { color: '#EE1822' } },
{ source: '火车北站',
  target: '人民北路',
  lineStyle: { color: '#EE1822' } },
{ source: '人民北路',
  target: '文殊院',
  lineStyle: { color: '#EE1822' } },
{ source: '文殊院', target: '骡马市', lineStyle: { color: '#EE1822' } },
{ source: '骡马市',
  target: '天府广场',
  lineStyle: { color: '#EE1822' } },
{ source: '天府广场',
  target: '锦江宾馆',
  lineStyle: { color: '#EE1822' } },
{ source: '锦江宾馆',
  target: '华西坝',
  lineStyle: { color: '#EE1822' } },
{ source: '华西坝',
  target: '省体育馆',
  lineStyle: { color: '#EE1822' } },
{ source: '省体育馆',
  target: '倪家桥',
  lineStyle: { color: '#EE1822' } },
{ source: '倪家桥', target: '桐梓林', lineStyle: { color: '#EE1822' } },
{ source: '桐梓林',
  target: '火车南站',
  lineStyle: { color: '#EE1822' } },
{ source: '火车南站', target: '高新', lineStyle: { color: '#EE1822' } },
{ source: '高新', target: '金融城', lineStyle: { color: '#EE1822' } },
{ source: '金融城', target: '孵化园', lineStyle: { color: '#EE1822' } },
{ source: '孵化园',
  target: '锦城广场',
  lineStyle: { color: '#EE1822' } },
{ source: '锦城广场',
  target: '世纪城',
  lineStyle: { color: '#EE1822' } },
{ source: '世纪城',
  target: '天府三街',
  lineStyle: { color: '#EE1822' } },
{ source: '天府三街',
  target: '天府五街',
  lineStyle: { color: '#EE1822' } },
{ source: '天府五街',
  target: '华府大道',
  lineStyle: { color: '#EE1822' } },
{ source: '华府大道', target: '四河', lineStyle: { color: '#EE1822' } },
{ source: '四河', target: '华阳', lineStyle: { color: '#EE1822' } },
{ source: '华阳', target: '海昌路', lineStyle: { color: '#EE1822' } },
{ source: '海昌路', target: '广福', lineStyle: { color: '#EE1822' } },
{ source: '广福', target: '红石公园', lineStyle: { color: '#EE1822' } },
{ source: '红石公园', target: '麓湖', lineStyle: { color: '#EE1822' } },
{ source: '麓湖', target: '武汉路', lineStyle: { color: '#EE1822' } },
{ source: '武汉路',
  target: '天府公园',
  lineStyle: { color: '#EE1822' } },
{ source: '天府公园',
  target: '西博城',
  lineStyle: { color: '#EE1822' } },
{ source: '西博城', target: '广州路', lineStyle: { color: '#EE1822' } },
{ source: '广州路', target: '兴隆湖', lineStyle: { color: '#EE1822' } },
{ source: '兴隆湖', target: '科学城', lineStyle: { color: '#EE1822' } },
{ source: '犀浦', target: '天河路', lineStyle: { color: '#85C73F' } },
{ source: '天河路', target: '百草路', lineStyle: { color: '#85C73F' } },
{ source: '百草路', target: '金周路', lineStyle: { color: '#85C73F' } },
{ source: '金周路',
  target: '金科北路',
  lineStyle: { color: '#85C73F' } },
{ source: '金科北路',
  target: '迎宾大道',
  lineStyle: { color: '#85C73F' } },
{ source: '迎宾大道',
  target: '茶店子客运站',
  lineStyle: { color: '#85C73F' } },
{ source: '茶店子客运站',
  target: '羊犀立交',
  lineStyle: { color: '#85C73F' } },
{ source: '羊犀立交',
  target: '一品天下',
  lineStyle: { color: '#85C73F' } },
{ source: '一品天下',
  target: '蜀汉路东',
  lineStyle: { color: '#85C73F' } },
{ source: '蜀汉路东',
  target: '白果林',
  lineStyle: { color: '#85C73F' } },
{ source: '白果林',
  target: '中医大省医院',
  lineStyle: { color: '#85C73F' } },
{ source: '中医大省医院',
  target: '通惠门',
  lineStyle: { color: '#85C73F' } },
{ source: '通惠门',
  target: '人民公园',
  lineStyle: { color: '#85C73F' } },
{ source: '人民公园',
  target: '天府广场',
  lineStyle: { color: '#85C73F' } },
{ source: '天府广场',
  target: '春熙路',
  lineStyle: { color: '#85C73F' } },
{ source: '春熙路',
  target: '东门大桥',
  lineStyle: { color: '#85C73F' } },
{ source: '东门大桥',
  target: '牛王庙',
  lineStyle: { color: '#85C73F' } },
{ source: '牛王庙', target: '牛市口', lineStyle: { color: '#85C73F' } },
{ source: '牛市口', target: '东大路', lineStyle: { color: '#85C73F' } },
{ source: '东大路',
  target: '塔子山公园',
  lineStyle: { color: '#85C73F' } },
{ source: '塔子山公园',
  target: '成都东客站',
  lineStyle: { color: '#85C73F' } },
{ source: '成都东客站',
  target: '成渝立交',
  lineStyle: { color: '#85C73F' } },
{ source: '成渝立交',
  target: '惠王陵',
  lineStyle: { color: '#85C73F' } },
{ source: '惠王陵', target: '洪河', lineStyle: { color: '#85C73F' } },
{ source: '洪河',
  target: '成都行政学院',
  lineStyle: { color: '#85C73F' } },
{ source: '成都行政学院',
  target: '大面铺',
  lineStyle: { color: '#85C73F' } },
{ source: '大面铺', target: '连山坡', lineStyle: { color: '#85C73F' } },
{ source: '连山坡', target: '界牌', lineStyle: { color: '#85C73F' } },
{ source: '界牌', target: '书房', lineStyle: { color: '#85C73F' } },
{ source: '书房', target: '龙平路', lineStyle: { color: '#85C73F' } },
{ source: '龙平路', target: '龙泉驿', lineStyle: { color: '#85C73F' } },
{ source: '太平园', target: '红牌楼', lineStyle: { color: '#FDD303' } },
{ source: '红牌楼', target: '高升桥', lineStyle: { color: '#FDD303' } },
{ source: '高升桥', target: '衣冠庙', lineStyle: { color: '#FDD303' } },
{ source: '衣冠庙',
  target: '省体育馆',
  lineStyle: { color: '#FDD303' } },
{ source: '省体育馆',
  target: '磨子桥',
  lineStyle: { color: '#FDD303' } },
{ source: '磨子桥', target: '新南门', lineStyle: { color: '#FDD303' } },
{ source: '新南门', target: '春熙路', lineStyle: { color: '#FDD303' } },
{ source: '春熙路',
  target: '市二医院',
  lineStyle: { color: '#FDD303' } },
{ source: '市二医院',
  target: '红星桥',
  lineStyle: { color: '#FDD303' } },
{ source: '红星桥', target: '前锋路', lineStyle: { color: '#FDD303' } },
{ source: '前锋路', target: '李家沱', lineStyle: { color: '#FDD303' } },
{ source: '李家沱', target: '驷马桥', lineStyle: { color: '#FDD303' } },
{ source: '驷马桥',
  target: '昭觉寺南路',
  lineStyle: { color: '#FDD303' } },
{ source: '昭觉寺南路',
  target: '动物园',
  lineStyle: { color: '#FDD303' } },
{ source: '动物园',
  target: '熊猫大道',
  lineStyle: { color: '#FDD303' } },
{ source: '熊猫大道',
  target: '军区总医院',
  lineStyle: { color: '#FDD303' } },
{ source: '马厂坝',
  target: '凤凰大街',
  lineStyle: { color: '#4E2C8D' } },
{ source: '凤凰大街', target: '涌泉', lineStyle: { color: '#4E2C8D' } },
{ source: '涌泉', target: '光华公园', lineStyle: { color: '#4E2C8D' } },
{ source: '光华公园',
  target: '南熏大道',
  lineStyle: { color: '#4E2C8D' } },
{ source: '南熏大道',
  target: '凤溪河',
  lineStyle: { color: '#4E2C8D' } },
{ source: '凤溪河', target: '杨柳河', lineStyle: { color: '#4E2C8D' } },
{ source: '杨柳河', target: '万盛', lineStyle: { color: '#4E2C8D' } },
{ source: '万盛',
  target: '非遗博览园',
  lineStyle: { color: '#4E2C8D' } },
{ source: '非遗博览园',
  target: '蔡桥',
  lineStyle: { color: '#4E2C8D' } },
{ source: '蔡桥', target: '中坝', lineStyle: { color: '#4E2C8D' } },
{ source: '中坝', target: '成都西站', lineStyle: { color: '#4E2C8D' } },
{ source: '成都西站',
  target: '清江西路',
  lineStyle: { color: '#4E2C8D' } },
{ source: '清江西路',
  target: '文化宫',
  lineStyle: { color: '#4E2C8D' } },
{ source: '文化宫',
  target: '西南财大',
  lineStyle: { color: '#4E2C8D' } },
{ source: '西南财大',
  target: '草堂北路',
  lineStyle: { color: '#4E2C8D' } },
{ source: '草堂北路',
  target: '中医大省医院',
  lineStyle: { color: '#4E2C8D' } },
{ source: '中医大省医院',
  target: '宽窄巷子',
  lineStyle: { color: '#4E2C8D' } },
{ source: '宽窄巷子',
  target: '骡马市',
  lineStyle: { color: '#4E2C8D' } },
{ source: '骡马市',
  target: '太升南路',
  lineStyle: { color: '#4E2C8D' } },
{ source: '太升南路',
  target: '市二医院',
  lineStyle: { color: '#4E2C8D' } },
{ source: '市二医院',
  target: '玉双路',
  lineStyle: { color: '#4E2C8D' } },
{ source: '玉双路', target: '双桥路', lineStyle: { color: '#4E2C8D' } },
{ source: '双桥路', target: '万年场', lineStyle: { color: '#4E2C8D' } },
{ source: '万年场', target: '槐树店', lineStyle: { color: '#4E2C8D' } },
{ source: '槐树店', target: '来龙', lineStyle: { color: '#4E2C8D' } },
{ source: '来龙', target: '十陵', lineStyle: { color: '#4E2C8D' } },
{ source: '十陵', target: '成都大学', lineStyle: { color: '#4E2C8D' } },
{ source: '成都大学',
  target: '明蜀王陵',
  lineStyle: { color: '#4E2C8D' } },
{ source: '明蜀王陵', target: '西河', lineStyle: { color: '#4E2C8D' } },
{ source: '太平园', target: '簇锦', lineStyle: { color: '#B8A8CF' } },
{ source: '簇锦', target: '华兴', lineStyle: { color: '#B8A8CF' } },
{ source: '华兴', target: '金花', lineStyle: { color: '#B8A8CF' } },
{ source: '金花',
  target: '双流机场1航站楼',
  lineStyle: { color: '#B8A8CF' } },
{ source: '双流机场1航站楼',
  target: '双流机场2航站楼',
  lineStyle: { color: '#B8A8CF' } },
{ source: '高朋大道',
  target: '神仙树',
  lineStyle: { color: '#F26F1F' } },
{ source: '神仙树',
  target: '火车南站',
  lineStyle: { color: '#F26F1F' } },
{ source: '火车南站',
  target: '三瓦窑',
  lineStyle: { color: '#F26F1F' } },
{ source: '三瓦窑', target: '琉璃场', lineStyle: { color: '#F26F1F' } },
{ source: '琉璃场',
  target: '四川师大',
  lineStyle: { color: '#F26F1F' } },
{ source: '四川师大',
  target: '狮子山',
  lineStyle: { color: '#F26F1F' } },
{ source: '狮子山', target: '大观', lineStyle: { color: '#F26F1F' } },
{ source: '大观',
  target: '成都东客站',
  lineStyle: { color: '#F26F1F' } },
{ source: '成都东客站',
  target: '迎晖路',
  lineStyle: { color: '#F26F1F' } },
{ source: '迎晖路', target: '槐树店', lineStyle: { color: '#F26F1F' } },
{ source: '槐树店', target: '双店路', lineStyle: { color: '#F26F1F' } },
{ source: '双店路', target: '崔家店', lineStyle: { color: '#F26F1F' } },
{ source: '崔家店',
  target: '理工大学',
  lineStyle: { color: '#F26F1F' } },
{ source: '理工大学',
  target: '二仙桥',
  lineStyle: { color: '#F26F1F' } },
{ source: '二仙桥', target: '八里庄', lineStyle: { color: '#F26F1F' } },
{ source: '八里庄', target: '府青路', lineStyle: { color: '#F26F1F' } },
{ source: '府青路', target: '驷马桥', lineStyle: { color: '#F26F1F' } },
{ source: '驷马桥',
  target: '火车北站',
  lineStyle: { color: '#F26F1F' } },
{ source: '火车北站',
  target: '北站西二路',
  lineStyle: { color: '#F26F1F' } },
{ source: '北站西二路',
  target: '九里堤',
  lineStyle: { color: '#F26F1F' } },
{ source: '九里堤',
  target: '西南交大',
  lineStyle: { color: '#F26F1F' } },
{ source: '西南交大',
  target: '花照壁',
  lineStyle: { color: '#F26F1F' } },
{ source: '花照壁', target: '茶店子', lineStyle: { color: '#F26F1F' } },
{ source: '茶店子',
  target: '一品天下',
  lineStyle: { color: '#F26F1F' } },
{ source: '一品天下',
  target: '金沙博物馆',
  lineStyle: { color: '#F26F1F' } },
{ source: '金沙博物馆',
  target: '文化宫',
  lineStyle: { color: '#F26F1F' } },
{ source: '文化宫', target: '东坡路', lineStyle: { color: '#F26F1F' } },
{ source: '东坡路', target: '龙爪堰', lineStyle: { color: '#F26F1F' } },
{ source: '龙爪堰',
  target: '武侯大道',
  lineStyle: { color: '#F26F1F' } },
{ source: '武侯大道',
  target: '太平园',
  lineStyle: { color: '#F26F1F' } } ]

var lineNames = []

for (var index = 0; index < stations.length - 1; index++) {
    if (lineNames.indexOf(stations[index].category) == -1) {
        lineNames.push(stations[index].category)
    }
}

var legend = [
    {
        data: lineNames 
    }
]

var categories = lineNames.map(lineName => {
    return {
        name: lineName
    }
})

var rdm = function(min, max){
    return Math.floor(Math.random() * (max - min)) + min;
}

// 组装模拟数据
// 一天的客流统计,假设按15分钟统计一次,一天可以更新96次,每次间隔是15分钟
// 我们就需要生成96分数据来模拟一天的数据变化
var stations_lq = [];
var stations_len = stations.length;
for(let i=0; i<96; i++){
    let lq_tmp = {};
    // 我们需要时针和分针分别表示,好实用在时钟上,所以需要拆分出时和分、以及上午和下午
    // 假设以0点0分上午开始
    // i除以4的整数就是小时,小于12是am,大于12是pm
    // i除以4的余数*15就是分钟
    let t_hour = parseInt(i/4);
    lq_tmp.time = {hours: t_hour >= 12? t_hour-12 : t_hour, hoursdel: t_hour >=12? i/4-12:i/4, minutes: 15*(i%4), apm: t_hour<12?'am':'pm'};
    // 生成当前时间的模拟数据
    lq_tmp.lq = [];
    stations.forEach(function(v){
        vt = JSON.parse(JSON.stringify(v));
        vt.value = rdm(60,200);
        vt.itemStyle.color = v.itemStyle.borderColor;
        vt.itemStyle.borderWidth = 0;
        vt.itemStyle.opacity = 0.75;
        lq_tmp.lq.push(vt);
    });
    stations_lq.push(lq_tmp);
}

myChart.on('click', function (params) {
    console.log(params);
});

option = {
    title: {
        text: '成都地铁客流示意图'
    },
    backgroundColor:'#fff',
    color: ['#EE1822', '#85C73F', '#FDD303', '#4E2C8D', '#8F57A2', '#D7156B', '#F26F1F', '#009DD7', '#67CCF6', '#B8A8CF', '#7C1F31', '#54ae11', '#E77DAD', '#78d6cd', '#bc796f'],
    grid:[
        {left:50, top:50, width: 200, height: 200, show:true, containLabel:false, backgroundColor:'#fafafb',  borderColor:'#eee'}, // 放时钟背景,左上角
        {left:0, top:0, width:'100%', height: '100%'} // 放主图
    ],
    xAxis:[
        {gridIndex: 0, show:false},
        {gridIndex: 1, show:false}
    ],
    yAxis:[
        {gridIndex: 0, show:false},
        {gridIndex: 1, show:false}
    ],
    tooltip: {},
    legend: legend,
    animationDurationUpdate: 1500,
    animationEasingUpdate: 'quinticInOut',
    series: [
        // 用关系图实现地铁底图,实际应用建议用geo坐标
        {
            type: 'graph',
            layout: 'none',
            xAxis:1,
            yAxis:1,
            symbolSize: 3,
            roam: false,
            label: {
                    show: false,
                    rotate: '30', 
                    color: 'black',
                    position: 'right'
            },
            focusNodeAdjacency: true,
            edgeSymbol: ['none', 'none'],
            edgeSymbolSize: [4, 6],
            edgeLabel: {
                normal: {
                    textStyle: {
                        fontSize: 20
                    }
                }
            },
            data: stations,
            links: links,
            categories: categories,
            lineStyle: {
                normal: {
                    opacity: 0.9,
                    width: 5,
                    curveness: 0
                }
            }
        },
        // 在同样的关系图坐标上,展示数据大小。
        {
            type: 'graph',
            xAxis:1,
            yAxis:1,
            symbolSize: function (params) {
                return params/10;
            },
            symbol:'circle',
            data: stations_lq[0]['lq']
        },
        // 绘制时钟, 重叠到时钟的坐标区域(如果不要背景,也可以不划分布局)
        // 表盘和时针
        {
            type: 'gauge',
            center: [150,150],
            radius: '80px',
            startAngle: 90,
            endAngle:-269.9999,
            min:0,
            max:12,
            splitNumber: 12,
            animation: 0,
            // 表圈线
            axisLine:{
                lineStyle: {
                    width:1,
                    color:[[1,'#ccc']],
                }
            },
            // 小时刻度
            splitLine:{
                length: 8,
                lineStyle: {
                    width:2,
                    color:'#aaa',
                }
            },
            // 分刻度
            axisTick:{
                length: 5,
                lineStyle: {
                    width: 0.5,
                    color:'#aaa',
                }
            },
            //小时标签为0时不显示
            axisLabel:{
                formatter: function(value){
                    return value==0?'':value;
                }
            },
            // 时针
            pointer:{
                width: 5,
                length: '50%'
            },
            title:{
                color: '#ccc',
                fontSize: 12
            },
            data: [{value: stations_lq[0]['time']['hoursdel'], name: stations_lq[0]['time']['hours']+': '+stations_lq[0]['time']['minutes']+' '+stations_lq[0]['time']['apm']}],
            detail: {formatter: ' '}
        },
        //分针
        {
            type: 'gauge',
            center: [150,150],
            radius: '80px',
            startAngle: 90,
            endAngle:-269.9999,
            min:0,
            max:60,
            splitNumber: 60,
            animation: 0,
            axisLine:{
                show:false
            },
            splitLine:{
                show:false
            },
            axisTick:{
                show: false
            },
            axisLabel:{
                show:false
            },
            // 分针
            pointer:{
                width: 2,
                length: '80%'
            },
            itemStyle:{
                color: '#aaa'
            },
            data: [{value: stations_lq[0]['time']['minutes']}],
            detail:{
                show: false
            }
        }
    ]
}

var clock_ll = 96; //加入15分钟一段统计,24小时一共96段数据。
var clock_data_i = 0; //起始数据段
var clock_timer = setInterval(function(){
    option.series[1].data = stations_lq[clock_data_i]['lq'];
    option.series[2].data[0].value = stations_lq[clock_data_i]['time']['hoursdel'];
    option.series[2].data[0].name = stations_lq[clock_data_i]['time']['hours']+': '+stations_lq[clock_data_i]['time']['minutes']+' '+stations_lq[clock_data_i]['time']['apm'];
    option.series[3].data[0].value = stations_lq[clock_data_i]['time']['minutes'];
    myChart.setOption(option,true);
    clock_data_i++;
    if(clock_data_i >= 96){
        clearInterval(clock_timer);
    }
},1000);