chartjs / chartjs/Chart.js

Tooltip needs to be registered globally

Open
#11,111 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 tooltip plugin can be added to a single chart by adding it the the `plugins` array:

```javascript
const myChart = new Chart(ctx, {
plugins: [..., Tooltip],
type: 'pie',
...
})
```

### Current behavior

It isn't working. The tooltip plugin needs to be registered globally: ```Chart.register(..., Tooltip);```

### Reproducible sample

https://github.com/chkpnt/chartjs-issue11111/blob/main/js/main.js

### Optional extra steps/info to reproduce

Just run `npm run start`.

### Possible solution

_No response_

### Context

_No response_

### chart.js version

v4.2.0

### Browser name and version

Firefox 109.0.1

### Link to your project

https://github.com/chkpnt/chartjs-issue11111

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.