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

Problem with line series -> datapoints with same x value -> mouseover/tooltip/etc. #6231

Closed
rikkert-jan opened this Issue Jan 11, 2017 · 9 comments

Comments

Projects
None yet
5 participants
@rikkert-jan

rikkert-jan commented Jan 11, 2017

Expected behaviour

When two points in the same series of a line chart share the same X value, it should not matter for the mouse-over event. When hovering on one of the points on the same x-value, the datalabel or tooltip corresponding to that specific point would show.

Actual behaviour

When hovering on a point which shares the same x value as another point in the same series, it shows only the tooltip of the point with the highest y value.

Live demo with steps to reproduce

JSFiddle initial (from highcharts demo "Time data with irregular intervals"):
http://jsfiddle.net/gh/get/jquery/3.1.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/spline-irregular-time/

JSFiddle altered:
http://jsfiddle.net/gmeq1zL8/1/

  1. Open highcharts demo "Time data with irregular intervals" in JSFiddle
  2. Alter first point in data array to have the same date (and thus x-value) as the next point in the same series
  3. Hover on both of the points that share the same X value/date
  4. Notice how highcharts mouseover only applies to one of the two points

@rikkert-jan rikkert-jan changed the title from Problem with line series -> datapoints with same x value to Problem with line series -> datapoints with same x value -> mouseover Jan 11, 2017

@rikkert-jan rikkert-jan changed the title from Problem with line series -> datapoints with same x value -> mouseover to Problem with line series -> datapoints with same x value -> mouseover/tooltip/etc. Jan 11, 2017

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng

oysteinmoseng Jan 16, 2017

Collaborator

This is because the spline tooltip searches for the closest point along the X axis only. In most cases this makes it easier to browse the chart. To change the behavior you can set kdDimensions: example.

This is also a duplicate of #5983. Should we consider adding an option in the API for this to make it more clear to users? @TorsteinHonsi

Collaborator

oysteinmoseng commented Jan 16, 2017

This is because the spline tooltip searches for the closest point along the X axis only. In most cases this makes it easier to browse the chart. To change the behavior you can set kdDimensions: example.

This is also a duplicate of #5983. Should we consider adding an option in the API for this to make it more clear to users? @TorsteinHonsi

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Jan 18, 2017

Collaborator

Should we consider adding an option in the API for this to make it more clear to users?

@oysteinmoseng Yes I think it's time for that. The current behaviour is that on scatter charts, the closest point in both x and y dimensions are picked, while in line-like charts, it only looks for the closest point in x dimension only.

The rationale for the current behaviour can be seen below. If we searched for the nearest neighbour in two dimensions, a spike in the data set would attract tooltips, so if would be difficult ho hover along the graph to read values successively.

The question is, what would be an intuitive name for this new option? tooltip.nearestPointDimension? tooltip.searchDimensions?

skjermbilde 2017-01-18 kl 09 39 15

Collaborator

TorsteinHonsi commented Jan 18, 2017

Should we consider adding an option in the API for this to make it more clear to users?

@oysteinmoseng Yes I think it's time for that. The current behaviour is that on scatter charts, the closest point in both x and y dimensions are picked, while in line-like charts, it only looks for the closest point in x dimension only.

The rationale for the current behaviour can be seen below. If we searched for the nearest neighbour in two dimensions, a spike in the data set would attract tooltips, so if would be difficult ho hover along the graph to read values successively.

The question is, what would be an intuitive name for this new option? tooltip.nearestPointDimension? tooltip.searchDimensions?

skjermbilde 2017-01-18 kl 09 39 15

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Jan 18, 2017

Contributor

Wouldn't be better to provide this setting for series, not tooltip? Just an idea.

Contributor

pawelfus commented Jan 18, 2017

Wouldn't be better to provide this setting for series, not tooltip? Just an idea.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Jan 18, 2017

Collaborator

Yes, absolutely.

Collaborator

TorsteinHonsi commented Jan 18, 2017

Yes, absolutely.

@rikkert-jan

This comment has been minimized.

Show comment
Hide comment
@rikkert-jan

rikkert-jan Mar 2, 2017

Awesome! Thanks for the replies.
May I inquire as to when we might expect this change to be released?
We have developed a quick fix for the time being, but we like to change this as soon as possible.

Thanks in advance!

rikkert-jan commented Mar 2, 2017

Awesome! Thanks for the replies.
May I inquire as to when we might expect this change to be released?
We have developed a quick fix for the time being, but we like to change this as soon as possible.

Thanks in advance!

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng
Collaborator

oysteinmoseng commented Mar 29, 2017

@1DMF

This comment has been minimized.

Show comment
Hide comment
@1DMF

1DMF Apr 28, 2018

This still doesn't work in stockchart, any idea when it will be fixed?

1DMF commented Apr 28, 2018

This still doesn't work in stockchart, any idea when it will be fixed?

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Apr 30, 2018

Contributor

Hi @1DMF - it looks fine in Highstock, take a look: http://jsfiddle.net/BlackLabel/02mv9nb9/4/ (note: tooltip.split and tooltip.shared options should be disabled - these options always use x-distance comparison).

Contributor

pawelfus commented Apr 30, 2018

Hi @1DMF - it looks fine in Highstock, take a look: http://jsfiddle.net/BlackLabel/02mv9nb9/4/ (note: tooltip.split and tooltip.shared options should be disabled - these options always use x-distance comparison).

@1DMF

This comment has been minimized.

Show comment
Hide comment
@1DMF

1DMF Apr 30, 2018

Thank you, it was tooltip.split: false, that solved it. Much appreciated!

1DMF commented Apr 30, 2018

Thank you, it was tooltip.split: false, that solved it. Much appreciated!

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