将图像放在折线图中的行尾(react-native-svg-charts)

我有一个使用react-native-svg-charts的折线图,我想在该行的末尾包含一个40px x 40px的PNG图片。这是我当前的代码:

<View style={styles.chartContainer}>
    <LineChart
        data={chartData}
        style={{ height: 100 }}
        svg={{ strokeWidth: 5,stroke: 'url(#gradient)' }}
        curve={shape.curveNatural}
        yMin={0}
        yMax={15}
        xMax={chartData.length + 1}
        contentInset={{ top: 30,bottom: 0,left: 50 }}>
        <Gradient />
    </LineChart>
    <View style={styles.chartFloor}></View>
</View>

它看起来像这样:

将图像放在折线图中的行尾(react-native-svg-charts)

我需要让它看起来像这样:

将图像放在折线图中的行尾(react-native-svg-charts)

我可以使用图表数据中的值来计算绝对位置,然后仅使用常规图像,但是使用SVG可能有一种更简单的方法。

出于记录目的,PNG图标也可以是SVG(我在SVG中也有它)。

a3345887 回答:将图像放在折线图中的行尾(react-native-svg-charts)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3020983.html

大家都在问