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

122
Vistas
'[object object]' in my Line Chart as well as the Data I want

so I created an object array with Times and Sizes for each object. I took that object array called 'Dates' and inserted it into my Line Chart labels and used parsing to only select the 'Date' within each object. I might have done it wrong, but it displays the labels, but with [object object] first five times.

All data is pulled from an API using an Axios and useEffect from NASA Near Earth Objects. I'm trying to create a timeline displaying the sizes throughout today.

The Graph labels

const Dates = [
            {DateNum: parseInt(DateOne.substring(12)), Time: DateOne.substring(12), Size: 'Object ' + [0] + ' ' + data[1].name},
            {DateNum: parseInt(DateTwo.substring(12)), Time: DateTwo.substring(12), Size: 'Object ' + [0] + ' ' + data[1].name},
            {DateNum: parseInt(DateThree.substring(12)), Time: DateThree.substring(12), Size: 'Object ' + [0] + ' ' + data[1].name},
            {DateNum: parseInt(DateFour.substring(12)), Time: DateFour.substring(12), Size: 'Object ' + [0] + ' ' + data[1].name},
            {DateNum: parseInt(DateFive.substring(12)), Time: DateFive.substring(12), Size: 'Object ' + [0] + ' ' + data[1].name},
        ]

        const sortedDates = Dates.sort((b, a) => b.DateNum - a.DateNum);


        // let DateTwoName = 'Object ' + [1] + ' ' + data[2].name;
        // let DateThreeName = 'Object ' + [2] + ' ' + data[3].name;
        // let DateFourName = 'Object ' + [3] + ' ' + data[4].name;
        // let DateFiveName = 'Object ' + [4] + ' ' + data[5].name;


        setTimeLineInfo(sortedDates);

const labels = TimeLineInfo;

return(
    //fragment
    <Line options = {{
    responsive: true,
    plugins: {
        legend: {
        },
        title: {
        display: false,
    },
    },
    }}
    data = {{
        labels,
        datasets: [
        {
            label: '5 Objects today by time',
            data: TimeLineInfo,
            parsing: {
                xAxisKey: 'Time'
            },
            borderColor: 'rgba(255, 102, 0, 1)',
            backgroundColor: 'rgba(255, 102, 0, 0.5)',
        }
        ],
    }}
    height = {800}
    width = {1200}
    />
)

Ignore the Size entry I have not completed it yet.

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