diff --git a/src/containers/statistics/AbnormalSituationContainer.js b/src/containers/statistics/AbnormalSituationContainer.js index 6d349411..290175d8 100644 --- a/src/containers/statistics/AbnormalSituationContainer.js +++ b/src/containers/statistics/AbnormalSituationContainer.js @@ -96,7 +96,7 @@ export default function AbnormalSituationContainer() { // Bar Graph handler const handlerBarTicks = data => { const max = calculateMax(data); - const stepSize = hadnlerStepSize(max); + const stepSize = handlerStepSize(max); return { max, stepSize }; }; @@ -106,7 +106,7 @@ export default function AbnormalSituationContainer() { return Math.ceil(max / 5) * 5; }; - const hadnlerStepSize = max => { + const handlerStepSize = max => { const step = Math.ceil(max / 5); let stepSize; diff --git a/src/containers/statistics/FlightContainer.js b/src/containers/statistics/FlightContainer.js index 434f6253..a7dc31fb 100644 --- a/src/containers/statistics/FlightContainer.js +++ b/src/containers/statistics/FlightContainer.js @@ -94,7 +94,7 @@ export default function FlightContainer() { // Bar Graph handler const handlerBarTicks = data => { const max = calculateMax(data); - const stepSize = hadnlerStepSize(max); + const stepSize = handlerStepSize(max); return { max, stepSize }; }; @@ -104,13 +104,19 @@ export default function FlightContainer() { return Math.ceil(max / 5) * 5; }; - const hadnlerStepSize = max => { + const handlerStepSize = max => { const step = Math.ceil(max / 5); let stepSize; if (searchType.category === 'TIME') { - stepSize = 3600; + const hour = 3600; + + if (max > hour * 60) stepSize = hour * 12; + else if (max > hour * 40) stepSize = hour * 6; + else if (max > hour * 20) stepSize = hour * 4; + else if (max > hour * 10) stepSize = hour * 2; + else stepSize = hour; } else { if (max > 100) { stepSize = Math.ceil(step / 50) * 50; diff --git a/src/containers/statistics/FlightResultContainer.js b/src/containers/statistics/FlightResultContainer.js index dda34615..38b62915 100644 --- a/src/containers/statistics/FlightResultContainer.js +++ b/src/containers/statistics/FlightResultContainer.js @@ -94,7 +94,7 @@ export default function ResultContainer() { // Bar Graph handler const handlerBarTicks = data => { const max = calculateMax(data); - const stepSize = hadnlerStepSize(max); + const stepSize = handlerStepSize(max); return { max, stepSize }; }; @@ -104,7 +104,7 @@ export default function ResultContainer() { return Math.ceil(max / 5) * 5; }; - const hadnlerStepSize = max => { + const handlerStepSize = max => { const step = Math.ceil(max / 5); let stepSize;