-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
I try setting the return value of the data label formatter to [val, 1, 'string']. Although a warning appears saying that this is not a valid return type for the formatter, ApexCharts.js actually accepts it and displays it on the chart.
Steps to Reproduce
var options = {
chart: {
type: "bar"
},
series: [
{
name: "sales",
data: [30, 40, 45, 50, 49, 60, 70, 91, 125]
}
],
xaxis: {
categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]
},
dataLabels: {
formatter: (val, opt) => {
return [val, 1, "string"];
}
}
};
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
// apexcharts.d.ts
type ApexDataLabels = {
...
[-] formatter?(val: string | number | number[], opts?: any): string | number | string[]
[+] formatter?(val: string | number | number[], opts?: any): string | number | (string | number)[]
}
Reproduction Link
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working