KEMBAR78
fix: restrict custom data label colors by DiegoCardoso · Pull Request #10205 · vaadin/web-components · GitHub
Skip to content

Conversation

@DiegoCardoso
Copy link
Contributor

Description

To ensure a good contrast between the background color of a series and its data label color, a custom color is calculated and set to the data labels. That works well for some types of charts where the labels are placed within an area colored by the series color, like for Organization, Gantt, and Treemap. For other types, however, it can lead to unexpected results when the data labels are placed in an area covered by the chart's background, when useHTML is used.

This change restricts the setting of these custom colors to the types mentioned above, where they are expected to work well.

Example of data labels with the default color

image

Example of data labels with the custom color

image

Fixes #9988

Type of change

  • Bugfix

To ensure a good contrast between the background color of a series and
its data label color, a custom color is calculated and set to the data
labels. That works well for some types of charts where the labels are
placed within an area colored by the series color, like for
Organization, Gantt, and Treemap. For other types, however, it can lead
to unexpected results, when the data labels are placed in an area
covered by the chart's background, when `useHTML` is used.

This change restricts the setting of these custom colors to the types
mentioned above, where they are expected to work well.

Fixes #9988
@sonarqubecloud
Copy link

@DiegoCardoso DiegoCardoso merged commit 1d27210 into main Sep 22, 2025
9 checks passed
@DiegoCardoso DiegoCardoso deleted the fix/charts/data-labels-colors branch September 22, 2025 12:57
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 25.0.0-alpha12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data labels colors do not work as expected in some configs in styled mode

3 participants