Skip to content
This repository has been archived by the owner on May 14, 2023. It is now read-only.

Align Text label to center in BranchWiseOffers Chart #44

Open
hussamkhatib opened this issue Aug 10, 2022 · 0 comments
Open

Align Text label to center in BranchWiseOffers Chart #44

hussamkhatib opened this issue Aug 10, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed Priority: Low

Comments

@hussamkhatib
Copy link
Owner

This is a hacky solution to somewhat align it center.

<Text
   x={bar.x + bar.width / 2 - 5}  
   textAnchor="middle"  .....>
        {bar.value}
</Text>

The problem : width is always equal to the value of text , hence the props width: bar.width and textAnchor="middle" won't be useful.
If we can find a way to make it equal to bar width, centering with those props will become easy.

Screenshot from 2022-08-10 10-36-56

@hussamkhatib hussamkhatib added the help wanted Extra attention is needed label Aug 10, 2022
@hussamkhatib hussamkhatib added enhancement New feature or request Priority: Low labels Nov 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed Priority: Low
Projects
None yet
Development

No branches or pull requests

1 participant