ifpi
Posts: 7
Joined: Wed Nov 09, 2022 7:01 pm

How to get data after datagrouping update to e.g. array, object?

How to get data after datagrouping update to e.g. array, object. Those on which the chart now operates?
Example.
I have a candlestick chart.
Data for the chart are downloaded with a time interval of 1 minute, e.g. 12:00, 12:01, ... 12:10, 12:11 ... etc.

Code: Select all

data: [
    [12:00, 7, 2, 0, 4],
    [12:01, 1, 4, 2, 8],
.......
    [12:11, 3, 3, 9, 3]
]
Then, using the button, I group the data up to 30 minutes of the period, e.g. 12:00, 12:30 ... 13:00, 13:30 ... etc.

Code: Select all

myHighChart_1.series[0].update({ dataGrouping: { forced: true, units: updateUnits } });
How can I retrieve this data after grouping for a period of 30 min e.g. array or other format, so that I can perform calculations on them.
for example:

Code: Select all

data: [
    [12:00, 7, 2, 0, 4],
    [12:10, 2, 4, 2, 8],
.......
    [13:00, 3, 3, 9, 3]
]
I also use the "Zoom" option.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: How to get data after datagrouping update to e.g. array, object?

Hello,

Welcome to our forum and thanks for contacting us with your question!

You can get this data from the chart object. More precisely, in a specific series, there is the groupedData property with grouped data.

Code: Select all

chart.series[0].groupedData

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

Let me know if that was what you were looking for!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
ifpi
Posts: 7
Joined: Wed Nov 09, 2022 7:01 pm

Re: How to get data after datagrouping update to e.g. array, object?

Thanks. Dzięki, to było to.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: How to get data after datagrouping update to e.g. array, object?

Nie ma za co! :wink:

In case of any further questions, feel free to contact us again.
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”