3

CodeSandbox

When I try to change chart data with the top panel — it works, but when I hover on chart it changes data repeatedly. Why is this happening?

For example click on the 'week' and after that hover on the chart below.

2
  • 2
    Please post your code here. Commented Mar 25, 2019 at 15:22
  • @Colin, sorry, I can not update the question when I add the code - it says that I need to add a little description, I add it and still does not allow updating the question Commented Mar 25, 2019 at 15:37

2 Answers 2

2

I was watching the CodeSandbox that you gave, and I see that you have the tooltips intersect with value : false and that I think it will use the tooltip mode all the time, and not when you want soo try to put it like this and see if it works:

tooltips: {
      mode: "index",
      intersect: true
    },

Sugestion: Add this to renderLi(refering to CodeSandbox sample)

onMouseOver={() => {
      this.setState({ selectedIdx: key });
      this.props.itemKey(key);
    }}
Sign up to request clarification or add additional context in comments.

5 Comments

Hi, Daniel. Yeah, I know, but I need fast tooltip showing when hovering on the chart. It's bad :( Does it has another solution?
Well I was trying but i dont find a way to, so my advice is to keep it like that or separate the data to different charts but at the same place with a mini "custom menu at the top". Oh and add the code that I will put on the post to your sample, it looks a little bit more dynamic ;)
Understood. Thanks for your help!
I answered on my question. Solution was founded, you can check it. I will not remove the tick from you :)
Yes thx for that, It might help me too, ill give a point to that! ;)
2

I added chart to global scope. If chart exists and is not equal null ⇒ it will be destroyed. Corresponding flickering was vanished

if (window.eChart && window.eChart !== null) {
  window.eChart.destroy();
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.