Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highstock: Grouped data doesn't include additional data #4628

Closed
igitur opened this issue Oct 6, 2015 · 2 comments
Closed

Highstock: Grouped data doesn't include additional data #4628

igitur opened this issue Oct 6, 2015 · 2 comments

Comments

@igitur
Copy link

igitur commented Oct 6, 2015

Please refer to https://jsfiddle.net/igitur/6pLej7x6/2/

I'm using a Highstock chart and the data series is an array of objects, each containing x, y and some_other properties. For a low number of items (e.g. set max_items to 100), the tooltip correctly displays some_other property in the tooltip. However, for large values of max_items (e.g. 999), the data is grouped and the some_other property doesn't appear in series.points, hence the tooltip doesn't render the some_other property.

I believe the line https://github.com/highslide-software/highcharts.com/blob/master/js/parts/Series.js#L653 is the culprit:
points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i]))); It doesn't reuse the additional properties. I'm unsure how to fix this myself.

@TorsteinHonsi
Copy link
Collaborator

Yes, when the points are grouped, they are not used at all. Instead, new group points are generated from the group X and the Y data according to the approximation setting.

A possible solution could be to provide a groupMap, a parallel array sitting on the series, which would contain information about each group point and what original point indexes the group exists of. Or better, this could be stored directly on the group point. Then your tooltip formatter could read that and get the original points from series.options.data.

What do you think about that?

@TorsteinHonsi
Copy link
Collaborator

Since 777525f, the group information is found in Point.dataGroup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants