Skip to content

Commit

Permalink
[#1324] Chart > Legend > table type 일 때 차트에 값이 null이 들어올 경우 console.w…
Browse files Browse the repository at this point in the history
…arn 발생

#####################################
- null은 차트 데이터에서 유의미한 데이터이기 때문에 warning 메시지가 발생할 필요 없어 조건문 삭제함
- Util함수에 JS Docs 추가
- warning 메시지 오탈자 수정
  • Loading branch information
jhee564 committed Nov 17, 2022
1 parent 4053c06 commit f50e106
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/components/chart/helpers/helpers.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,14 @@ export default {
});
},

/**
* Check the value exceeds 9007199254740991 or less than -9007199254740991
* null => safe Integer
* string and undefined => Not Safe Integer
* @param {any} value
* @returns {boolean}
*/
checkSafeInteger(value) {
if (value === null || value === undefined) {
return false;
}

return value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER;
},
};
2 changes: 1 addition & 1 deletion src/components/chart/model/model.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ const modules = {
|| !Util.checkSafeInteger(total)
|| !Util.checkSafeInteger(last)
) {
console.warn('[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less then -9007199254740991.');
console.warn('[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less than -9007199254740991.');
}

aggregationDataSet[sId] = { min, max, avg, total, last };
Expand Down

0 comments on commit f50e106

Please sign in to comment.