How can I add custom time line in react native svg charts

635 Views Asked by At

I am using react native svg charts to display some data on line chart .the data is associated with some time which need to be labelled on x axis can anybody tell me how can I do it.

1

There are 1 best solutions below

0
On

When we look at LineChart, it draws the lines like this.

  • It accepts 50 as points and 10 points and draws a line between

  • It accepts 10 as points and 40 points and draws a line between

    class LineChartExample extends React.PureComponent { render() { const data = [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>
     )
    

    } }