// HashMap HashMap = function() { this.map = new Array(); } HashMap.prototype = { put: function(key, value) { this.map[key] = value; }, get: function(key) { return this.map[key]; }, getAll: function() { return this.map; }, clear: function() { this.map = new Array(); }, getKeys: function() { var keys = new Array(); for(i in this.map) { keys.push(i); } return keys; } }; function buildChart22(target) { var chart = Highcharts.chart(target, { chart: { polar: true, type: 'area', backgroundColor:'transparent', style:{ color:'rgba(255,255,255,0.5)', fontFamily:'SUIT', fontWeight:'400', fontSize:'14px' }, height: 135, margin: 0, spacing: 0 }, title: { text: '', }, pane: { size: '95%' }, xAxis: { categories: [{ text: 'VISION', tooltip: "VISION 설명 텍스트가 들어갑니다. 줄바꿈도 가능합니다." }, { text: 'TOWER', tooltip: "TOWER 설명 텍스트. <- 코드는 title 내 줄바꿈 코드입니다." }, { text: 'SOLO', tooltip: "SOLO 설명 텍스트가 들어갑니다." }, { text: 'GOLD', tooltip: "GOLD 설명 텍스트가 들어갑니다." }, { text: 'TEAM', tooltip: "TEAM 설명 텍스트가 들어갑니다." }], labels: { useHTML: true, formatter: function() { return ''+this.value.text+''; }, }, tickmarkPlacement: 'on', lineWidth: 0, gridLineColor: 'rgba(255,255,255,0.1)', }, yAxis: { gridLineInterpolation: 'polygon', lineWidth: 0, gridLineColor: 'rgba(255,255,255,0.1 )', }, plotOptions: { area: { marker: { radius: 1 }, lineWidth: 2, } }, tooltip:{ enabled: false }, legend: { enabled: false }, series: [{ name: 'BASE', data: [51, 22, 66, 44, 88], pointPlacement: 'on', color: 'rgba(57,103,255,0.8)', zIndex:1 }] }); return chart; } function getJSessionId(){ var jsId = document.cookie.match(/JSESSIONID=[^;]+/); if(jsId != null) { if (jsId instanceof Array) jsId = jsId[0].substring(11); else jsId = jsId.substring(11); } if(jsId == null || jsId == "") jsId = "102"; return jsId; } function getSortedArrayFromHashMap(map) { let sortable = []; $.each(map.getKeys(), function(key, value) { sortable.push([value, map.get(value)]); }); sortable.sort(function(a, b) { return b[1] - a[1]; }); // console.log(sortable); // pogBlue.clear(); // $.each(sortable, function(key, value){ // // *** key:0, value:hong,9.1 // pogBlue.put(value[0], value[1]); // console.log('*** key:'+key+', value:'+value); // }); return sortable; } function getSortedArrayFromHashMapByKey(map) { let sortable = []; $.each(map.getKeys(), function(key, value) { sortable.push([value, JSON.stringify(map.get(value))]); // sortable.push([value, map.get(value)]); }); sortable.sort(function(a, b) { return b[1] - a[1]; }); let sortedMap = new HashMap(); sortedMap.clear(); for (let [key, value] of sortable) { // console.log("*** key: "+key+", value: "+value); sortedMap.put(key, value); } return sortedMap; } function clone(obj) { if (obj === null || typeof(obj) !== 'object') return obj; var copy = obj.constructor(); for (var attr in obj) { if (obj.hasOwnProperty(attr)) { copy[attr] = obj[attr]; } } return copy; }