Index: arms/js/dashboard.js =================================================================== diff -u -r1b9257f6ac84044266a54ae6ffe1d787f56beaff -r0f0cceaba16790a1c7ba384945b642998e9bf391 --- arms/js/dashboard.js (.../dashboard.js) (revision 1b9257f6ac84044266a54ae6ffe1d787f56beaff) +++ arms/js/dashboard.js (.../dashboard.js) (revision 0f0cceaba16790a1c7ba384945b642998e9bf391) @@ -12,7 +12,6 @@ var labelType, useGradients, nativeTextSupport, animate; //투입 인력별 요구사항 관여 차트 var tot_ver_count, active_ver_count, req_count, subtask_count, resource_count; var top5ReqLinkedIssue = []; -var top5performance = []; function execDocReady() { var pluginGroups = [ @@ -1551,46 +1550,71 @@ progress: true, statusCode: { 200: function (data) { - console.log("인력별 퍼포먼스 조회 시작 YHS =========="); - console.log(data); //console.log(data.검색결과); - //var cat_persions = []; - //var 아이디 = getIdFromMail(data[0].필드명); + console.log("인력별 퍼포먼스 조회 =========="); + //console.log(data); //console.log(data.검색결과); var cat_persons = Object.keys(data); console.log(cat_persons); - console.log(cat_persons.length); - const N = cat_persons.length; + const persion_size = cat_persons.length; + //console.log(data[cat_persons[0]]["group_by_status.status_name.keyword"]); - console.log(data[cat_persons[0]]["group_by_status.status_name.keyword"]); - - var in_progress_arr = []; var Open_arr = []; var Closed_arr = []; var Backlog_arr = []; var 완료됨_arr = []; var 진행중_arr = []; - var sfd_arr = []; - let set = new Set(); + // 각 담당자별 status를 set에 넣는다. for (let i=0; i { - console.log('Index: ' + idx); - console.log(target); - console.log(target.필드명); + //console.log('Index: ' + idx); console.log(target); console.log(target.필드명); set.add(target.필드명); } ); } - console.log(set); + var legend_arr = []; //레전드 리스트 - set.forEach((element) => {legend_arr.push(element);}) - console.log(legend_arr); + set.forEach((element) => {legend_arr.push(element);}); // Set to List - let arrForDataByPersion = new Array(N).fill(0); - const M = legend_arr.length; - let arrForDataByLegends = new Array(M).fill(0); - console.log(arrForDataByPersion); - // 만약 set의 갯수가 n개이면 n개의 series가 필요하다 + const legend_size = legend_arr.length; + var arr2di = new Array(legend_size); // Status의 종류의 수 + for ( var i =0; i { + //console.log('Index: ' + idx); console.log(target.필드명); console.log(target.개수); + var 상태이름 = target.필드명; // "Backlog", "Resolved".. + var 상태idx = legend_arr.indexOf(상태이름); + arr2di[상태idx][i] = target.개수; + } + ); + } + var colorArr = dashboardColor.issueStatusColor; - console.log("인력별 퍼포먼스 조회 끝 =========="); - drawBarOnPolar2("polar_bar", cat_persons, dashboardColor.manpowerPerformance, legend_arr); + var testSeries = { + type: 'bar', + data: "", // seriesArr1 + itemStyle: { + color: "" + }, + coordinateSystem: 'polar', + name: "", + stack: 'a', + emphasis: { + focus: 'series' + } + } + + var arrSeries = new Array(legend_size); + + for (let i=0; iLowest:' + - data[id][0] + - '
Highest:' + - data[id][1] + - '
Average:' + - data[id][2] - ); - } - }, - radiusAxis: {}, - polar: {}, - series: [ - { - type: 'bar', - itemStyle: { - color: 'transparent' - }, - data: data.map(function (d) { - return d[0]; - }), - coordinateSystem: 'polar', - stack: 'Min Max', - silent: true - }, - { - type: 'bar', - data: data.map(function (d) { - return d[1] - d[0]; - }), - coordinateSystem: 'polar', - name: 'Range', - stack: 'Min Max' - }, - { - type: 'bar', - itemStyle: { - color: 'transparent' - }, - data: data.map(function (d) { - return d[2] - barHeight; - }), - coordinateSystem: 'polar', - stack: 'Average', - silent: true, - z: 10 - }, - { - type: 'bar', - data: data.map(function (d) { - return barHeight * 2; - }), - coordinateSystem: 'polar', - name: 'Average', - stack: 'Average', - barGap: '-100%', - z: 10 - } - ] - }; - myChart.setOption(option); - - window.onresize = function() { - myChart.resize(); - }; -} - -function drawBarOnPolar2(target, categories, color, legends, nameArr, dataSeries) { - var chartDom = document.getElementById(target); - var myChart = echarts.init(chartDom); - var _categories = (categories === undefined ? ["데이터 없음"] : categories); var option = { @@ -135,7 +15,7 @@ series: [ { type: 'bar', - data: [1, 2, 3, 4, 3], // seriesArr1 + data: arr2di[0],//[1, 2, 3, 4, 3], itemStyle: { color: color[0] }, @@ -148,7 +28,7 @@ }, { type: 'bar', - data: [2, 4, 6, 1, 3], // seriesArr2 + data: arr2di[1],//[2, 4, 6, 1, 3], itemStyle: { color: color[1] }, @@ -161,7 +41,7 @@ }, { type: 'bar', - data: [1, 2, 3, 4, 1], // seriesArr3 + data: arr2di[2],//[1, 2, 3, 4, 1], itemStyle: { color: color[2] }, @@ -174,7 +54,7 @@ }, { type: 'bar', - data: [2, 2, 2, 2, 4], // seriesArr4 + data: arr2di[3],//[2, 2, 2, 2, 4], itemStyle: { color: color[3] }, @@ -187,7 +67,7 @@ }, { type: 'bar', - data: [2, 2, 2, 2, 4], // seriesArr5 + data: arr2di[4],//[2, 2, 2, 2, 4], itemStyle: { color: color[4] }, @@ -200,7 +80,7 @@ }, { type: 'bar', - data: [2, 2, 2, 2, 4], // seriesArr6 + data: arr2di[5],//[2, 2, 2, 2, 4], itemStyle: { color: color[5] }, @@ -213,7 +93,7 @@ }, { type: 'bar', - data: [2, 2, 2, 2, 4], // seriesArr7 + data: arr2di[6],//[2, 2, 2, 2, 4], itemStyle: { color: color[6] }, @@ -226,7 +106,7 @@ }, { type: 'bar', - data: [2, 2, 2, 2, 4], // seriesArr8 + data: arr2di[7],//[2, 2, 2, 2, 4], itemStyle: { color: color[7] }, @@ -251,4 +131,33 @@ window.onresize = function() { myChart.resize(); }; +} + +function drawBarOnPolar(target, categories, legends, seriesArr) { + var chartDom = document.getElementById(target); + var myChart = echarts.init(chartDom); + + var _categories = (categories === undefined ? ["데이터 없음"] : categories); + + var option = { + angleAxis: { + type: 'category', + data: categories + }, + radiusAxis: {}, + polar: { center: ["50%", "60%"], radius: "60%"}, + series: seriesArr, + legend: { + show: true, + data: legends, // [ A, B , C , D, ...] + textStyle: { + color: "#FFFFFF" + } + } + }; + myChart.setOption(option); + + window.onresize = function() { + myChart.resize(); + }; } \ No newline at end of file