前端大屏職業專業智慧分析大數據可視化大屏html模板源碼

可視化大屏模板案例

在線演示地址     http://yuanbaoshuju.com/

頁面部分代碼

<!DOCTYPE html>

<html lang="zh-CN">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
        <title>數據分析維度統計</title>
        <link rel="stylesheet" href="css/app.css" />
        <script src="js/echarts.min.js"></script>
        <script src="js/china.js"></script>
    </head>
    
    <body class="biao2">
        <div class="header">
            <h1 class="header-title" style="color: #FFFFFF;">數據分析維度統計</h1>
        </div>
        <div class="wrapper">
            <div class="content">
                <div class="col col-l">
                    <div class="xpanel-wrapper xpanel-wrapper-40">
                        <div class="xpanel xpanel-l-t Bj">
                            <div class="title">職業測評</div>
                            <div class="xslb" id="xslb" style="width: 100%;height: 90%;" ></div>
                        </div>
                    </div>
                    <div class="xpanel-wrapper xpanel-wrapper-60">
                        <div class="xpanel xpanel-l-b Bj">
                            <div class="title">職業人格</div>
                            <div class="tu" id="tu1" style="width: 100%;height: 90%;" ></div>
                        </div>
                    </div>
                </div>
                <div class="col col-c">
                    <div class="xpanel-wrapper xpanel-wrapper-65">
                        <div class="xpanel DiTu1 Bj">
                            <div class="title">畢業生去向</div>
                            <div class="TuBiao" id="DiTu1" style="width: 100%;height: 90%;" ></div>
                        </div>
                    </div>
                    
                    <div class="xpanel-wrapper xpanel-wrapper-35">
                        <div class="xpanel xpanel-c-b Bj">
                            <div class="gzjg">
                                <div class="title">畢業生工資結構展示</div>
                                <div class="sdtu" id="sdtu" style="width: 100%;height: 84%;" ></div>
                            </div>
                            <div class="jxqk">
                                <div class="title">獎項情況統計</div>
                                <div class="tu" id="tu8" style="width: 100%;height: 84%;" ></div>
                            </div>
                            
                        </div>
                    </div>
                </div>
                <div class="col col-r">
                    <div class="xpanel-wrapper xpanel-wrapper-25">
                        <div class="xpanel xpanel-r-t Bj">
                            <div class="title">職業能力</div>
                            <div class="xslb" id="tu7" style="width: 100%;height: 90%;" ></div>
                        </div>
                    </div>
                    <div class="xpanel-wrapper xpanel-wrapper-30">
                        <div class="xpanel xpanel-r-m Bj">
                            <div class="title">量表測評</div>
                            <div class="tu" id="tu6" style="width: 100%;height: 90%;" ></div>
                        </div>
                    </div>
                    <div class="xpanel-wrapper xpanel-wrapper-45">
                        <div class="xpanel xpanel-r-b Bj">
                            <div class="title">就業率及就業範疇展示</div>
                            <div class="tu" id="tu5" style="width: 100%;height: 90%;" ></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script type="text/javascript">
        var myDiTu1 = echarts.init(document.getElementById('DiTu1'));
        var myxslb = echarts.init(document.getElementById('xslb'));
        var mysdtu = echarts.init(document.getElementById('sdtu'));
        var mytu4 = echarts.init(document.getElementById('tu1'));
        var mytu5 = echarts.init(document.getElementById('tu5'));
        var mytu6 = echarts.init(document.getElementById('tu6'));
        var mytu7 = echarts.init(document.getElementById('tu7'));
        var mytu8 = echarts.init(document.getElementById('tu8'));

    var colorArr=["#218de0", "#01cbb3", "#85e647", "#5d5cda", "#05c5b0", "#c29927"];
    var colorAlpha=['rgba(60,170,211,0.1)','rgba(1,203,179,0.1)','rgba(133,230,71,0.1)','rgba(93,92,218,0.1)','rgba(5,197,176,0.1)','rgba(194,153,39,0.1)']
    var option1 = {
          // backgroundColor: "#05224d",
          tooltip: {},
          grid: {
              top: '8%',
              left: '4%',
              right: '4%',
              bottom: '4%',
              containLabel: true,
          },
          // legend: {
          //     itemGap: 50,
          //     data: ['社團人數'],
          //     textStyle: {
          //         color: '#f9f9f9',
          //         borderColor: '#fff'
          //     },
          // },
          xAxis: [{
              type: 'category',
              boundaryGap: true,
              axisLine: { //座標軸軸線相關設置。數學上的x軸
                  show: true,
                  lineStyle: {
                      color: '#0a3256',
                      fontSize: 12,
                  },
              },
              axisLabel: { //座標軸刻度標籤的相關設置
                  textStyle: {
                      color: '#d1e6eb',
                      margin: 15,
                      fontSize: 12,
                  },
              },
              axisTick: {
                  show: false,
              },
              data: ['舞蹈社' ,'書畫社','籃球社','乒乓球社','動漫社','歌詠社'],
          }],
          yAxis: [{
              type: 'value',
              min: 0,
              // max: 140,
              splitNumber: 7,
              splitLine: {
                  show: true,
                  lineStyle: {
                      color: '#0a3256'
                  }
              },
              axisLine: {
                  show: false,
              },
              axisLabel: {
                  margin: 20,
                  textStyle: {
                      color: '#d1e6eb',
      
                  },
              },
              axisTick: {
                  show: false,
              },
          }],
          series: [{
            
            //   name: '社團人數',
              type: 'bar',
              barWidth: 16,
              tooltip: {
                  show: false
              },
               label: {
                   normal: {
                  show: true,
                  position: 'top',
                  textStyle: {
                      color: '#fff',
                  },
                  }
              },
              itemStyle: {
                      normal: {
                          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                              offset: 0,
                              color: '#41E1D4' // 0% 處的顏色
                          }, {
                              offset: 1,
                              color: '#10A7DB' // 100% 處的顏色
                          }], false),
                          barBorderRadius: [30, 30, 0, 0],
                          shadowBlur: 4,
                      }
                  },
             data: [200, 382, 102, 267, 186, 315]
          }]
      };
        
    
    var option4 = {
    // backgroundColor: '#101736',
    color:['#4A99FF', '#4BFFFC'], //顏色
    legend: {
        orient:'vertical',
        icon: 'circle', //圖例形狀
        data: ['車輛數'],
        bottom:35,
        right:40,
        itemWidth: 14, // 圖例標記的圖形寬度。[ default: 25 ]
        itemHeight: 14, // 圖例標記的圖形高度。[ default: 14 ]
        itemGap: 21, // 圖例每項之間的間隔。[ default: 10 ]橫向佈局時爲水平間隔,縱向佈局時爲縱向間隔。
        textStyle: {
            fontSize: 14,
            color: '#00E4FF',
        },
    },
    radar: {
        // shape: 'circle',
        name: {
            textStyle: {
                color: '#fff',
                fontSize: 16
            },
        },
        indicator:  [{
        text: ' 活潑',
        max: 6000,
    },
    {
        text: '憂慮',
        max: 5000
    },
    {
        text: '穩定',
        max: 5000
    },
    {
        text: '情感',
        max: 5000,
        //  axisLabel: {show: true, textStyle: {fontSize: 18, color: '#333'}}
    },
    {
        text: '自律',
        max: 5000
    },
    {
        text: '聰慧',
        max: 5000
    }
],
        splitArea: { // 座標軸在 grid 區域中的分隔區域,默認不顯示。
            show: true,
            areaStyle: { // 分隔區域的樣式設置。
                color: ['rgba(255,255,255,0)', 'rgba(255,255,255,0)'], // 分隔區域顏色。分隔區域會按數組中顏色的順序依次循環設置顏色。默認是一個深淺的間隔色。
            }
        },
        axisLine: { //指向外圈文本的分隔線樣式
            lineStyle: {
                color: '#153269'
            }
        },
        splitLine: {
            lineStyle: {
                color: '#113865', // 分隔線顏色
                width: 1, // 分隔線線寬
            }
        },
    },
    series: [{
        type: 'radar',
        symbolSize: 8,
        // symbol: 'angle',
        data: [{
        value: [4300, 4700, 3600, 3900, 3800, 4200],
        name: ['車輛數'],
        itemStyle: {
            normal: {
                lineStyle: {
                    color: '#4A99FF',
                    // shadowColor: '#4A99FF',
                    // shadowBlur: 10,
                },
                shadowColor: '#4A99FF',
                shadowBlur: 10,
            },
        },
        areaStyle: {
                normal: { // 單項區域填充樣式
                    color: {
                        type: 'linear',
                        x: 0, //右
                        y: 0, //下
                        x2: 1, //左
                        y2: 1, //上
                        colorStops: [{
                            offset: 0,
                            color: '#4A99FF'
                        }, {
                            offset: 0.5,
                            color: 'rgba(0,0,0,0)'
                        }, {
                            offset: 1,
                            color: '#4A99FF'
                        }],
                        globalCoord: false
                    },
                    opacity: 1 // 區域透明度
                }
            }
    },
    
],
    }]
};

  var option7= {
      // backgroundColor: '#00265f',
      tooltip : {
          trigger: 'axis',
          axisPointer : {            // 座標軸指示器,座標軸觸發有效
              type : 'shadow'        // 默認爲直線,可選爲:'line' | 'shadow'
          }
      },
      legend: {
          data:['強','弱'],
          textStyle: {
              color: '#fff'
          }
      },
      grid: {
          top: '4%',
          left: '4%',
          right: '4%',
          bottom: '14%',
          containLabel: true
      },
      xAxis : [
          {
              type : 'category',
              data : ['人際交往能力','創造能力 ','適應能力','談判能力'],
              splitLine: {
                  show: false
              },
              axisLine: {
                  lineStyle: {
                      color: '#fff',
                  }
              },
              axisLabel: {
                  color:'#fff',
              }
          }
      ],
      yAxis : [
          {
              type : 'value',
              splitLine: {
                  show: false
              },
              axisLine: {
                  lineStyle: {
                      color: '#fff',
                  }
              }
          }
      ],
      series : [
          {
              name:'強',
              type:'bar',
              barWidth: 20,
              label: {
                  normal: {
                      show: true,
                      formatter: '{c}',
                      position: "top",
                      textStyle: {
                          color: "#fff",
                          fontSize: 14
                      }
                  }
              },
              itemStyle: {
                  normal: {
                 barBorderRadius: 20, 
                 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                      offset: 0,
                      color: '#fccb05'
                  }, {
                      offset: 1,
                      color: '#000'
                  }]),
                  },
              },
              data:[120, 132, 101, 134]
          },
          {
              name:'弱',
              type:'bar',
              barWidth: 20,
              stack: '對比',
               label: {
                  normal: {
                      show: true,
                      formatter: '{c}',
                      position: "top",
                      textStyle: {
                          color: "#fff",
                          fontSize: 14
                      }
                  }
              },
              itemStyle: {
              normal: {
                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                      offset: 0,
                      color: '#00C7E1'
                  }, {
                      offset: 1,
                      color: '#000'
                  }]),
                  opacity: 1,
                  barBorderRadius: 12,
              }
          },
              data:[220, 182, 191, 234]
          }
      
      ]
  };

var option6 = {
    // backgroundColor:'#050d19',
    title:{
      textStyle:{
          color:"#6a9cd5",
      },
      // text:'量表測評',
      left:"center",
    },
    
    tooltip: {//鼠標懸浮彈出提示框
        trigger:'axis', //提示框彈出的觸發時間,折線圖和柱狀圖爲axis
        formatter:"{a} <br/>{b} : {c} "//提示框提示的信息,{a}series內的名字,{b}爲塊狀的名字,{c}爲數值
        },
        grid: {//統計圖距離邊緣的距離
            top: '10%',
            left: '10%',
            right: '10%',
            bottom: '20%'
        },
        xAxis: [{//x軸
            type: 'category',//數據類型爲不連續數據
            boundaryGap: false,//座標軸兩邊是否留白
            axisLine: { //座標軸軸線相關設置。數學上的x軸
                 show: true,
                 lineStyle: {
                     color: '#233e64' //x軸顏色
                 },
             },
             axisLabel: { //座標軸刻度標籤的相關設置
                 textStyle: {
                     color: '#fff',
                 },
             },
             axisTick: { show: true,},//刻度點數軸
            data: ['勇猛老虎型', '溫和考拉型', '聰明貓頭鷹型', '天才可塑龍型'],
        }],
        yAxis: [{//y軸的相關設置
            type: 'value',//y軸數據類型爲連續的數據
            min: 0,//y軸上的刻度最小值
            max:140,//y軸上的刻度最大值
            splitNumber: 7,//y軸上的刻度段數
            splitLine: {//y軸上的y軸線條相關設置
                 show: true,
                 lineStyle: {
                     color: '#233e64'
                 }
             },
             axisLine: {//y軸的相關設置
                show: true,
                lineStyle: {
                    color: '#233e64' //y軸顏色
                },
             },
             axisLabel: {//y軸的標籤相關設置
                 textStyle: {
                     color: '#6a9cd5',
                 },
             },
             axisTick: { show: true,},  //刻度點數軸
        }],
        series: [{
            name: '潛能測評',
            type: 'line',//統計圖類型爲折線圖
            smooth: true, //是否平滑曲線顯示
            symbolSize:0,//數據點的大小,[0,0]//b表示寬度和高度
            lineStyle: {//線條的相關設置
                normal: {
                    color: "#3deaff"   // 線條顏色
                }
            },
            areaStyle: { //區域填充樣式
                normal: {
                 //線性漸變,前4個參數分別是x0,y0,x2,y2(範圍0~1);相當於圖形包圍盒中的百分比。如果最後一個參數是‘true’,則該四個值是絕對像素位置。
                   color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                       { offset: 0,  color: 'rgba(61,234,255, 0.9)'}, 
                       { offset: 0.8,  color: 'rgba(61,234,255, 0)'}
                   ], false),

                 shadowColor: 'rgba(53,142,215, 0.9)', //陰影顏色
                 shadowBlur: 20 //shadowBlur設圖形陰影的模糊大小。配合shadowColor,shadowOffsetX/Y, 設置圖形的陰影效果。
             }
         },
            data: [90, 105, 84, 125]
        }]
};

var option5 = {
    // backgroundColor:"#090e36",
    grid: {
        left: 40,
        top: 50,
        bottom: 30,
        right: 20,
        containLabel: true
    },
    tooltip: {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    legend: {
      show:false
    },
    
    polar: {},
    angleAxis: {
        interval: 1,
        type: 'category',
        data: [],
        z: 10,
        axisLine: {
            show: false,
            lineStyle: {
                color: "#0B4A6B",
                width: 1,
                type: "solid"
            },
        },
        axisLabel: {
            interval: 0,
            show: true,
            color: "#0B4A6B",
            margin: 8,
            fontSize: 16
        },
    },
    radiusAxis: {
        min: 20,
        max: 120,
        interval: 20,
        axisLine: {
            show: false,
            lineStyle: {
                color: "#0B3E5E",
                width: 1,
                type: "solid"
            },
        },
        axisLabel: {
            formatter: '{value} %',
            show: false,
            padding: [0, 0, 20, 0],
            color: "#0B3E5E",
            fontSize: 16
        },
        splitLine: {
            lineStyle: {
                color: "#07385e",
                width: 2,
                type: "dashed"
            }
        }
    },
    calculable: true,
    series: [ {
        stack: 'a',
        type: 'pie',
        radius: '70%',
        roseType: 'radius',
        zlevel:10,
       startAngle: 100,
       
        label: {
            normal: {
                textStyle: {
             color: "rgba(255, 255, 255)"
           },
                formatter: [ '{b}','{d}%'].join('\n'),
                rich: {
                    b: {
                        color: '#fff',
                        fontSize: 14,
                        lineHeight: 20
                    },
                    d: {
                        color: '#fff',
                        fontSize: 14,
                        height: 20
                    },
                },
            }
        },
        labelLine: {
            normal: {
                show: true,
                length: 10,
                length2: 45,
                lineStyle: {
                color: '#aaa'
                    
                }
            },
            emphasis: {
                show: false
            }
        },
        data: [{
                value: 63,
                name: '會計事務所',
                 itemStyle: {
                     normal: {
                  borderColor: colorArr[0],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: "#41a8f8",
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[0]
                    },
                    }
            },
            {
                value: 27,
                name: '律師事務所',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[1],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[1],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[1]
                    },
                    }
            },
            {
                value: 17,
                name: '教育',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[2],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[2],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[2]
                    },
                    }
            },
            {
                value: 13,
                name: '房地產',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[3],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[3],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[3]
                    },
                    }
            },
            {
                value: 10,
                name: '互聯網/電子商務',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[4],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[4],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[4]
                    },
                    }
            },
            {
                value: 16,
                name: '護理',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[5],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[5],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[5]
                    },
                    }
            }
        ]
    }, ]
}

        
var option8 = {
            tooltip: {},
            grid: {
                top: '10%',
                left: '4%',
                right: '4%',
                bottom: '4%',
                containLabel: true,
            },
            legend: {
                itemGap: 50,
                data: ['學生人數' ],
                textStyle: {
                    color: '#f9f9f9',
                    borderColor: '#fff'
                },
            },
            xAxis: [{
                type: 'category',
                boundaryGap: true,
                axisLine: { //座標軸軸線相關設置。數學上的x軸
                    show: true,
                    lineStyle: {
                        color: '#f9f9f9'
                    },
                },
                axisLabel: { //座標軸刻度標籤的相關設置
                    textStyle: {
                        color: '#d1e6eb',
                        margin: 15,
                    },
                },
                axisTick: {
                    show: false,
                },
                data: ['三好學生' ,'優秀團幹部','社會實踐優秀學員','朗誦比賽','舞蹈比賽','歌詠比賽','體操比賽','班級建設比賽'],
            }],
            yAxis: [{
                type: 'value',
                min: 0,
                // max: 140,
                splitNumber: 7,
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#0a3256'
                    }
                },
                axisLine: {
                    show: false,
                },
                axisLabel: {
                    margin: 20,
                    textStyle: {
                        color: '#d1e6eb',
        
                    },
                },
                axisTick: {
                    show: false,
                },
            }],
            series: [{
                name: '學生人數',
                type: 'bar',
                barWidth:18,
                tooltip: {
                    show: false
                },
                 label: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        color: '#fff',
                    }
                },
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: '#41E1D4' // 0% 處的顏色
                        }, {
                            offset: 1,
                            color: '#10A7DB' // 100% 處的顏色
                        }], false),
                        barBorderRadius: [30, 30, 0, 0],
                        shadowBlur: 4,
                    }
                },
                data: [200, 382, 102, 267, 186, 315, 316, 416]
            }
            ]
        };        
        
var option2 = {
    // backgroundColor:"#090e36",
    grid: {
        left: 30,
        top: 60,
        bottom:30,
        right: 10,
        containLabel: true
    },
    tooltip: {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    legend: {
      show:false
    },
    
    polar: {},
    angleAxis: {
        interval: 1,
        type: 'category',
        data: [],
        z: 10,
        axisLine: {
            show: false,
            lineStyle: {
                color: "#0B4A6B",
                width: 1,
                type: "solid"
            },
        },
        axisLabel: {
            interval: 0,
            show: true,
            color: "#0B4A6B",
            margin: 8,
            fontSize: 16
        },
    },
    radiusAxis: {
        min: 20,
        max: 120,
        interval: 20,
        axisLine: {
            show: false,
            lineStyle: {
                color: "#0B3E5E",
                width: 1,
                type: "solid"
            },
        },
        axisLabel: {
            formatter: '{value} %',
            show: false,
            padding: [0, 0, 20, 0],
            color: "#0B3E5E",
            fontSize: 16
        },
        splitLine: {
            lineStyle: {
                color: "#07385e",
                width: 2,
                type: "dashed"
            }
        }
    },
    calculable: true,
    series: [ {
        stack: 'a',
        type: 'pie',
        radius: '70%',
        roseType: 'radius',
        zlevel:10,
       startAngle: 100,
        label: {
            normal: {
                textStyle: {
             color: "rgba(255, 255, 255)"
           },
                formatter: [ '{b}','{d}%'].join('\n'),
                rich: {
                    b: {
                        color: '#fff',
                        fontSize: 14,
                        lineHeight: 20
                    },
                    d: {
                        color: '#fff',
                        fontSize: 14,
                        height: 20
                    },
                },
            }
        },
        labelLine: {
            normal: {
                show: true,
                length: 10,
                length2: 45,
                lineStyle: {
                color: '#aaa'
                    
                }
            },
            emphasis: {
                show: false
            }
        },
        data: [{
                value: 8,
                name: '50k~30k',
                 itemStyle: {
                     normal: {
                  borderColor: colorArr[0],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: "#41a8f8",
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[0]
                    },
                    }
            },
            {
                value: 17,
                name: '25k~20k',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[1],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[1],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[1]
                    },
                    }
            },
            {
                value: 37,
                name: '19k~15k',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[2],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[2],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[2]
                    },
                    }
            },
            {
                value: 13,
                name: '14k~10k',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[3],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[3],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[3]
                    },
                    }
            },
            {
                value: 10,
                name: '9k~7k',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[4],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[4],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[4]
                    },
                    }
            },
            {
                value: 66,
                name: '6k~3k',
                itemStyle: {
                    normal: {
                  borderColor: colorArr[5],
                  borderWidth:2,
                  shadowBlur: 20,
                  shadowColor: colorArr[5],
                  shadowOffsetx: 25,
                  shadowOffsety: 20,
                  color:colorAlpha[5]
                    },
                    }
            }
        ]
    }, ]
}        
// 地圖
    var data = [
          {name:"北京市",value:224540},
            {name:"天津",value:66890},
            {name:"河北",value:51590},
            {name:"山西",value:27860},
            {name:"內蒙古",value:15410},
            {name:"遼寧",value:325920},
            {name:"吉林",value:15730},
            {name:"黑龍江",value:64030},
            {name:"上海",value:78230},
            {name:"江蘇",value:571930},
            {name:"浙江",value:311410},
            {name:"安徽",value:20650},
            {name:"福建",value:55790},
            {name:"江西",value:6060},
            {name:"山東",value:741447},
            {name:"河南",value:73670},
            {name:"湖北",value:34080},
            {name:"湖南",value:189790},
            {name:"廣東",value:131740},
            {name:"廣西",value:2300},
            {name:"海南",value:9370},
            {name:"重慶",value:89630},
            {name:"四川",value:1473222},
            {name:"貴州",value:2650},
            {name:"雲南",value:40290},
            {name:"西藏",value:44290},
            {name:"陝西",value:60450},
            {name:"甘肅",value:5620},
            {name:"青海",value:0590},
            {name:"寧夏",value:180},
            {name:"新疆",value:4520},
            {name:"臺灣",value:800},
            {name:"香港",value:2000},
            {name:"澳門",value:0},
    ];
    var geoCoordMap = {
         '北京市': [116.4551, 40.2539],
            "天津": [117.4219, 39.4189],
            "河北": [114.4995, 38.1006],
            "山西": [112.3352, 37.9413],
            '內蒙古': [110.3467, 41.4899],
            "遼寧": [123.1238, 42.1216],
            "吉林": [125.8154, 44.2584],
            '黑龍江': [127.9688, 45.368],
            '上海': [121.4648, 31.2891],
            "江蘇": [118.8062, 31.9208],
            "浙江": [119.5313, 29.8773],    
            "安徽": [117.29, 32.0581],   
            "福建": [119.4543, 25.9222],
            "江西": [116.0046, 28.6633],
            "山東": [117.1582, 36.8701],
            "河南": [113.4668, 34.6234],
            "湖北": [114.3896, 30.6628],
            "湖南": [113.0823, 28.2568],
            "廣東": [113.12244, 23.009505],
            "廣西": [108.479, 23.1152],
            "海南": [110.3893, 19.8516],
            "重慶": [108.384366, 30.439702],
            "四川": [103.9526, 30.7617],
            "貴州": [106.6992, 26.7682],
            "雲南": [102.9199, 25.4663],
            "西藏": [91.11, 29.97],
            "陝西": [109.1162, 34.2004],
            "甘肅": [103.5901, 36.3043],
            "青海": [101.4038, 36.8207],
            "寧夏": [106.3586, 38.1775],
            "新疆": [87.9236, 43.5883],
            '臺灣': [121.5135,25.0308],
            "香港": [114.08, 22.20],
            '澳門': [113.33,22.13],
       
    };
    
       
        var max = 480, min = 9; // todo 
        var maxSize4Pin = 100, minSize4Pin = 20;
    
      var convertData = function (data) {
        var res = [];
        for (var i = 0; i < data.length; i++) {
            var geoCoord = geoCoordMap[data[i].name];
            if (geoCoord) {
                res.push({
                    name: data[i].name,
                    value: geoCoord.concat(data[i].value)
                });
            }
        }
        return res;
    };
    
    var option3 = {
        tooltip: {
                trigger: 'item',
                formatter: function (params) {
                  if(typeof(params.value)[2] == "undefined"){
                    return params.name + ' : ' + params.value;
                  }else{
                    return params.name + ' : ' + params.value[2];
                  }
                }
            },
        legend: {
            left: 'left',
            data: ['強', '中', '弱'],
            textStyle: {
                color: '#ccc'
            }
        },
        
         geo: {
                map: 'china',
                show: true,
                roam: true,
                label: {
                    normal: {
                        show: false
                    },
                    emphasis: {
                        show: false,
                    }
                },
                itemStyle: {
                    normal: {
                        areaColor: '#3a7fd5',
                        borderColor: '#0a53e9',//線
                        shadowColor: '#092f8f',//外發光
                        shadowBlur: 20
                    },
                     emphasis: {
                        areaColor: '#0a2dae',//懸浮區背景
                    }
                }
            },
        series : [
{

symbolSize: 5,
label: {
    normal: {
        formatter: '{b}',
        position: 'right',
        show: true
    },
    emphasis: {
        show: true
    }
},
itemStyle: {
    normal: {
        color: '#fff'
    }
},
name: 'light',
type: 'scatter',
coordinateSystem: 'geo',
data: convertData(data),

},
{
type: 'map',
map: 'china',
geoIndex: 0,
aspectScale: 0.75, //長寬比
showLegendSymbol: false, // 存在legend時顯示
label: {
    normal: {
        show: false
    },
    emphasis: {
        show: false,
        textStyle: {
            color: '#fff'
        }
    }
},
roam: true,
itemStyle: {
    normal: {
        areaColor: '#031525',
        borderColor: '#FFFFFF',
    },
    emphasis: {
        areaColor: '#2B91B7'
    }
},
animation: false,
data: data
},
{
name: 'Top 5',
type: 'scatter',
coordinateSystem: 'geo',
symbol: 'pin',
symbolSize: [50,50],
label: {
    normal: {
        show: true,
        textStyle: {
            color: '#fff',
            fontSize: 9,
        },
        formatter (value){
            return value.data.value[2]
        }
    }
},
itemStyle: {
    normal: {
        color: '#D8BC37', //標誌顏色
    }
},
data: convertData(data),
showEffectOn: 'render',
rippleEffect: {
    brushType: 'stroke'
},
hoverAnimation: true,
zlevel: 1
},

]
    };
    
    
        
        myxslb.setOption(option1);
        mysdtu.setOption(option2);
        myDiTu1.setOption(option3);
        mytu4.setOption(option4);
        mytu5.setOption(option5);
        mytu6.setOption(option6);
        mytu7.setOption(option7);
        mytu8.setOption(option8);
    </script>
</html>

發佈了8 篇原創文章 · 獲贊 0 · 訪問量 1751
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章