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

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

Closed
rikkert-jan opened this issue Jan 11, 2017 · 9 comments
Assignees
Milestone

Comments

@rikkert-jan
Copy link

@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 Problem with line series -> datapoints with same x value Problem with line series -> datapoints with same x value -> mouseover Jan 11, 2017
@rikkert-jan rikkert-jan changed the title Problem with line series -> datapoints with same x value -> mouseover Problem with line series -> datapoints with same x value -> mouseover/tooltip/etc. Jan 11, 2017
@oysteinmoseng
Copy link
Member

@oysteinmoseng 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
Copy link
Collaborator

@TorsteinHonsi 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
Copy link
Contributor

@pawelfus pawelfus commented Jan 18, 2017

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

@TorsteinHonsi
Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi commented Jan 18, 2017

Yes, absolutely.

@rikkert-jan
Copy link
Author

@rikkert-jan 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!

@1DMF
Copy link

@1DMF 1DMF commented Apr 28, 2018

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

@pawelfus
Copy link
Contributor

@pawelfus 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
Copy link

@1DMF 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.