Skip to content
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

Type from the tooltip y title formatter is missing arguments #4762

Closed
cyrilf opened this issue Oct 15, 2024 · 0 comments · Fixed by #4772
Closed

Type from the tooltip y title formatter is missing arguments #4762

cyrilf opened this issue Oct 15, 2024 · 0 comments · Fixed by #4772

Comments

@cyrilf
Copy link
Contributor

cyrilf commented Oct 15, 2024

I'm using Typescript and a chart of type heatmap.

On the configuration object, based on the documentation & types I have:

const options: ApexOptions = {
  chart : { ... },
  tooltip: {
    y: {
      title: {
        formatter: (seriesName: string): string => {
          // Do stuff
        },
     }
   }
};

But actually, formatter accept 2 more arguments.
So it could be nice to reflect it on the types and/or docs.

Something like this:

formatter: (seriesName: string, opts: { series: number[][]; seriesIndex: number; dataPointIndex: number }, w: any): string

I haven't open a PR because I don't find the perfect type for series and for w.
Here is the line to update on the types file.

You can see that the second and third arguments are passed on this file everytime that the function yLbTitleFormatter is called.

https://github.com/apexcharts/apexcharts.js/blob/abf93e3e40d35785245c224913b4e4e61457e1ac/src/modules/tooltip/Labels.js

If you know the correct type for series and w, I can open a PR.

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 a pull request may close this issue.

1 participant