Skip to content

Commit

Permalink
fix: one data element with tooltip causes crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Coltin Kifer committed Jan 12, 2023
1 parent fb96985 commit 09bcfd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export const calculateActiveTickIndex = (
let index = -1;
const len = ticks?.length ?? 0;

if (len === 0) {
// if there are 1 or less ticks ticks then the active tick is at index 0
if (len <= 1) {
return 0;
}

Expand Down

0 comments on commit 09bcfd4

Please sign in to comment.