-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
series.column.dataLabels are always contrasted if stacking != undefined #14014
Comments
Hi @schmidhannes, Demo: |
HI @sebastianbochan, I was aware of that option, but I wondered if the default contrasting when stacking could be considered a bug? This seems to be related to issue-6657, since the contrast is applied without taking the position of the label and the background color at the position into account. Please let me know if that sounds reasonable. |
Might be considered as a bug, or at least as an improvement.
In stacking, most likely you will use multiple series: https://jsfiddle.net/BlackLabel/2smzncge/ - that's why contrast color is by default enabled. What we could improve is to check, before applying contrast, if series is the last one in a stack. What do you think? |
HI @pawelfus, The check for the last stack in a series would solve my issue - in my use case I mostly have two or more stacks in a series, but for simplicity I used the "real" minimal reproduction. |
Hi, are there any updates regarding this issue? As can be seen in jsFiddle example, the labels are still always contrasted, even if located outside of the column. Furthermore, I do not see a reason why stacked column charts should force dataLabels contrast and ignore the label's background, while non-stacked ones don't. |
Hi @schmidhannes! Sorry, but we didn't have a chance to prioritize this issue, especially since it's not so popular request and can be easily bypassed by setting the |
Hi @raf18seb @sebastianbochan iam overriding contrasted method like below
here replacing colors our own colors insted of #000000 #FFFFFF in my case column chart its non stacked chart , it always undefined when we are overriding getContrast method returning correct value in my case , but below SS we have check like can u guys please help how can i overcome this one
after overriding it's returning below instead of
current version : |
Hi @tsmanesh! |
thanks for ur reply @karolkolodziej |
Hi! I've prepared a workaround for this issue. It is based on the last point of stack (checking Workaround: https://jsfiddle.net/BlackLabel/xv1pzeft/ Internal note: |
When using
plotOptions: { column: { stacking: 'normal' } }
dataLables are always contrasted. This is a problem when usinginside: false
on series.column.dataLabels as well.Expected behaviour
DataLabels outside of the column are not contrasted:
Actual behaviour
DataLables outside of the column are contrasted:
Live demo with steps to reproduce
https://jsfiddle.net/78oxr3mw/
Product version
Highcharts 8.1.2
Affected browser(s)
Chrome 84, Firefox 79, Firefox ESR 68
The text was updated successfully, but these errors were encountered: