victory
victory copied to clipboard
Label value is displaying adjacent to the bar
Questions
For discussions about features or questions about how to use Victory, please start a new discussion rather than opening an issue.
Bug Reports
Checklist
-
[x] I am using the latest version of Victory
-
[x] I've searched open issues to make sure I'm not opening a duplicate issue
The Problem
I would like to have all chart labels right-aligned so that they appear in a single column rather than being stacked at the end of the corresponding bar in each row.
Reproduction
Please try to reproduce the issue you're seeing in a sandbox. You can fork this sandbox to get started.
If you can't reproduce your issue in a sandbox, please create a minimal git repo that demonstrates the problem you're seeing. Include instructions for installing and reproducing your error.
Feature Requests
Checklist
-
[x] I've read through the Docs and Guides to make sure this functionality doesn't already exist
-
[x] I've searched open issues to make sure I'm not opening a duplicate issue
Description
Please describe the feature you're requesting in detail.
Can someone provide me with some information on this?
I had a similar issue and solved it by passing the property y
to the component instance that labelComponent
takes (it would be x
in your case, as you are using horizontal bars).
You can try to use this example code on the editable source window under the labelComponent section to check if it solves your need:
<VictoryBar
data={sampleData}
horizontal
labels={({ datum }) => datum.y}
style={{ labels: { fill: "red" } }}
labelComponent={<VictoryLabel x={410} />}
/>
@lauradecc I wish to have a different labels in a Bar graph. I want to have SVGs on it. How could I do that?
I would want to override the existing labels to have something like this.
This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.