react-native-animated-charts
react-native-animated-charts copied to clipboard
Feature request for ChartXLabel overlay
Would be really cool to see a pattern like this added in a future release where you could optionally toggle the ChartXLabel to appear as an overlay on the chart itself. It's typically done at the top with a vertical line marking its current position (see the Apple Stock and Robinhood examples).
That would be cool! :)
I won't guarantee to focus on this, but I think we might need sth similar in Rainbow
Is this effect achievable somehow?
I'm trying achieve this effect via a <ChartComponent/> inside the ChartPathProvider but it only moves when the screen is re-rendered.
const ChartComponent = () => {
const values = useChartData()
console.log(values.positionX)
const positionValue = values.positionX.value
return (
<View
style={{
height: 40,
width: '100%',
}}
>
<ChartYLabel
style={{
position: "absolute",
color: "#ed8000",
backgroundColor: "white",
fontSize: 16,
left: positionValue,
}}
/>
</View>
)
}