Skip to content

fix(dumbbell): don't draw end dots for a null row - #5357

Merged
junedchhipa merged 1 commit into
apexcharts:mainfrom
b84330808:fix/dumbbell-null-row-dots
Oct 23, 2026
Merged

junedchhipa merged 1 commit into
apexcharts:mainfrom
b84330808:fix/dumbbell-null-row-dots

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

New Pull Request

In a dumbbell drawn from y: [lo, hi] data (plotOptions.bar.isDumbbell), a row with y: null still got its two end dots. Their values were null, so the dots had no position and were drawn on the top edge of the plot (the left edge when horizontal: true). That is the stray pair of dots at the top in the issue's screenshot.

getDumbbellEnds now skips null ends in the y: [lo, hi] form, as the chart.type: 'dumbbell' series form already does. A row with no values draws no dots. A row with one null end keeps the dot for its other end. A value of 0 still gets its dot.

This does not change the issue's second example, where series with different x values are lined up by position.

Fixes #4458

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • If this adds or changes an animation, its action is in an animation matrix with its start and end stated (see CONTRIBUTING.md, Animations)
  • New and existing unit tests pass locally with my changes
  • My branch is up to date with any changes from the main branch

Tests: three new cases in tests/unit/dumbbell.spec.js: a unit check of getDumbbellEnds, and the issue's chart rendered as columns and as bars. They fail on main and pass with the fix. The full vitest run tests/unit/ suite passes, and check:size is within budget.

I used Claude Code to write this change.

In the `y: [lo, hi]` form of a dumbbell (`plotOptions.bar.isDumbbell`),
a row with `y: null` still got two end dots. Their values were null, so
the dots had no position and were drawn on the plot's top edge (left
edge when horizontal).

getDumbbellEnds now skips null ends, as the `chart.type: 'dumbbell'`
series form already does.

Fixes #4458

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@junedchhipa junedchhipa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good to go.

@junedchhipa
junedchhipa merged commit d3c2e1b into apexcharts:main Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dumbbell chart] plotting null values at the top of the chart

2 participants