A tool for calculating the scale range of a chart Install npm install chart-scale Import import getChartScale from 'chart-scale' import { getChartScale } from 'chart-scale' Use const { max, min, interval } = getChartScale(5.3, -0.9, 7) console.log(max, min, interval) // {max: 6, min: -1, interval: 1}