Apexcharts.js: Data Labels missing on stacked column charts with negative values

Created on 10 Sep 2019  路  8Comments  路  Source: apexcharts/apexcharts.js

Codesandbox

Here's a link showing the issue: https://codesandbox.io/s/react-basic-example-8zrui. The example uses react, but I was able to observe the issue in Vue as well.

Explanation

_- What is the behavior you expect?_
I expected dataLabels to be visible on the negative columns

_- What is happening instead?_
There are no dataLabels visible on the negative columns

_- What error message are you getting?_
No error message

bar bug datalabels

Most helpful comment

Thank you for the demo, will be addressed soon.

All 8 comments

+1

Can you please provide a minimal example? The provided example doesn't have any negative values.

Screenshot from 2020-01-05 17-01-53
This is an example.

Pink bar contains negative values.

Please provide a working codepen

Here is one: https://codepen.io/fengtan/pen/mdypRmd

It looks like datalabels are missing only if all values of the series are negative. In the example above the values are [-10, -10], but if I change that to [-10, 10] then they all show up: https://codepen.io/fengtan/pen/QWwadgp

Thank you for the demo, will be addressed soon.

Hi @junedchhipa, This issue still occurs in the current version, there are no labels on negative values. I am using version 3.23.1 from https://cdn.jsdelivr.net/npm/apexcharts
Here is a screenshot
image

here is an example with Codepen
https://codepen.io/alexxbetancourt/pen/VwKorOd

Hi @junedchhipa I have the same problem as @alexxbetancourt, plz tell me if there is any solution

problem

UPD. this is solution

plotOptions: {
    bar: {
        dataLabels: {
            hideOverflowingLabels: false
        }
    }
}
Was this page helpful?
4 / 5 - 1 ratings

Related issues

maasha picture maasha  路  3Comments

georgehardy picture georgehardy  路  3Comments

cstlaurent picture cstlaurent  路  3Comments

ordago picture ordago  路  3Comments

jlil picture jlil  路  3Comments