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

242
Vistas
Updating lightweight-charts candlestick series results in Uncaught TypeError: Cannot read properties of undefined (reading 'year')

When running update on candlestick series I'm getting Uncaught TypeError: Cannot read properties of undefined (reading 'year'). Data is prepared the same way it was for setData and look like this: [{time: 1649068320, open: '0.15721000', high: '0.15776000', low: '0.15710000', close: '0.15760000'}].

What am I missing here?

I tried to update with same data as was used with setData and got same error.

Also tried to prepare data this way: var time = moment(item.openTime); time = { year: time.year(), month: time.month(), day: time.day(), hour: time.hour(), minute: time.minute(), second: time.second(), } and var time = new Date(item.openTime)

Minimum steps to reproduce

import { createChart } from 'lightweight-charts';
var container = document.getElementById('price-chart');
const chart = createChart(container, {height:300});
chart.applyOptions({
    timeScale: {
        visible: true,
        timeVisible: true,
    },
});
const candlestick = chart.addCandlestickSeries();
candlestick.setData([{time: 1649102700, open: '3.39110000', high: '3.39130000', low: '3.38610000', close: '3.38670000'}]);
candlestick.update([{time: 1649102700, open: '3.39110000', high: '3.39130000', low: '3.38610000', close: '3.38670000'}]);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

update takes single object. so instead of

candlestick.update([{time: 1649102700, open: '3.39110000', high: '3.39130000', low: '3.38610000', close: '3.38670000'}]);

it should be

candlestick.update({time: 1649102700, open: '3.39110000', high: '3.39130000', low: '3.38610000', close: '3.38670000'});

Also:

  • You cannot use update on past data. So when scrolling backwards, you need to use setData
  • when setting data, array must be in chronological order or you will get Uncaught Error: Value is null.
about 4 years ago · Juan Pablo Isaza Denunciar
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