victory icon indicating copy to clipboard operation
victory copied to clipboard

Label value is displaying adjacent to the bar

Open akumath14 opened this issue 2 years ago • 1 comments

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 have read through the FAQ and Guides

  • [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. Screen Shot 2022-05-03 at 2 12 39 PM

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.

akumath14 avatar May 03 '22 19:05 akumath14

Can someone provide me with some information on this?

akumath14 avatar May 12 '22 02:05 akumath14

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 avatar Nov 03 '22 14:11 lauradecc

@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.

Screenshot 2022-12-15 at 12 38 32 PM

rachnarai avatar Dec 15 '22 07:12 rachnarai

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.

github-actions[bot] avatar Mar 02 '24 00:03 github-actions[bot]

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.

github-actions[bot] avatar Mar 09 '24 01:03 github-actions[bot]