victory icon indicating copy to clipboard operation
victory copied to clipboard

VictoryLabel on Android renders duplicate emoji characters on top of each other.

Open Tuuben opened this issue 3 years ago • 3 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

Rendering Emoji strings with <VictoryLabel /> on Android causes some weird issues where the Emoji renders twice on top of each other.

Pie chart example: Screenshot 2022-06-10 at 17 00 39

Bar chart example: Screenshot 2022-06-10 at 11 18 21

Example where normal text + emoji's are rendered as a label on pie chart: Screenshot 2022-06-10 at 11 10 18

Reproduction

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.

https://github.com/Tuuben/VictoryChartRNAndroidEmojiLabelBug/tree/main

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.

Tuuben avatar Jun 10 '22 14:06 Tuuben

We had the same problem. Do you manage to work around it ?

oromis300 avatar Nov 28 '22 15:11 oromis300

Hello @Tuuben and @oromis300 I have the same issue. Did you manage to find a workaround ? Thanks

Mobu34 avatar Mar 23 '23 15:03 Mobu34

Fixed this by adding a custom tick label component


import { Text } from 'react-native'
import { ForeignObject } from 'react-native-svg'
...

<VictoryAxis
  dependentAxis
  tickLabelComponent={<TickLabel />}
/>

...

const TickLabel = (props: { text?: string; y?: number }) => {
  const { y, text, ...rest } = props

  return (
    <ForeignObject {...rest} y={y - 10}>
      <Text>{text}</Text>
    </ForeignObject>
  )
}

j1mie avatar Nov 14 '23 13:11 j1mie

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]