refine use ticks[ticks.length - 1].value

This commit is contained in:
Cindy Chang
2024-06-18 09:52:43 +08:00
parent 6c9322d1bc
commit adb2ab29af
3 changed files with 7 additions and 6 deletions

View File

@@ -10,7 +10,8 @@ const TOFIXED_DEICMAL = 1;
export const getStepSizeOfYTicks = (maxTimeInSecond, numOfParts) => {
const {unitToUse, timeValue} = getTimeUnitAndValueToUse(maxTimeInSecond);
let resultStepSize;
resultStepSize = (timeValue * (1.125) / numOfParts);
const getLarger = 1 + (1 / (numOfParts - 1));
resultStepSize = (timeValue * getLarger / numOfParts);
return {resultStepSize, unitToUse};
}