Skip to content

Replace offsetX and offsetY with padding in ValueLabels #1375

@markov00

Description

@markov00

Is your feature request related to a problem? Please describe.
The current offsetX and offsetY property used in the bar value labels, is used to push the label far from the geometry edges. It basically represents the same behavior of a padding but without the hassle of configuring the offset based on the rotation.

Describe the solution you'd like
We can replace the offsets with a single padding value, this should cover the general cases and it can also improve situations like the following where the label is centered by has an offset of 2px. The label on the blue bar should be anyway centered, the padding can be ignored to correctly fill all the text in the center, or completely remove the value if it doesn't fit in width together with his padding.
Screenshot 2021-09-13 at 10 18 20

Additional context
see elastic/eui#4845

Metadata

Metadata

Assignees

No one assigned

    Labels

    :annotationAnnotation (line, rect, text) related issue:stylingStyling related issue:theme:xyBar/Line/Area chart relatedenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions