victory
victory copied to clipboard
VictoryArea flickering and showing decimal values in label
When VictoryArea is used with the animated
parameter, the label is blinking and showing decimal values that are not present in data
.
In the Expo Snack example, the simple function is used on labels
to show the value of x
. I assume it's because of the animated values, but as mentioned here #493, in my understanding the value used in data
would be persisted.
Is there any workaround to resolve this?
react-native: 0.71.10 victory-native version: 36.6.8
- https://snack.expo.dev/@camilossantos/victory-area-issue In the example I use this type of values for an animated object to facilitate the demonstration of the problem.
import { VictoryArea } from 'victory-native';
const sampleData = [
{ x: 1, y: 2, y0: 0 },
{ x: 2, y: 3, y0: 1 },
{ x: 3, y: 5, y0: 1 },
{ x: 4, y: 4, y0: 2 },
{ x: 5, y: 6, y0: 2 },
];
export default function App() {
return (
<VictoryArea
data={sampleData}
labels={({ datum }) => datum.x}
animate={{
duration: 10000,
onLoad: { duration: 2000 },
}}
/>
);
}
Did you find any solution to this flickering ?
Same thing happening here
Closing as duplicate of #1997