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