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

231
Visualizações
TypeError: Cannot read properties of undefined (reading 'activeDataLabelStyle')

I have a Highcharts graph on my React page and I redraw it after getting data by updating the state hook. This works well in development mode without any issues.

However, after npm run build and starting the application I get the error:

TypeError: Cannot read properties of undefined (reading 'activeDataLabelStyle')

If I leave the page and come back, the graph updates without any problems on selection but will still throw an error if I select to display after refreshing the page.

const [options, setOptions] = useState({
  title: {
    text: 'Speed of vehicle over time',
  },
  subtitle: {
    text: 'Select an area on the chart to zoom in.',
  },

  chart: {
    zoomType: 'x',
  },
  series: [
    {
      data: [],
    },
  ],
  xAxis: {
    type: 'datetime',
    labels: {
      formatter: function () {
        return Highcharts.dateFormat('%H:%M', this.value);
      },
    },
    title: {
      text: 'Time',
    },
  },
  yAxis: {
    title: {
      text: 'Speed (m/s)',
    },
  },
});

async function handleSelect(selected, setLoading) {
  const journey = await axios.get('/api/getJourney?id=' + selected.id);

  console.log(journey.data);

  setOptions({
    series: [
      {
        data: journey.data,
        name: 'Vehicle ' + selected.id,
      },
    ],
  });

  setLoading(false);
}
about 4 years ago · Juan Pablo Isaza
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