Skip to content

dataLabel color should be able to apply contrast color when it's in the bar chart #17413

@tkforce

Description

@tkforce

Description of the feature

According to the documentation for series.bar.dataLabels.color : https://api.highcharts.com/highcharts/series.bar.dataLabels

The text color for the data labels. Defaults to undefined. For certain series types, like column or map, the data labels can be drawn inside the points. In this case the data label will be drawn with maximum contrast by default. Additionally, it will be given a text-outline style with the opposite color, to further increase the contrast. This can be overridden by setting the text-outline style to none in the dataLabels.style option.

It seems that the contrast color for data label will only exist in type: column
https://www.highcharts.com/demo/column-comparison

image

But I think it's also very useful in ordinary bar chart where data labels sometime gets pushed into the bar:
https://codesandbox.io/s/elated-jones-i5y7qo?file=/src/App.js:774-784

截圖 2022-06-21 14 07 04

Is it possible to apply this auto contrast color for dataLabel in bar chart? Or are there any workarounds that you'd suggest me to try it out?

Library related to the feature

Highcharts

Proof of Concept/Live example for the feature

https://codesandbox.io/s/elated-jones-i5y7qo?file=/src/App.js:774-784


You can vote for this feature by adding a thumbs-up reaction to this post.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions