I want to show icon on Victory Scatter instead of default circle in React Native. I tried using the below code, but the icon is being placed at the top left corner irrespective of any given x and y point. The icon is not getting placed based on the given x and y points. Need help to find the issue with my code to fix the bug.
Below is the code and screenshot.
import {Svg, Image} from 'react-native-svg'
class DataPoint extends React.Component {
render() {
const {x, y} = this.props
return (
<Svg x={x} y={y} width="20" height="20">
<Image
width="20"
height="20"
// eslint-disable-next-line max-len
xlinkHref="https://s3.amazonaws.com/feedbackhouse-media-development/static/images/profie_image_placeholder/596e4f5df3be5b1ff99461c3"
/>
</Svg>
)
}
}
<VictoryScatter
data={[
{
x: 100,
y: 100
}
]}
dataComponent={<DataPoint />}
/>
here is a demo: https://snack.expo.io/@nomi9995/victory-native
remove SVG wrapper around Image then it will work good.