如何在react原生svg图表中添加自定义时间线



我正在使用react原生svg图表在折线图上显示一些数据。这些数据与一些需要在x轴上标记的时间相关。有人能告诉我该怎么做吗?

当我们查看LineChart时,它会像这样绘制线条。

  • 它接受50作为点和10点,并在之间画一条线

  • 它接受10分和40分,并在之间画一条线

    类LineChartExample扩展React.PureComponent{render(({常量数据=[50,10,40,95,-4,-24,85,91,35,53,-53,24,50,-20,-80]

    return (
    <LineChart
    style={{ height: 200 }}
    data={data}
    svg={{ stroke: 'rgb(134, 65, 244)' }}
    contentInset={{ top: 20, bottom: 20 }}
    >
    <Grid />
    </LineChart>
    )
    

    }}

最新更新