Skip to content

Type inconsistency with dataLabels.formatter #2355

@GrSto

Description

@GrSto

Bug report

Codepen

https://codepen.io/GrSto/pen/MWJGbGR

Explanation

For the dataLabels.formatter option, the expected type for the val parameter in types/apexcharts.d.ts is number:

formatter?(val: number, opts?: any): string | number

However, for RangeBar Charts (with chart.type = "rangeBar"), the type should be for example [number, number].

This causes the following Typescript error:

TS2322: Type '(val: [number, number]) => string' is not assignable to type '(val: number, opts?: any) => string | number'.
  Types of parameters 'val' and 'val' are incompatible.
    Type 'number' is not assignable to type '[number, number]'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions