<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### # 設計頁 html 路徑D:\ireport365\ireport365.war\WEB-INF\pages\enduser\designer\index.jsp 添加兩個js 百度的 key值上線的時候申請成自己的 `<script src="http://api.map.baidu.com/api?v=2.0&ak=XlQ9m3CqMs1UKUbuPIN15LsDp7VC6hoM"></script> ` 添加bmap.js `_scripts.push({url: "https://cdn.bootcss.com/echarts/4.0.3/extension/bmap.min.js?v="+updateVersion});` ### js 路徑D:\ireport365\ireport365.war\js\enduser\designer\vs-component-echarts.js 一 添加線圖 ~~~ { name: "", type: "echartsMap", coverImage: contextPath + "/images/componenttypes/" + locale + "/widget/zh_baiduMap.png?v=3", coverImageWidth: "50%", tip: "echarts線路-軌跡-支持省市縣" } ~~~ 二 初始化組件大小 ~~~ if (b.type === "echartsMap") { b.sizeX = 4; b.sizeY = 18 } ~~~ 三 添加模板 ~~~ // echarts軌跡圖模板start var trajectoryColor = ['#a6c84c', '#ffa022', '#46bee9']; // 初始化坐標 var addr = [ [{ name: '琴臺大劇院' }, { jd:114.2592716217 , wd: 30.5616327403 }], [{ name: '鐘家村' }, { jd:114.26728 , wd: 30.549565 }], [{ name: '漢陽區江堤街江堤社區北方向' }, { jd:114.2530059814 , wd: 30.5378686275 }], [{ name: '漢陽大道鐘家村公交站' }, { jd:114.254722 , wd: 30.550605 }] ]; // 地圖自定義樣式 var bmap = { center: [addr[i][1].jd,addr[i][1].wd], zoom: 15, roam: true, mapStyle: { styleJson: [{ 'featureType': 'land', //調整土地顏色 'elementType': 'geometry', 'stylers': { 'color': '#081734' }}, { 'featureType': 'building', //調整建筑物顏色 'elementType': 'geometry', 'stylers': { 'color': '#04406F' }}, { 'featureType': 'building', //調整建筑物標簽是否可視 'elementType': 'labels', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'highway', //調整高速道路顏色 'elementType': 'geometry', 'stylers': { 'color': '#015B99' }}, { 'featureType': 'highway', //調整高速名字是否可視 'elementType': 'labels', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'arterial', //調整一些干道顏色 'elementType': 'geometry', 'stylers': { 'color':'#003051' }}, { 'featureType': 'arterial', 'elementType': 'labels', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'green', 'elementType': 'geometry', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'water', //調整水的顏色 'elementType': 'geometry', 'stylers': { 'color': '#044161' }}, { 'featureType': 'subway', //調整地鐵顏色 'elementType': 'geometry.stroke', 'stylers': { 'color': '#003051' }}, { 'featureType': 'subway', //地鐵名字是否可視 'elementType': 'labels', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'railway', //鐵路名字是否可視 'elementType': 'geometry', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'railway', 'elementType': 'labels', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'all', //調整所有的標簽的邊緣顏色 'elementType': 'labels.text.stroke', 'stylers': { 'color': '#313131' }}, { 'featureType': 'all', //調整所有標簽的填充顏色 'elementType': 'labels.text.fill', 'stylers': { 'color': '#FFFFFF' }}, { 'featureType': 'manmade', 'elementType': 'geometry', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'manmade', 'elementType': 'labels', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'local', 'elementType': 'geometry', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'local', 'elementType': 'labels', 'stylers': { 'visibility': 'off' }}, { 'featureType': 'subway', 'elementType': 'geometry', 'stylers': { 'lightness': -65 }}, { 'featureType': 'railway', 'elementType': 'all', 'stylers': { 'lightness': -40 }}, { 'featureType': 'boundary', 'elementType': 'geometry', 'stylers': { 'color': '#8b8787', 'weight': '1', 'lightness': -29 }}] } } // 數據空數組 var trajectorySeries2 = []; addr.forEach(function(item, i) { trajectorySeries2.push({ name: addr[i][0].name , type: 'effectScatter', // 坐標點數據 coordinateSystem: 'bmap', zlevel: 2, rippleEffect: { brushType: 'stroke' }, label: { normal: { show: false, position: 'right', formatter: '{b}' } }, symbolSize: 20, showEffectOn: 'render', itemStyle: { normal: { color: 'red' } }, data: [{ name: addr[i][0].name, value: [addr[i][1].jd, addr[i][1].wd] }] } ); }); addr.forEach(function(item, i) { if(i<addr.length-1){ var endNum=i+1; trajectorySeries2.push({ type: 'lines', coordinateSystem: 'bmap', // 線連接, 只需要坐標,為 起點和終點 zlevel: 2, effect: { show: true, period: 6, trailLength: 0, symbol:'circle', symbolSize: 10 }, lineStyle: { normal: { color: 'yellow', width: 1, opacity: 0.4, curveness: 0 } }, data: [{ coords: [[addr[i][1].jd,addr[i][1].wd],[addr[endNum][1].jd,addr[endNum][1].wd]]}] }); } }); addr.forEach(function(item, i) { if(i<addr.length-1){ var endNum=i+1; //點移動的拖尾特效 trajectorySeries2.push({ type: 'lines', coordinateSystem: 'bmap', zlevel: 1, effect: { show: true, period: 6, trailLength: 0.7, color: '#ff8800', symbolSize: 3 }, lineStyle: { normal: { color: trajectoryColor[i], width: 0, curveness: 0.0 } }, data: [{ coords: [ [addr[i][1].jd,addr[i][1].wd],[addr[endNum][1].jd,addr[endNum][1].wd]]}] }); } }); // console.log(trajectorySeries2) var trajectoryOptionTemplate = { bmap: bmap, zoom: 13, color: ['gold', 'aqua', 'lime'], title: { show: false }, lineColor:'yellow', borderC:'red', borderWeiColor:'#ff8800', activeColor:'#ff8800', tooltip: { trigger: 'item', transitionDuration: 0, }, legend: { //工具欄,可以進行 類型數據顯示的選擇 show: false, orient: 'vertical', top: 'top', left: 'right', textStyle: { color: '#ff8800' }, selectedMode: 'single' }, series: trajectorySeries2 }; // 結束 end ~~~ 四 在buildChartOption函數里添加 ~~~ case "echartsMap": option = angular.copy(trajectoryOptionTemplate); break; ~~~ 五 添加判斷處理數據函數方法 ~~~ case "echartsMap": internalRefreshEchartsMapModelData(); break; ~~~ 六 組件的數據處理函數 ~~~ //echartsMap 處理數據函數 var internalRefreshEchartsMapModelData = function(){ var option = component.config.chartConfig; var dimensions = component.config.datasourceConfig.dimensions; var measures = component.config.datasourceConfig.measures; var data = component.context.data; console.log(data) var dd = option.series[0] if (data == null || data.length < 1 || measures.length < 1) { return } var measureIdx = 0; if (component.config.receiveMeasureLink != null && component.config.receiveMeasureLink === true) { var newMeasures = scope.getSelectedLinkMeasure(component, component.config.datasourceConfig.measures); for (var i = 0; i < measures.length; i++) { if (newMeasures[i] != null) { measureIdx = i; break } } } // console.log(dimensions[dimensions.length-1].name) var addr = []; // console.log(option) // console.log(data) for (var i = 0; i < data.length; i++) { // console.log(data[i]) addr.push([{ name:data[i][dimensions[measureIdx].name] },{ jd:data[i].lat, wd:data[i].lng }]) } // console.log(addr) // 數據空數組 var trajectorySeries2 = []; addr.forEach(function(item, i) { trajectorySeries2.push({ name: addr[i][0].name , type: 'effectScatter', // 坐標點數據 coordinateSystem: 'bmap', zlevel: 2, rippleEffect: { brushType: 'stroke' }, label: { normal: { show: false, position: 'right', formatter: '{b}' } }, symbolSize: 20, showEffectOn: 'render', itemStyle: { normal: { color: option.borderC } }, data: [{ name: addr[i][0].name, value: [addr[i][1].jd, addr[i][1].wd] }] } ); }); addr.forEach(function(item, i) { if(i<addr.length-1){ var endNum=i+1; trajectorySeries2.push({ type: 'lines', coordinateSystem: 'bmap', // 線連接, 只需要坐標,為 起點和終點 zlevel: 2, effect: { show: true, period: 6, trailLength: 0, symbol:'circle', symbolSize: 10 }, lineStyle: { normal: { color: option.lineColor, width: 1, opacity: 0.4, curveness: 0 } }, data: [{ coords: [[addr[i][1].jd,addr[i][1].wd],[addr[endNum][1].jd,addr[endNum][1].wd]]}] }); } }); addr.forEach(function(item, i) { if(i<addr.length-1){ var endNum=i+1; //點移動的拖尾特效 trajectorySeries2.push({ type: 'lines', coordinateSystem: 'bmap', zlevel: 1, effect: { show: true, period: 6, trailLength: 0.7, color: option.borderWeiColor, symbolSize: 3 }, lineStyle: { normal: { color: trajectoryColor[i], width: 0, curveness: 0.0 } }, data: [{ coords: [ [addr[i][1].jd,addr[i][1].wd],[addr[endNum][1].jd,addr[endNum][1].wd]]}] }); } }); // console.log(option) // option = trajectoryOptionTemplate; option.series = trajectorySeries2 option.bmap.center = [addr[0][1].jd,addr[0][1].wd]; // option.bmap.zoom = 7; component.context.chart.setOption(option, true) // console.log(option) } ~~~ 七 接收聯動指令 ~~~ case "echartsMap": // console.log(component) var option = component.config.chartConfig; var dataIndex = -1; for(var i = 0; i<component.context.data.length;i++){ // 每次全部恢復顏色 // option.series[i].itemStyle.normal.color = option.borderColor; option.series[i].itemStyle.normal.color = option.borderColor; option.series[i].label.normal.show = false; } for(var i = 0; i<component.context.data.length;i++){ // 每次全部恢復顏色 // option.series[i].itemStyle.normal.color = option.borderColor; if ("" + option.series[i].name === "" + event.source.value) { dataIndex = i; break } } // 這個指標聯動變顏色 option.series[dataIndex].itemStyle.normal.color = option.activeColor; // 顯示該指標彈框 option.series[dataIndex].label.normal.show = true; // option.bmap.zoom = 7; component.context.chart.setOption(option, true) break; ~~~ 八 推送聯動指令 ~~~ case "echartsMap": component.context.chart.on("click", function (param) { // console.log(param) if (component.config.datasourceConfig.measures == null || component.config.datasourceConfig.dimensions == null) { return } var data = component.context.data; var dataIndex = param.dataIndex; // console.log(data) // console.log(dataIndex) // console.log(param.data.name) var to = param.data.name; // if (to != null && component.context.tooltipName != null && "" + component.context.tooltipName === "" + to) { // return // } if (to == null || param.value == null || param.value === "-") { return } // console.log(component.context.tooltipName) component.context.tooltipName = to; scope.notifyDimensionValueChange(null, scope.getLastDimension(), to) }); break; ~~~ 九 在internalBuildChartDescription函數里添加 配置設置 這個函數最前面是 ~~~ var measureCategory = { name: "measureConfig", title: vsLang.measures, groups: [] }; component.description.categories.push(measureCategory); ~~~ 修改成以下 線圖不需要度量 ~~~ // 如果是echarts軌跡圖或者3d地圖就不加度量 if (component.type !== "echartsMap") { var measureCategory = { name: "measureConfig", title: vsLang.measures, groups: [] }; component.description.categories.push(measureCategory); } ~~~ 十 在和氣泡圖一起的switch (component.type) {}判斷里加以下代碼 ~~~ case "echartsMap": // chartCategory.groups.push({ // title: { // text: "工具箱配置" // }, // elements: [{ // title: "工具箱", // type: "radio", // bind: "showDataLabel", // items: [{ // name: vsLang.on, // value: true // }, { // name: vsLang.off, // value: false // }] // }, { // title: "上下位置", // type: "select-s", // bind: "dataLabelPositionObjTop", // items: [{ // name: vsLang.position_top, // value: "top" // }, { // name: vsLang.position_bottom, // value: "bottom" // }] // }, { // title: "左右位置", // type: "select-s", // bind: "dataLabelPositionObjLeft", // items: [{ // name: vsLang.position_left, // value: "left" // }, { // name: vsLang.position_right, // value: "right" // }] // }, { // title: "工具箱顏色", // type: "colorpicker", // bind: "gjColor" // }] // }) chartCategory.groups.push({ title: { text: "圖形配置" }, elements: [{ title: "線條顏色", type: "colorpicker", bind: "linkColor" },{ title: "點顏色", type: "colorpicker", bind: "borderColor" },{ title: "尾燈顏色", type: "colorpicker", bind: "borderWeiColor" },{ title: "激活點顏色", type: "colorpicker", bind: "activeColor" },{ title: "視圖大小", type: "configSlide", bind: "viewZoom", config: { slideEnd: 100 } }] }) break; ~~~ ![](https://box.kancloud.cn/29295a9ed8c513c54c06539a7c86dc39_585x243.png) 十一 在監聽配置面板監聽函數里 添加監聽方法 和氣泡地圖一起 ~~~ case "echartsMap": // 監聽工具箱開關 scope.$watch("component.config.showDataLabel", function (newValue) { console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.legend.show = newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽工具箱上下位置 scope.$watch("component.config.dataLabelPositionObjTop", function (newValue) { if (newValue != null) { // console.log(newValue.value) var option = component.config.chartConfig; option.legend.top = newValue.value; scope.component.context.chart.setOption(option, true) } }); // 監聽工具箱左右位置 scope.$watch("component.config.dataLabelPositionObjLeft", function (newValue) { if (newValue != null) { var option = component.config.chartConfig; // console.log(option) // console.log(newValue.value) option.legend.left = newValue.value; scope.component.context.chart.setOption(option, true) } }); // 監聽工具箱顏色 scope.$watch("component.config.gjColor", function (newValue) { if (newValue != null) { var option = component.config.chartConfig; option.legend.textStyle.color = newValue; scope.component.context.chart.setOption(option, true) } }); // 監聽線條顏色 scope.$watch("component.config.linkColor", function (newValue) { if (newValue != null) { var option = component.config.chartConfig; console.log(option) option.lineColor = newValue; scope.component.context.chart.setOption(option, true) } }); // 監聽點顏色 scope.$watch("component.config.borderColor", function (newValue) { if (newValue != null) { var option = component.config.chartConfig; option.borderColor = newValue; scope.component.context.chart.setOption(option, true) } }); // 監聽尾燈顏色 scope.$watch("component.config.borderWeiColor", function (newValue) { if (newValue != null) { var option = component.config.chartConfig; option.borderWeiColor = newValue; scope.component.context.chart.setOption(option, true) } }); // 監聽激活點顏色 scope.$watch("component.config.activeColor", function (newValue) { if (newValue != null) { var option = component.config.chartConfig; option.activeColor = newValue; scope.component.context.chart.setOption(option, true) } }); // 監聽視圖大小 scope.$watch("component.config.viewZoom", function (newValue) { if (newValue != null) { var option = component.config.chartConfig; option.bmap.zoom = newValue; scope.component.context.chart.setOption(option, true) } }); break; ~~~ ![](https://box.kancloud.cn/a6ef4d05d86ca929518bb306cadf63a3_500x193.png) # 分享頁 ### html 路徑 D:\ireport365\ireport365.war\WEB-INF\classes\system-resource\report-template.html `<script src="http://api.map.baidu.com/api?v=2.0&ak=XlQ9m3CqMs1UKUbuPIN15LsDp7VC6hoM"></script>` `_scripts.push({url: "https://cdn.bootcss.com/echarts/4.0.3/extension/bmap.min.js"});` ### js 路徑 D:\ireport365\ireport365.war\WEB-INF\classes\report-resource\design.js 一 判斷數據處理函數 ~~~ case "echartsMap": internalRefreshEchartsMapModelData(); break; ~~~ 二 數據處理函數 ~~~ // echarts地圖-軌跡數據處理函數 var internalRefreshEchartsMapModelData = function(){ var option = component.config.chartConfig; var dimensions = component.config.datasourceConfig.dimensions; var measures = component.config.datasourceConfig.measures; var data = component.context.data; var trajectoryColor = ['#a6c84c', '#ffa022', '#46bee9']; console.log(option.borderColor) if (data == null || data.length < 1 || measures.length < 1) { return } // console.log(dimensions[dimensions.length-1].name) var addr = []; // console.log(option) // console.log(data) for (var i = 0; i < data.length; i++) { // console.log(data[i]) addr.push([{ name:data[i][dimensions[dimensions.length-1].name] },{ jd:data[i].lat, wd:data[i].lng }]) } // // 初始化坐標 // var addr1 = [ // [{ name: '琴臺大劇院' }, { jd:119.2592716217 , wd: 30.5616327403 }], // [{ name: '鐘家村' }, { jd:118.26728 , wd: 30.549565 }], // [{ name: '漢陽區江堤街江堤社區北方向' }, { jd:119.2530059814 , wd: 30.5378686275 }], // [{ name: '漢陽大道鐘家村公交站' }, { jd:114.254722 , wd: 30.550605 }] // ]; // console.log(addr) // console.log(addr1) // 數據空數組 var trajectorySeries2 = []; addr.forEach(function(item, i) { trajectorySeries2.push({ name: addr[i][0].name , type: 'effectScatter', // 坐標點數據 coordinateSystem: 'bmap', zlevel: 2, rippleEffect: { brushType: 'stroke' }, label: { normal: { show: false, position: 'right', formatter: '{b}' } }, symbolSize: 20, showEffectOn: 'render', itemStyle: { normal: { color: option.borderC } }, data: [{ name: addr[i][0].name, value: [addr[i][1].jd, addr[i][1].wd] }] } ); }); addr.forEach(function(item, i) { if(i<addr.length-1){ var endNum=i+1; trajectorySeries2.push({ type: 'lines', coordinateSystem: 'bmap', // 線連接, 只需要坐標,為 起點和終點 zlevel: 2, effect: { show: true, period: 6, trailLength: 0, symbol:'circle', symbolSize: 10 }, lineStyle: { normal: { color: option.lineColor, width: 1, opacity: 0.4, curveness: 0 } }, data: [{ coords: [[addr[i][1].jd,addr[i][1].wd],[addr[endNum][1].jd,addr[endNum][1].wd]]}] }); } }); addr.forEach(function(item, i) { if(i<addr.length-1){ var endNum=i+1; //點移動的拖尾特效 trajectorySeries2.push({ type: 'lines', coordinateSystem: 'bmap', zlevel: 1, effect: { show: true, period: 6, trailLength: 0.7, color: option.borderWeiColor, symbolSize: 3 }, lineStyle: { normal: { color: trajectoryColor[i], width: 0, curveness: 0.0 } }, data: [{ coords: [ [addr[i][1].jd,addr[i][1].wd],[addr[endNum][1].jd,addr[endNum][1].wd]]}] }); } }); // console.log(option) // option = trajectoryOptionTemplate; option.series = trajectorySeries2 option.bmap.center = [addr[0][1].jd,addr[0][1].wd]; component.context.chart.setOption(option, true) // console.log(option) } ~~~ 三 接收聯動指標 ~~~ case "echartsMap": var option = component.config.chartConfig; var dataIndex = -1; for(var i = 0; i<component.context.data.length;i++){ // 每次全部恢復顏色 // option.series[i].itemStyle.normal.color = option.borderColor; option.series[i].itemStyle.normal.color = option.borderColor; option.series[i].label.normal.show = false; } for(var i = 0; i<component.context.data.length;i++){ // 每次全部恢復顏色 // option.series[i].itemStyle.normal.color = option.borderColor; if ("" + option.series[i].name === "" + event.source.value) { dataIndex = i; break } } // 這個指標聯動變顏色 option.series[dataIndex].itemStyle.normal.color = option.activeColor; // 顯示該指標彈框 option.series[dataIndex].label.normal.show = true; // option.bmap.zoom = 7; component.context.chart.setOption(option, true) break ~~~ 四 推送聯動 ~~~ case "echartsMap": var option = component.config.chartConfig; var dataIndex = -1; for(var i = 0; i<component.context.data.length;i++){ // 每次全部恢復顏色 // option.series[i].itemStyle.normal.color = option.borderColor; option.series[i].itemStyle.normal.color = option.borderColor; option.series[i].label.normal.show = false; } for(var i = 0; i<component.context.data.length;i++){ // 每次全部恢復顏色 // option.series[i].itemStyle.normal.color = option.borderColor; if ("" + option.series[i].name === "" + event.source.value) { dataIndex = i; break } } // 這個指標聯動變顏色 option.series[dataIndex].itemStyle.normal.color = option.activeColor; // 顯示該指標彈框 option.series[dataIndex].label.normal.show = true; // option.bmap.zoom = 7; component.context.chart.setOption(option, true) break ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看