Browse Source

비행시간 stepSize 수정

pull/2/head
hhjk00 10 months ago
parent
commit
6eaaea21c5
  1. 4
      src/containers/statistics/AbnormalSituationContainer.js
  2. 12
      src/containers/statistics/FlightContainer.js
  3. 4
      src/containers/statistics/FlightResultContainer.js

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

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

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

Loading…
Cancel
Save