nueza99
Posts: 25
Joined: Tue Aug 18, 2020 5:14 am

Display alert for latest date data

Hi, I would like to display an alert, to show user the latest date and data . https://jsfiddle.net/gh/get/library/pur ... ents-load/ I want something like this but, how can I get the series data ? Any help would be really helpful
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Display alert for latest date data

Hi,

"this" in load function refers to chart. So you can get the data you need in this way.

Demo: https://jsfiddle.net/BlackLabel/cjtkL97n/

Let me know if that was what you were looking for!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
nueza99
Posts: 25
Joined: Tue Aug 18, 2020 5:14 am

Re: Display alert for latest date data

Yes, thank you, how about if I want to display the date also?..
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Display alert for latest date data

You're welcome!

The date is assigned to X in milliseconds, to make it readable you have to use the Date object.

I recommend you to see what "this" or in this case "lastData" is returning in the console. You can find a lot of information there.

Demo: https://jsfiddle.net/BlackLabel/o5bs23fv/
More about Date object in JS: https://developer.mozilla.org/en-US/doc ... jects/Date

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”