Potential bug in line marker

Posted by: amy.pryor on 5 January 2021, 3:26 am EST

  • Posted 5 January 2021, 3:26 am EST

    Hi,

    I have been having some trouble with the line marker not displaying the nearest point. This value is incorrect right from the initial hover event, so I don't think it's an issue with my implementation.

    To reproduce the bug:
    - Create a simple line chart with a steep line series
    - Hover the line marker in between the largest and second largest points, so that the largest point is shown in the line marker
    - Move your mouse down vertically while staying at the same position horizontally
    - The line marker then shows the second largest point even though the line marker position has not changed.

    The line marker seems to show the closest point by euclidean distance from the cursor, when I would expect it to show the closest point horizontally from the line marker. This causes problems when have steep series, or several points close to each other.
  • Replied 5 January 2021, 5:37 pm EST

    Hello Amy,

    This is the default behavior of LineMarker. It displays the closest point calculated using Euclidean distance. For your requirements, try setting the seriesIndex property of LineMarker to 0.

    https://stackblitz.com/edit/js-4wqgyy

    Regards,
    Ashwin
  • Replied 6 January 2021, 1:55 am EST

    Hi,

    Thanks for your response. I've also been having some trouble using the line marker for range area charts: it only appears if you are hovering over the min or max line, and only if you are hovering over an x point. It doesn't seem to work if you hover between points, or between lines, i.e anywhere inside the range area.

    Thanks
  • Replied 7 January 2021, 5:03 pm EST

    Hi Amy,

    If the seriesIndex is set, then the LineMarker will only work with that particular series and only with the last item in that series. Moreover, the ranges in the range area charts are only for display. The marker should only work with the main data points.

    You will need to set the seriesIndex property to the actual series index which is used for displaying main data points and not the ranges.

    For example, if you have 3 series in a range area charts, 1st and 2nd series is used to display ranges and the 3rd series displays the actual points, then the seriesIndex should be set to 2 (index of 3rd series).

    ~regards
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels