<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                路徑:D:\ireport365\ireport365.war\js\enduser\designer\vs-component-echarts.js 一 添加關系 ~~~ ,{ name: "", type: "echartsRelationship", coverImage: contextPath + "/images/componenttypes/" + locale + "/widget/zh_baiduMap.png?v=3", coverImageWidth: "50%", tip: "走向關系圖" } ~~~ 二 添加對象option ~~~ // 關系圖對象 start echartsRelationshipOptionTemplate = { background:'rgba(0,0,0,0)', title:{ show:false }, // tooltip: { // formatter: function(x) { // if(x.data.des == undefined){ // return '' // } // return x.data.des; // } // }, tooltip: { trigger: 'item', formatter: "{b}" }, series: [{ type: 'graph', layout: 'force', symbolSize: 30, roam: true, edgeSymbol: ['circle', 'arrow'], edgeLabel: { normal: { textStyle: { fontSize: 20, color:'#ff8800' } } }, force: { repulsion: 2500, edgeLength: [10, 50] }, draggable: true, focusNodeAdjacency:false, lineStyle: { normal: { width: 2, color: 'red', curveness: 0 //邊的曲度,支持從 0 到 1 的值,值越大曲度越大。 } }, edgeLabel: { normal: { show: true, formatter: function(x) { return x.name; } } }, label: { normal: { show: false, textStyle: {}, color:'#fff' } }, data: [{ name: '侯亮平', }, { name: '李達康', }, { name: '祁同偉', }, { name: '陳巖石', }, { name: '陸亦可', }, { name: '高育良', }, { name: '沙瑞金', }, { name: '高小琴', }, { name: '高小鳳' }, { name: '趙東來', }, { name: '程度', }, { name: '吳惠芬', }, { name: '趙瑞龍', }, { name: '趙立春', }, { name: '陳海', }, { name: '梁璐', }, { name: '劉新建' }, { name: '歐陽菁' }, { name: '吳心怡', }, { name: '蔡成功' }, { name: '丁義珍' }], }], color: '#ff8800' } // 關系end ~~~ 三 copy 組件對象 及初始化數據 ~~~ case "echartsRelationship": var links = [{ source: '高育良', target: '侯亮平', }, { source: '高育良', target: '祁同偉', }, { source: '趙立春', target: '高育良', }, { source: '趙立春', target: '趙瑞龍', }, { source: '趙立春', target: '劉新建', }, { source: '李達康', target: '趙立春', }, { source: '祁同偉', target: '高小琴', }, { source: '陳巖石', target: '陳海', }, { source: '陸亦可', target: '陳海', }, { source: '沙瑞金', target: '陳巖石', }, { source: '祁同偉', target: '陳海', }, { source: '祁同偉', target: '侯亮平', }, { source: '侯亮平', target: '陳海', }, { source: '高育良', target: '吳惠芬', }, { source: '陳海', target: '趙東來', }, { source: '高小琴', target: '高小鳳', }, { source: '趙東來', target: '陸亦可', }, { source: '祁同偉', target: '程度', }, { source: '高育良', target: '高小鳳', }, { source: '趙瑞龍', target: '祁同偉', }, { source: '李達康', target: '趙東來', }, { source: '趙瑞龍', target: '程度', }, { source: '沙瑞金', target: '李達康', }, { source: '沙瑞金', target: '高育良', }, { source: '祁同偉', target: '梁璐', }, { source: '吳惠芬', target: '梁璐', }, { source: '李達康', target: '歐陽菁', }, { source: '趙瑞龍', target: '劉新建', }, { source: '趙瑞龍', target: '高小琴', }, { source: '趙瑞龍', target: '高小鳳', }, { source: '吳心怡', target: '陸亦可', }, { source: '吳心怡', target: '吳惠芬', }, { source: '蔡成功', target: '侯亮平', }, { source: '蔡成功', target: '歐陽菁', }, { source: '歐陽菁', target: '劉新建', }, { source: '劉新建', target: '趙瑞龍', }, { source: '李達康', target: '丁義珍', }, { source: '高小琴', target: '丁義珍', }, { source: '祁同偉', target: '丁義珍', }, { source: '趙瑞龍', target: '丁義珍', }] option = angular.copy(echartsRelationshipOptionTemplate); option.series[0].links =links; break; ~~~ 四 處理數據函數 ~~~ //echarts關系圖 internalRefreshechartsRelationshipModelData = function(){ var dimensions = component.config.datasourceConfig.dimensions; var measures = component.config.datasourceConfig.measures; var data = component.context.data; if (data == null || data.length < 1 || dimensions.length < 1) { return } var option = component.config.chartConfig; var data = component.context.data; // console.log(option) var node = []; var node_line = []; var legendData = []; var chartData = []; 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 } } } /* string 字符串; str 指定字符; split(),用于把一個字符串分割成字符串數組; split(str)[0],讀取數組中索引為0的值(第一個值),所有數組索引默認從0開始; */ function getStr(string,str){ var str_before = string.split(str)[0]; var str_after = string.split(str)[1]; node.push(str_before,str_after); var value = data[i][measures[measureIdx].name]; node_line.push({ source: str_before, target: str_after, // name : value }) } // 雙層循環改變原數組(數組去重) // function removeArrayRepElement(arr){ // for (var i = 0; i < arr.length; i++) { // for (var j = 0; j < arr.length; j++) { // if (arr[i] == arr[j] && i != j) {//將后面重復的數刪掉 // arr.splice(j, 1); // } // } // } // return arr; // } for (var i = 0; i < data.length; i++) { var nodeData = data[i][dimensions[dimensions.length - 1].name]; getStr(nodeData,'-') } if (component.config["measureAlias_" + measureIdx] != null && component.config["measureAlias_" + measureIdx].length > 0) { option.series[0].name = component.config["measureAlias_" + measureIdx] } option.series[0].seriesIndex = measureIdx; // 雙層循環改變原數組(數組去重) function removeArrayRepElement(arr){ for (var i = 0; i < arr.length; i++) { for (var j = 0; j < arr.length; j++) { if (arr[i] == arr[j] && i != j) {//將后面重復的數刪掉 arr.splice(j, 1); } } } return arr; } var nodeArr = removeArrayRepElement(node); for(var i = 0;i<nodeArr.length;i++){ var dd = nodeArr[i]; if(dd){ chartData.push({ name: nodeArr[i] }); } } // console.log(chartData) // 數組里的對象去重復 let newdData = {}; let log = console.log.bind(console); person = chartData.reduce((cur,next) => { newdData[next.name] ? "" : newdData[next.name] = true && cur.push(next); return cur; },[]) //設置cur默認類型為數組,并且初始值為空的數組 // log(person); // console.log(node_line) option.series[0].data = person; option.series[0].links =node_line; component.context.chart.setOption(option, true); } // end ~~~ 五 調用數據處理函數 ~~~ case "echartsRelationship": internalRefreshechartsRelationshipModelData(); break; ~~~ 六 buildDataDescription函數里 scope.$on(event_chartDimensionValueChange, function (s, event) {})里添加 ~~~ case "echartsRelationship": var dataIndex = -1; // console.log(component.config.chartConfig) var option = component.config.chartConfig; console.log(option) for (var i = 0; i < component.config.chartConfig.series[0].data.length; i++) { if ("" + component.config.chartConfig.series[0].data[i].name === "" + event.source.value) { console.log(component.config.chartConfig.series[0].data[i].name) dataIndex = i; break } } console.log(dataIndex) if (dataIndex < 0) { component.context.chart.dispatchAction({ type: "hideTip" }); return } if (dataIndex > -1) { console.log(event.source.value) component.context.chart.dispatchAction({ type: "showTip", name: event.source.value, seriesIndex: 0 }) } break; ~~~ 六 echarts 事件 ~~~ case "echartsRelationship": component.context.chart.on("mouseover", function (param) { if (component.config.datasourceConfig.measures == null || component.config.datasourceConfig.dimensions == null) { return } var data = component.context.data; var dataIndex = param.dataIndex; var to = param.data.name; if (to == null || param.value == null || param.value === "-") { return } component.context.tooltipName = to; scope.notifyDimensionValueChange(null, scope.getLastDimension(), to) }); break; ~~~ 七 在氣泡圖下面寫如下配置項 ~~~ // echarts 關系圖 case "echartsRelationship": chartCategory.groups.push({ title: { text: "配置" }, elements: [{ title: "線條顏色", type: "colorpicker", bind: "lineColor" },{ title: "線條曲度", type: "configSlide", bind: "lineCurve", config: { slideStart: 1, slideEnd: 100 } },{ title: "線條寬度", type: "configSlide", bind: "lineWidth", config: { slideStart: 1, slideEnd: 30 } },{ title: "圓點大小", type: "configSlide", bind: "borderMax", config: { slideStart: 28, slideEnd: 100 } },{ title: "原點顏色", type: "colorpicker", bind: "dianColor" },{ title: "顯示文字", type: "switch", bind: "fontShow", on: vsLang.on, off: vsLang.off },{ title: "字體顏色", type: "colorpicker", bind: "fontColor" },{ title: "字體大小", type: "configSlide", bind: "fontSize", config: { slideStart: 12, slideEnd: 30 } },{ title: "高亮", type: "switch", bind: "gaoliang", on: vsLang.on, off: vsLang.off }] }) break ~~~ 八 相對還是在氣泡圖下面添加監聽的配置項的代碼 ~~~ case "echartsRelationship": scope.$watch("component.config.dianColor", function(newValue, oldValue) { if (newValue != null) { var option = component.config.chartConfig; option.color = newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽線條顏色 scope.$watch("component.config.lineColor", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].lineStyle.normal.color = newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽線條曲度 scope.$watch("component.config.lineCurve", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].lineStyle.normal.curveness = 0.1 * newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽線條寬度 scope.$watch("component.config.lineWidth", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].lineStyle.normal.width = newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽圓點大小 scope.$watch("component.config.borderMax", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].symbolSize = newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽文字顯示 scope.$watch("component.config.fontShow", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].label.normal.show = newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽字體顏色 scope.$watch("component.config.fontColor", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].label.normal.color = newValue; scope.component.context.chart.setOption(option, true); } }); // 監聽字體顏色 scope.$watch("component.config.fontSize", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].label.normal.fontSize = newValue; scope.component.context.chart.setOption(option, true); } }); // 是否開啟高亮 scope.$watch("component.config.gaoliang", function (newValue) { // console.log(newValue) if (newValue != null) { var option = component.config.chartConfig; option.series[0].focusNodeAdjacency = newValue; scope.component.context.chart.setOption(option, true); } }); break; ~~~ 設計頁完 分享頁 路徑 D:\ireport365\ireport365.war\WEB-INF\classes\report-resource\design.js 一 寫在氣泡圖數據處理的上面 ~~~ //echarts關系圖 internalRefreshechartsRelationshipModelData = function(){ var dimensions = component.config.datasourceConfig.dimensions; var measures = component.config.datasourceConfig.measures; var data = component.context.data; if (data == null || data.length < 1 || dimensions.length < 1) { return } var option = component.config.chartConfig; var data = component.context.data; // console.log(option) var node = []; var node_line = []; var legendData = []; var chartData = []; 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 } } } /* string 字符串; str 指定字符; split(),用于把一個字符串分割成字符串數組; split(str)[0],讀取數組中索引為0的值(第一個值),所有數組索引默認從0開始; */ function getStr(string,str){ var str_before = string.split(str)[0]; var str_after = string.split(str)[1]; node.push(str_before,str_after); var value = data[i][measures[measureIdx].name]; node_line.push({ source: str_before, target: str_after, // name : value }) } // 雙層循環改變原數組(數組去重) function removeArrayRepElement(arr){ for (var i = 0; i < arr.length; i++) { for (var j = 0; j < arr.length; j++) { if (arr[i] == arr[j] && i != j) {//將后面重復的數刪掉 arr.splice(j, 1); } } } return arr; } for (var i = 0; i < data.length; i++) { var nodeData = data[i][dimensions[dimensions.length - 1].name]; getStr(nodeData,'-') } if (component.config["measureAlias_" + measureIdx] != null && component.config["measureAlias_" + measureIdx].length > 0) { option.series[0].name = component.config["measureAlias_" + measureIdx] } option.series[0].seriesIndex = measureIdx; // 雙層循環改變原數組(數組去重) function removeArrayRepElement(arr){ for (var i = 0; i < arr.length; i++) { for (var j = 0; j < arr.length; j++) { if (arr[i] == arr[j] && i != j) {//將后面重復的數刪掉 arr.splice(j, 1); } } } return arr; } var nodeArr = removeArrayRepElement(node); for(var i = 0;i<nodeArr.length;i++){ var dd = nodeArr[i]; if(dd){ chartData.push({ name: nodeArr[i] }); } } // 數組里的對象去重復 let newdData = {}; let log = console.log.bind(console); person = chartData.reduce((cur,next) => { newdData[next.name] ? "" : newdData[next.name] = true && cur.push(next); return cur; },[]) //設置cur默認類型為數組,并且初始值為空的數組 // console.log(nodeArr) // console.log(node) // console.log(legendData) // console.log(chartData) // console.log(node_line) option.series[0].data = person; option.series[0].links =node_line; component.context.chart.setOption(option, true); } // end ~~~ 二 調用數據處理函數 ~~~ case "echartsRelationship": internalRefreshechartsRelationshipModelData(); 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>

                              哎呀哎呀视频在线观看