Skip to content

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

@cyrilf

Description

@cyrilf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions