Fix division by zero in timeRange when amount is 1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -142,6 +142,7 @@ export function setBarChartData(baseData) {
|
|||||||
* values in seconds.
|
* values in seconds.
|
||||||
*/
|
*/
|
||||||
export function timeRange(minTime, maxTime, amount) {
|
export function timeRange(minTime, maxTime, amount) {
|
||||||
|
if (amount <= 1) return [Math.round(minTime)];
|
||||||
// The X-axis (time axis) range is max - min; accumulate intervals from min to max by index
|
// The X-axis (time axis) range is max - min; accumulate intervals from min to max by index
|
||||||
const startTime = minTime;
|
const startTime = minTime;
|
||||||
const endTime = maxTime;
|
const endTime = maxTime;
|
||||||
|
|||||||
Reference in New Issue
Block a user