chartjs / chartjs/Chart.js

Point during a data hover is not displayed correctly

Open
#11,336 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Expected behavior

The point during a data hover is not displayed correctly when you set a pointRadius to 0 and the hover value is the maximum chart value

### Current behavior

The point during the hover is drawn halfway. It seems to come out of the canvas.

### Reproducible sample

https://codepen.io/xgotgot/pen/OJaPmdy

### Optional extra steps/info to reproduce

hover over the line of the chart written, during the hover, the point is not drawn correctly with a pointRadius at 0.
When changing the pointRadius to a value greater than 0, the hoverPoint is drawn correctly.

### Possible solution

in the element.point.ts file when drawing point line 94 there is a condition that says that the point is not drawn
` if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {
return;
}`

### Context

_No response_

### chart.js version

v4.3.0

### Browser name and version

Brae

### Link to your project

https://codepen.io/xgotgot/pen/OJaPmdy

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.