Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

311
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda