0

I have a function where the data comes in random order and not in one block. This is my array:

this.props.data = [
{date: "07", visitors: 0},
{date: "08", visitors: 8},
{date: "09", visitors: 14},
{date: "10", visitors: 17},
{date: "11", visitors: 23},
{date: "12", visitors: 31},
{date: "13", visitors: 40}]

And the following chart code

<LineChart data={this.props.data}>
  <XAxis dataKey='date' label={{ value: "Horas", position: "insideBottom", dy: 10} } />
  <YAxis label={{ value: 'Visitantes', angle: -90, position: 'insideLeft' }}/>
  <Tooltip/>
  <Line type="monotone" dataKey="visitors" stroke="#001529" activeDot={{r: 5}}/>
</LineChart>

The issue is, my highest visitors value is lower on the chart than the first. (Reminder: He is 5 times greater than the first one). Lowest value

Highest value

There is some problem inside my code? Or is this an issue of recharts?

4

1 に答える 1