Hello,
I am using a POST request to make Apex Chart graphs. Everything works ok, but if I want to send JavaScript functions for the callback (for example, the function to format values on the Y axis), the API returns a white (empty) image.
Below is what I am sending. If I remove “formatter” from “labels” everything is ok, but I cannot format the values on the Y axis.
{
"series": [
{
"name": "Cifra de afaceri a companiei",
"data": [
3929702,
3434171,
4134628,
4839389,
6609330,
10356581,
17562213,
24678024
]
}
],
"chart": {
"type": "bar",
"height": 350,
"toolbar": {
"show": false
},
"zoom": {
"enabled": false
}
},
"colors": [
"rgb(33,107,197)"
],
"plotOptions": {
"bar": {
"horizontal": false,
"columnWidth": "40%",
"endingShape": "rounded"
}
},
"dataLabels": {
"enabled": false
},
"stroke": {
"curve": "smooth"
},
"xaxis": {
"categories": [
"2015",
"2016",
"2017",
"2018",
"2019",
"2020",
"2021",
"2022"
],
"type": "category",
"tooltip": {
"enabled": false
},
"title": {
"text": "An"
}
},
"yaxis": {
"title": {
"text": "Cifra de afaceri a companiei €"
},
"labels": {
"minWidth": 0,
"maxWidth": 160,
"formatter": "function (value) { return value + '$' }"
}
},
"tooltip": {
"followCursor": true,
"marker": {
"show": true
},
"x": {
"show": true
}
},
"legend": {
"itemMargin": {
"vertical": 20
}
}
}
apexChartsVersion: 3.37.1
Thank you