Skip to content

Commit

Permalink
regression bugfix in x-axis ticks for #4067
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Aug 6, 2024
1 parent e0d8af4 commit 0df5a06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/Range.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class Range {
}

if (gl.isXNumeric || gl.noLabelsProvided || gl.dataFormatXNumeric) {
let ticks
let ticks = 10

if (cnf.xaxis.tickAmount === undefined) {
ticks = Math.round(gl.svgWidth / 150)
Expand All @@ -427,7 +427,10 @@ class Range {
ticks = gl.series[gl.maxValsInArrayIndex].length - 1
}
if (gl.isXNumeric) {
ticks = gl.maxX - gl.minX - 1
const diff = gl.maxX - gl.minX
if (diff < 30) {
ticks = diff - 1
}
}
} else {
ticks = cnf.xaxis.tickAmount
Expand Down

0 comments on commit 0df5a06

Please sign in to comment.