eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

this.chartRef.series[0].addPoint(point), getting undefined

hi

I am getting TypeError: Cannot read properties of undefined (reading 'series') for
this.chartRef.series[0].addPoint(point)
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

Hi eraka!
It is hard to tell you what is not working and what could be done without taking look at your code. Could you reproduce the issue in an online editor that I could work on? You can start here: https://codesandbox.io/s/highcharts-rea ... =/demo.jsx

I am looking for your response.
Kind regards!
Hubert Kozik
Highcharts Developer
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

Actually i am trying to show point item on screen which i get from api, but not able to see a point.
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

Problem resolved, it was issue with dates...my bad. thanks!!
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

That's great to hear! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

Hi

in chartOptions I am trying to set Yaxis max value as

max: this.arr.length;


but its saying it is used before initialization thoug i have defined it in ngonInit.


help
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

eraka,

The error message is saying everything you need to know. You are trying to use a variable before its initialization. Sadly, I can't tell you what is not working and what could be done without taking look at your code, so please reproduce it in some online editor.

Regards!
Hubert Kozik
Highcharts Developer
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

yes i understand the error very well... the issue is how can we set chartOptions.Yaxis.max value without hardcoded?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: this.chartRef.series[0].addPoint(point), getting undefined

eraka,

Here you can find the documentation for Highcharts Angular wrapper: https://github.com/highcharts/highchart ... ts-angular
And here is a simple demo with yAxis.max as a variable, without hardcoding: https://github.com/highcharts/highchart ... setoptions

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Gantt”