Skip to content

Commit

Permalink
correct barwidth when 1 datapoint is present - fixes #4522
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Jun 21, 2024
1 parent e335511 commit c5dc67e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/modules/dimensions/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export default class DimGrid {
const cnf = w.config
const gl = w.globals

if (gl.noData
|| (gl.collapsedSeries.length
+ gl.ancillaryCollapsedSeries.length) === cnf.series.length
if (
gl.noData ||
gl.collapsedSeries.length + gl.ancillaryCollapsedSeries.length ===
cnf.series.length
) {
return 0
}
Expand Down Expand Up @@ -45,15 +46,16 @@ export default class DimGrid {
}

const barsPresent = hasBar(type) || gl.comboBarCount > 0
let xRange = Math.abs(gl.initialMaxX - gl.initialMinX)

if (
barsPresent &&
gl.isXNumeric &&
!gl.isBarHorizontal &&
seriesLen > 0
seriesLen > 0 &&
xRange !== 0
) {
let xRatio = 0
let xRange = Math.abs(gl.initialMaxX - gl.initialMinX)

if (xRange <= 3) {
xRange = gl.dataPoints
Expand Down

0 comments on commit c5dc67e

Please sign in to comment.