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

312
Vistas
I am trying to use a json file for plotting with react-plotly.js but it doesn't work
import React, { Component } from "react";

import Plot from "react-plotly.js";
import PostData from "./EngineData3D.json";
 class EngineData3D extends Component {

PostData = this.PostDataPostData.map((postDetail, index) => {
    return <div>
        x: {postDetail.AFR}
        y:{postDetail.engine_load}

    </div>
}
)
render() {

    return (
        <div>
            <Plot />
            data={
                [
                    {
                        type: 'bar',
                        mode: 'lines',
                        x: this.PostData(this.state.postDetail.AFR)['x'],
                        y: this.PostData(this.state.postDetail.engine_load)['y'],
                        marker: { color: 'pink' }
                    }
                ]
            }
            layout ={{ width: 1000, height: 500, title: 'Engine Data' }}


        </div>
        )
    }
}
export default EngineData3D

And my Json file name is EngineData3D.json is at the same folder with the .js file.

I am trying to use the data in the .json file to visualize data to have a plot using react-plotly.js

I am new with plotly , I would be grateful if you help me correct my .js code.

about 4 years ago · Santiago Gelvez
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