Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

307
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!