Skip to content

Type error with BubbleDataPoint when using ChartData<'bubble'> #11602

@thomas-haufe

Description

@thomas-haufe

Expected behavior

There should be no TypeScript error.

Current behavior

There is this error even though the code runs fine:
Property 'r' is missing in type '{ x: number; y: number; }' but required in type 'BubbleDataPoint'.

Reproducible sample

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYQBYENYBoUdgEXRnTgF84AzKCEOAcgGM8YA6AKwGc6BuAWACgBDCADsO8ACZF0ALlyYYhYgB46AIwCuatQBsApnQB8cALyIBcOFOIc9MDnIDaFy+f6vXO9Gr065da3RbGDosFw9ApwQADzkARhwATzkAJlIcGNSkuQBmUgBdMPcPOCh0CWANBzgACgYYaIBKU2M4gFYij3SXQoFSPkF+ADdMOHro0ysIBg0QPRFWAHM7AFF9OYWAIUSASQkagCIQRLQFA+aguAAJABUAWQAZZHQREY41vQ2YAZGoOGPTrBJiI9AB3eSwOoNDLhOAwRJgPT+TTafShWGRKzSTpkIqNbhAA

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

If I leave out the type ChartData<'bubble'> for the variable data, there is no error. However, I lose the implicit type information for the ctx parameter of the radius function so I don't view this as a valid solution.

chart.js version

v4.4.0

Browser name and version

No response

Link to your project

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions