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

Annotation tooltip not being displayed. #1063

Closed
cauemarcondes opened this issue Mar 8, 2021 · 6 comments · Fixed by #1167
Closed

Annotation tooltip not being displayed. #1063

cauemarcondes opened this issue Mar 8, 2021 · 6 comments · Fixed by #1167
Assignees
Labels
bug Something isn't working :interactions Interactions related issue released Issue released publicly :tooltip Related to hover tooltip

Comments

@cauemarcondes
Copy link

cauemarcondes commented Mar 8, 2021

Describe the bug
When I move the mouse cursor from the data to the annotation, it will not display the tooltip for the annotation, but if I move my mouse out of the chart then back in on the annotation from the top, then it does display the tooltip.

Expected behaviour
The tooltip should be shown no matter where the mouse is coming from.

Screenshots

Screen.Recording.2021-03-25.at.14.04.07.mov

Kibana Cross Issues
elastic/kibana#91339 (comment)

@cauemarcondes cauemarcondes added the bug Something isn't working label Mar 8, 2021
@markov00 markov00 added :interactions Interactions related issue :tooltip Related to hover tooltip labels Mar 16, 2021
@rshen91 rshen91 self-assigned this Mar 18, 2021
@rshen91
Copy link
Contributor

rshen91 commented Mar 25, 2021

Hi @cauemarcondes thank you for taking the time to write up this issue. I'm trying to reproduce this and am having trouble finding this problem locally. For reference, in the playgound.tsx file within elastic-charts I'm testing with this playground:


import { Chart, Settings, LineSeries, ScaleType, LineAnnotation, LineAnnotationDatum, Position } from '../src';
import { Icon } from '../src/components/icons/icon';

function generateAnnotationData(values: any[]): LineAnnotationDatum[] {
  return values.map((value, index) => ({ dataValue: value, details: `detail-${index}` }));
}
export class Playground extends React.Component {
  render() {
    return (
      <div className="story-chart story-root root">
        <Chart size={[500, 200]}>
          <Settings showLegend showLegendExtra />
          <LineAnnotation
            id="test_annotation"
            domainType="xDomain"
            dataValues={generateAnnotationData([5])}
            marker={<Icon type="dot" />}
            markerPosition={Position.Top}
          />
          <LineAnnotation
            id="test_annotation_2"
            domainType="xDomain"
            dataValues={generateAnnotationData([5.5])}
            marker={<Icon type="dot" />}
            markerPosition={Position.Top}
          />
          <LineSeries
            id="line"
            xScaleType={ScaleType.Linear}
            yScaleType={ScaleType.Linear}
            xAccessor={0}
            yAccessors={[1]}
            data={[
              [0, 103, 'group0'],
              [1, 13, 'group1'],
              [2, 102, 'group2'],
              [3, 12, 'group3'],
              [4, 103, 'group0'],
              [5, 100, 'group1'],
              [6, 3, 'group2'],
              [7, 13, 'group3'],
              [8, 23, 'group2'],
              [9, 123, 'group3'],
            ]}
          />
        </Chart>
      </div>
    );
  }
}

Can you provide the steps to reproduce the visualization in Kibana for us to better help? Or alternatively, if you're able to set up a codesandbox for us to see the problem, that would be really helpful! Thanks

@cauemarcondes
Copy link
Author

Can you provide the steps to reproduce the visualization in Kibana for us to better help?

Hi @rshen91 , you can test it on this URL https://dev-oblt.elastic.dev/app/apm/services/opbeans-java/overview?rangeFrom=now-7d&rangeTo=now&latencyAggregationType=avg

Screen.Recording.2021-03-25.at.14.04.07.mov

@rshen91
Copy link
Contributor

rshen91 commented Apr 8, 2021

Interesting! So in x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx when commenting out onPointerUpdate={setPointerEvent} this bug seems to go away. It looks like the issue is in the react hook in x-pack/plugins/apm/public/context/chart_pointer_event/use_chart_pointer_event_context.tsx. What is onPointerUpdate doing in timeseries_chart.tsx (can this be removed)?

@cauemarcondes
Copy link
Author

@rshen91 sorry for the late response. The use_chart_pointer_event_context is responsible to show the tooltip in all the charts when hovering over one.

Unfortunately, it cannot be removed. But we followed this example to implement it https://elastic.github.io/elastic-charts/?path=/story/interactions--cursor-update-action

@nickofthyme nickofthyme self-assigned this May 5, 2021
@nickofthyme
Copy link
Collaborator

I'll take another look at this.

@nickofthyme
Copy link
Collaborator

🎉 This issue has been resolved in version 30.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working :interactions Interactions related issue released Issue released publicly :tooltip Related to hover tooltip
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants