Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
How can i create a horizontal scrolling chart in react using rechartjs?

I'd like to create a areachart with Rechart.js but having the y-axis fixed position when i scroll.

Whats happening for me is the data gets crumbled, how could i make it scroll-able, i could'nt able to find in the docs also, Any ideas?

Thank you

  const validate = React.useCallback(() => {
    setArr((prevState) =>
      [...prevState, { X: Math.random() >= 0.5 ? 5 : 0 }]
    );
  }, []);

  React.useEffect(() => {
    if (timeoutRef.current !== null) {
      clearTimeout(timeoutRef.current);
    }
    const interval = 6000;
    const speed = 1000;
    for (let i = 0; i < interval; i++) {
      timeoutRef.current = setTimeout(() => {
        timeoutRef.current = null;
        validate();
      }, i * speed);
    }
  }, [validate]);
  return (
    <div>
      <h1>{time}</h1>
      <AreaChart
        width={730}
        height={250}
        data={arr}
        margin={{ top: 5, right: 30, left: 20, bottom: 5 }}
      >
        {/* <CartesianGrid strokeDasharray='3 3' /> */}

        <YAxis />
        <XAxis additive='sum' />
        <Tooltip />
        <Legend />
        <Area
          type='monotone'
          dataKey='X'
          stroke='#8884d8'
          isAnimationActive={false}
          additive='sum'
        />
        <Brush startIndex={0} endIndex={10}>
          <AreaChart>
            <Area dataKey='X' isAnimationActive={false} />
          </AreaChart>
        </Brush>
      </AreaChart>
    </div>
  );
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda