Skip to content

Commit

Permalink
fix: set a minimum height of 0.1px for the bar
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Jun 25, 2024
1 parent f77de40 commit 36fe419
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/datavisualisations/ColumnChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default defineComponent({
class="column-chart__columns__item__placeholder"
/>
<rect
:height="bar.height"
:height="Math.max(bar.height, 0.1)"
:width="bar.width"
:y="bar.y"
:id="columnUniqueId(index)"
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/datavisualisations/ColumnChart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('ColumnChart.vue', () => {
it('creates the first column with minimum height', () => {
const column = wrapper.findAll('.column-chart__columns__item__bar').at(0)
const height = parseFloat(column.attributes('height'))
expect(height).toBe(0)
expect(height).toBe(0.1)
})

it('creates the third column with medium height', () => {
Expand Down Expand Up @@ -256,7 +256,7 @@ describe('ColumnChart.vue', () => {
it('creates the first column with medium height', () => {
const column = wrapper.findAll('.column-chart__columns__item__bar').at(0)
const height = parseFloat(column.attributes('height'))
expect(height).toBe(0)
expect(height).toBe(0.1)
})

it('creates the last column with maximum height', () => {
Expand Down

0 comments on commit 36fe419

Please sign in to comment.