Skip to content

The types don't include the tooltip property in datasets #12046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
julienw opened this issue Mar 16, 2025 · 0 comments
Open

The types don't include the tooltip property in datasets #12046

julienw opened this issue Mar 16, 2025 · 0 comments

Comments

@julienw
Copy link

julienw commented Mar 16, 2025

Expected behavior

Hey,
I want to override a tooltip callback in datasets, this works fine, but the types don't allow it.

Sample code:

datasets: [
  {
    data,
    tooltip: {
      callbacks: {
        label: (ctx) => {
          // do something with ctx
        },
      },
    },
  },
]

Current behavior

I get this typescript error:

E: Object literal may only specify known properties, and 'tooltip' does not exist in type 'ChartDataset<"line", PressureAndConsumption[]>'

Reproducible sample

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYQBYENZwL5wGZQQhwDkAxhrAHQBWAziQNwCwAUGwG6ZxkwAecALxwAJhDIBXEAFMAdjCoBzaTACiAG2kz5AIQCeASREAKAEQg9aTDFMBKOOjpwAEgBUAsgBlk6WVzoaWnIwLKxcUHAWVljCstIA7iiUMMa8fAA0iGxwOXAwemDSAFyk6sBxJOnZuSLoMOglCNW5cOroAEbS6nQlANqmAErSIqaZpjrqEtKjcKYAml3qEPEzpgDiUNJyqwAKElBgmqsA8lC+yqYAulWsLTm19XQqPXC9Tbd3LW2d6iUkAMRwCB4OAANQgMGkDBunxaDwarwAjAAmTKIgCcmQAzJkAKyZVFwLHXZq5bAkj4tGAQCDqGDAMCNUktMjodTqdroMgAaxe71huW+XRKqX49kEAD4spSBXAAPRy0QQOB0IgqVDlRRweLAGCoHj8Zl3bAw2Emo3mmWWloQMD0iCyPlGuiszROmUtPhMj13I05a2wvTe2VwP04C2k7BsbC2RhAA

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

v4.4.8

Browser name and version

No response

Link to your project

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant